Repository navigation
fix: stop auto-approving user MCP server tools in headless claude runs - #200
Merged
currentbits merged 1 commit intoAug 16, 2026
Merged
Conversation
#126) --allowedTools was built from every active server, so a user-registered (possibly remote) MCP endpoint got mcp__<name>__* blanket approval in headless -p runs, covering tools added server-side after registration. Only coder-memory/coder-threads are pre-approved now; user servers stay in the mcp config and go through the normal permission path. Co-Authored-By: Claude Opus 5 <[email protected]>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
currentbits
deleted the
coder/security-user-registered-mcp-servers-get-2a6797
branch
October 3, 2026 16:07
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.
Closes #126.
getClaudeMcpArgsbuilt--allowedTools=mcp__<name>__*from allactiveServers(), which includes user-registered servers synced in from settings. In headless-pruns there is no permission prompt, so every tool a user-added (possibly remote) MCP server exposes ran unapproved — including tools added server-side after registration, since the rule covers the whole namespace.Now only first-party servers (
coder-memory,coder-threads) go into the allow rule. User servers stay in the mcp config (still reachable) but go through the normal permission path. When no first-party server is up the flag is omitted entirely rather than emitted empty.Skipped: the per-server "auto-approve in headless" opt-in setting the issue floats — no one has asked for it; add when a user actually wants a specific server pre-approved.
Test:
electron/test/skills.test.js— user server absent from the allow rule but present in the mcp config; user-servers-only → no--allowedToolsat all. Fullnpm run test:electron(781) andnpm run typecheckpass.🤖 Generated with Claude Code