Repository navigation
fix(#936): phase agents get an .mcp.json allowlist instead of the full Claude Desktop config - #952
Merged
admarble merged 5 commits intoAug 20, 2026
Conversation
…cp.json allowlist for phase agents (#936) Phase agents inherited the user's entire Claude Desktop config via getMcpServersConfig(), including servers with literal secrets (desktop configs cannot use ${VAR} expansion) that the SDK serializes into the child process's --mcp-config argv. Adds getPhaseMcpServersConfig() in mcp-config.ts, which unions the project's own .mcp.json (secret-free, committed to git) with a guaranteed sequant entry, and never reads claude_desktop_config.json. Rewires the single driver call site (claude-code.ts). doctor.ts keeps using getMcpServersConfig() for interactive diagnostics only.
…passthrough (#936) Rewrites the MCP Server Support section in run-command.md and the Installation section in mcp-integrations.md, which previously instructed adding optional MCPs to Claude Desktop config for use with sequant run. Notes the doctor headless check still reports on desktop config and hasn't caught up with this change (tracked separately).
3 tasks
Addresses two gaps disclosed but deliberately deferred in the original #936 fix: 1. settings.run.mcpAllowlist lets a project opt specific Claude Desktop MCP server names into phase execution, per the issue's own proposed fallback design. getPhaseMcpServersConfig gains a desktopAllowlist option; project .mcp.json entries and the sequant entry always win over an allowlisted desktop entry of the same name. Threaded through both ExecutionConfig producers (config-resolver.ts, ready-gate.ts via commands/ready.ts) into AgentExecutionConfig, matching the existing #914 model/effort producer-parity pattern. 2. doctor's "MCP Servers (headless)" check read Claude Desktop config directly (getMcpServersConfig) and could warn "not available" even though phase agents always get at least the sequant server post-#936. Now calls getPhaseMcpServersConfig — the same builder phases actually use — and always reports pass with an accurate server count/source.
…ucers Closes the coverage gap between buildExecutionConfig / commands/ready.ts reading settings.run.mcpAllowlist and ready-gate.ts's own downstream forwarding test — without this, a producer that silently dropped the field would go undetected.
…P check Adds an "Allowlisting a Desktop-Only Server" section to run-command.md with the security caveat (literal secrets, ps visibility), a settings table row, a mention in mcp-integrations.md's Installation section, and updates the earlier "doctor hasn't caught up" notes now that doctor's headless check reads getPhaseMcpServersConfig instead of desktop config.
admarble
deleted the
feature/936-fix-mcp-phase-agents-receive-the-user-s-entire
branch
August 20, 2026 13:59
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.
Summary
sequant run//fullsolve) previously inherited the user's entire Claude Desktop config viagetMcpServersConfig(), including capability over-grant and literal secrets serialized into the child process's--mcp-configargv (Claude Desktop configs can't use${VAR}expansion).getPhaseMcpServersConfig()insrc/lib/mcp-config.tsunions the project's own.mcp.json(secret-free, committed to git) with a guaranteedsequantentry, and never readsclaude_desktop_config.jsonby default. Wired at the single driver call site,claude-code.ts:119— covers every phase path (sequant run,sequant ready,/fullsolve) since bothExecutionConfigproducers funnel into this driver.getMcpServersConfig()(desktop-reading) is kept fordoctor's interactive diagnostics only; its docstring warns against reuse for phase execution.settings.run.mcpAllowlist— the explicit per-server opt-in the issue itself proposed as a fallback — lets a project pass specific named Claude Desktop servers through to phases anyway, when a server genuinely has no.mcp.jsonhome yet. A name not present in the desktop config is silently ignored; project.mcp.jsonentries and the sequant server always win over an allowlisted desktop entry of the same name.doctor's "MCP Servers (headless)" check now callsgetPhaseMcpServersConfig(the same builder phases use) instead of reading Claude Desktop config directly — it always passes (sequant is guaranteed) and reports the real server count/source.run-command.mdand the Installation section inmcp-integrations.md, added an "Allowlisting a Desktop-Only Server" section with the security caveat.Pre-PR AC Verification
.mcp.jsonentriesmcp-config.ts:getPhaseMcpServersConfig(never reads desktop config by default);mcp-config.test.ts"excludes desktop servers…" +claude-code.test.ts"passes the phase allowlist to query()"mcp-config.test.ts"never leaks secret-bearing desktop env values…" — assertsJSON.stringify(result)excludes a literal fake secretrun.mcpas sequant-server injection, not desktop passthroughrun-command.mdMCP Server Support section +mcp-integrations.mdInstallation section rewritten;settings.ts/system.tsdocstrings updatedmcp-integrations.mdinstructs declaring optional MCPs in project.mcp.json, not desktop config.mcp.jsonexamples; troubleshooting note addedsettings.run.mcpAllowlistopt-in — a named server passes through only when explicitly allowlisted, and never overrides project.mcp.json/sequantmcp-config.test.ts"desktopAllowlist opt-in (#936)" (5 cases); threaded throughconfig-resolver.ts,ready-gate.ts/ready.ts,claude-code.tswith dedicated tests at each hopdoctor's headless MCP check reports on the same source phases actually usedoctor.tsnow callsgetPhaseMcpServersConfig;doctor.test.ts"MCP Servers (headless) check (#936)" (2 cases)Test plan
npm run build— passesnpm run lint— passes (0 errors)npm test— full suite: 268 files, 5512 passed, 1 expected fail (pre-existing), 2 skippedmcp-config.test.ts(11 new cases total — 6 for the base allowlist, 5 fordesktopAllowlist),claude-code.test.ts(3 new cases),doctor.test.ts(2 new cases),ready-gate.test.ts(2 new cases),ready.test.ts(1 new case),config-resolver.mcp-allowlist.test.ts(2 new cases, new file)Known gaps
None outstanding. Both gaps disclosed in the original review pass (
doctordrift, deferredmcpAllowlist) are now implemented above.Closes #936