Skip to content

feat(mcp): make task tools github-issues-backend-aware#89

Merged
fyodoriv merged 1 commit into
mainfrom
feat/mcp-github-issues-backend
May 29, 2026
Merged

feat(mcp): make task tools github-issues-backend-aware#89
fyodoriv merged 1 commit into
mainfrom
feat/mcp-github-issues-backend

Conversation

@fyodoriv
Copy link
Copy Markdown
Collaborator

Why this is needed

The single-repo github-issues backend shipped in #88 (CLI pick/list/create/claim/complete + a backend-agnostic Task). The MCP server — how most agents read/write tasks — still operated only on TASKS.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.json at the git root, default tasks-md), runTasksCli(args, cwd) (delegates to the tasks binary; local node_modules/.bin/tasksnpx -y @tasks-md/cli), and pure buildListArgs/buildPickArgs argv builders.
  • packages/mcp/src/index.tslist_tasks/pick_task/claim_task/complete_task delegate to the tasks CLI when the repo is github-issues (claim-on-pick preserved); unclaim_task returns a clear "unsupported on github-issues" message; the tasks-md path is untouched.
  • packages/mcp/src/index.test.ts (new) — resolveBackend/runTasksCli tests + argv-contract tests that pin the delegated flag surface (and assert it never emits --repo/--id, which the CLI's list/pick reject).
  • TASKS.md — scoped github-issues-backend down to its sole remaining piece (cross-backend aggregation) and blocked it on workspace-mode-nested-repos.

Delegation keeps the backend single-sourced in the CLI rather than re-implementing a gh client in the MCP package (GET-don't-implement).

Vision trace

  • Vision goal: tasks.md "Prefer small, obvious APIs … merge behavior instead of adding another public command" — MCP reuses the CLI backend rather than forking a second implementation.
  • User story: N/A — agent-facing MCP parity with the CLI backend; driven by the downstream github-issues rollout (agentbrew/dotfiles).
  • Competitor prior art: N/A — internal task-backend delegation.

Test plan

  • npm run build clean; npm test green across all workspaces (CLI 209, lint 62, MCP 125, parser 84).
  • Validated the delegated flags against the real built CLI: tasks list --json --priority P1 --tag x --unclaimed --unblocked and tasks pick --json --tags a,b both 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.

@fyodoriv fyodoriv merged commit 6b15db6 into main May 29, 2026
5 checks passed
@fyodoriv fyodoriv deleted the feat/mcp-github-issues-backend branch May 29, 2026 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant