Skip to content

Add agent-scoped MCP repo tools and dispatch-dev#58

Merged
selfcontained merged 3 commits into
mainfrom
agent-scoped-mcp-repo-tools
Mar 15, 2026
Merged

Add agent-scoped MCP repo tools and dispatch-dev#58
selfcontained merged 3 commits into
mainfrom
agent-scoped-mcp-repo-tools

Conversation

@selfcontained

Copy link
Copy Markdown
Owner

Summary

  • Adds agent-scoped MCP route (POST /api/mcp/:agentId) that resolves repo context from the agent's working directory and serves repo-specific project.* tools from .dispatch/tools.json alongside built-in MCP tools
  • Adds bin/dispatch-dev — standalone dev-stack helper that auto-selects free ports and starts isolated Postgres + API + optional Vite with state persistence in /tmp and full lifecycle commands (up/down/restart/status/logs/url)
  • Fixes Claude Code MCP config format (mcpServers wrapper) and wires both Codex and Claude launch commands to inject the agent-scoped MCP URL
  • Aligns AGENTS.md and CLAUDE.md documentation to describe the dispatch-dev workflow

Test plan

  • npm run check — type checking passes
  • npm test — 49 unit tests pass (including new repo-tools, agent-manager, and dispatch-dev lifecycle tests)
  • npm run test:e2e — 25 Playwright tests pass
  • Manual smoke test: dispatch-dev up/status/logs/url/down cycle
  • Manual verification: agent-scoped MCP endpoint returns project.* tools via curl
  • Manual verification: Claude agent connects to dynamic MCP server and sees all tools

🤖 Generated with Claude Code

selfcontained and others added 3 commits March 14, 2026 23:19
- Agent-scoped MCP route (POST /api/mcp/:agentId) resolves repo context
  from the agent's cwd and serves repo-specific project.* tools alongside
  built-in tools (worktree, PR management)
- Repo tool manifest loaded from .dispatch/tools.json with project.*
  namespace enforcement and command-backed execution
- Codex launch injects agent-scoped MCP URL via -c flag
- Claude launch injects agent-scoped MCP URL via --mcp-config with
  correct mcpServers wrapper format
- Standalone bin/dispatch-dev script: auto-selects free ports, starts
  isolated Postgres + API server + optional Vite, persists state to /tmp,
  supports up/down/restart/status/logs/url commands
- dispatch-dev flags: --vite, --live (tmux runtime), --no-db, --suffix,
  --cwd, --follow; restart preserves flags from previous state
- Hardening: early crash detection, node preflight check, stale state
  cleanup, graceful shutdown with SIGKILL fallback
- Aligned AGENTS.md and CLAUDE.md to describe dispatch-dev workflow
- Tests for repo tool loading, agent launch commands, and full
  dispatch-dev lifecycle (up/status/url/logs/down)

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Unset npm_config_prefix before sourcing nvm in dispatch-dev subshells.
GitHub Actions' setup-node sets this variable, which nvm rejects.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Subshells inherit the parent environment — node/npm are already on PATH.
nvm was only needed in the old script which launched bare tmux windows.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@selfcontained
selfcontained merged commit 511c3df into main Mar 15, 2026
1 check passed
@selfcontained
selfcontained deleted the agent-scoped-mcp-repo-tools branch March 15, 2026 05:38
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