feat(mcp): make task tools github-issues-backend-aware#89
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why this is needed
The single-repo
github-issuesbackend shipped in #88 (CLIpick/list/create/claim/complete+ a backend-agnosticTask). The MCP server — how most agents read/write tasks — still operated only onTASKS.md, so on an issue-backed repo the MCP tools and the CLI disagreed about where tasks live. This makes the five MCP task tools backend-aware so both surfaces behave identically.What changed
packages/mcp/src/backend.ts(new) —resolveBackend(dir)(reads.tasksmd.jsonat the git root, defaulttasks-md),runTasksCli(args, cwd)(delegates to thetasksbinary; localnode_modules/.bin/tasks→npx -y @tasks-md/cli), and purebuildListArgs/buildPickArgsargv builders.packages/mcp/src/index.ts—list_tasks/pick_task/claim_task/complete_taskdelegate to thetasksCLI when the repo isgithub-issues(claim-on-pick preserved);unclaim_taskreturns a clear "unsupported on github-issues" message; thetasks-mdpath is untouched.packages/mcp/src/index.test.ts(new) —resolveBackend/runTasksClitests + argv-contract tests that pin the delegated flag surface (and assert it never emits--repo/--id, which the CLI'slist/pickreject).TASKS.md— scopedgithub-issues-backenddown to its sole remaining piece (cross-backend aggregation) and blocked it onworkspace-mode-nested-repos.Delegation keeps the backend single-sourced in the CLI rather than re-implementing a
ghclient in the MCP package (GET-don't-implement).Vision trace
Test plan
npm run buildclean;npm testgreen across all workspaces (CLI 209, lint 62, MCP 125, parser 84).tasks list --json --priority P1 --tag x --unclaimed --unblockedandtasks pick --json --tags a,bboth exit 0 with no stderr (commander accepts every flag the builders emit).npx -y @tasks-md/lint TASKS.md→ 0 errors.🤖 Written by an agent, not Fyodor. Ping me if this looks off.