Skip to content

fix(workspaces): auto-trust project MCP servers in claude adapter#244

Open
Brandouttt wants to merge 1 commit into
TraderAlice:masterfrom
Brandouttt:feat/claude-adapter-mcp-autotrust
Open

fix(workspaces): auto-trust project MCP servers in claude adapter#244
Brandouttt wants to merge 1 commit into
TraderAlice:masterfrom
Brandouttt:feat/claude-adapter-mcp-autotrust

Conversation

@Brandouttt
Copy link
Copy Markdown

Summary

Workspaces launched through the claude adapter never connected to the OpenAlice MCP server — the agent saw zero mcp__open-alice__* tools. Root cause: Claude Code parks every project-scoped .mcp.json server at "⏸ Pending approval" (the trust gate for .mcp.json shared via VCS), and a launcher PTY has no interactive session to approve it. Users hit this as "MCP 啟動唔到".

  • Inject --settings '{"enableAllProjectMcpServers":true}' in claudeAdapter.composeCommand so project MCP servers auto-trust at spawn.
  • CLI injection (not a written .claude/settings.json) mirrors the codex adapter's -c mcp_servers.openalice.url=... and the earlier --allowedTools direction in 5816b88.
  • Added claude.spec.ts covering the fresh / resume-by-id / settings-shape / resume="last"-throws paths.

Test plan

  • npx vitest run src/workspaces/adapters/claude.spec.ts — 4/4 pass
  • npx tsc --noEmit — no new errors (3 pre-existing in core/agent-work.spec.ts on master, unrelated)
  • Empirically verified against claude 2.1.x: --mcp-config, --dangerously-skip-permissions, and --permission-mode bypassPermissions do NOT clear the gate; only enableAllProjectMcpServers flips the server from "⏸ Pending approval" → "✓ Connected" (via claude mcp list).

Boundary touch

None — workspace launcher adapter only. No trading / auth / broker / migration code.

🤖 Generated with Claude Code

Claude Code parks every project-scoped `.mcp.json` server at "⏸ Pending
approval" — the trust gate for `.mcp.json` shared via VCS. In a launcher
workspace there is no interactive session to approve it, so the OpenAlice
MCP tool surface never connects and the agent sees zero `mcp__open-alice__*`
tools. Users hit this as "MCP 啟動唔到".

Inject `--settings '{"enableAllProjectMcpServers":true}'` in the claude
adapter's composeCommand. CLI injection (not a written settings file)
mirrors the codex adapter's `-c mcp_servers.openalice.url=...` approach and
the author's earlier `--allowedTools` direction (5816b88).

Verified empirically against claude 2.1.x that `--mcp-config`,
`--dangerously-skip-permissions`, and `--permission-mode bypassPermissions`
do NOT clear this gate — only `enableAllProjectMcpServers` flips the server
from "Pending approval" to "✓ Connected".

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 1, 2026

@Brandon-tecky is attempting to deploy a commit to the luokerenx4's Team Team on Vercel.

A member of the Team first needs to authorize it.

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.

2 participants