fix: respect user-provided enableAllProjectMcpServers value#1182
Open
qozle wants to merge 1 commit intoanthropics:mainfrom
Open
fix: respect user-provided enableAllProjectMcpServers value#1182qozle wants to merge 1 commit intoanthropics:mainfrom
qozle wants to merge 1 commit intoanthropics:mainfrom
Conversation
Previously, setupClaudeCodeSettings unconditionally overrode enableAllProjectMcpServers to true after merging user settings, making it impossible to disable project MCP servers via the settings input. Users with local .mcp.json files (e.g., servers requiring AWS credentials not available in CI) had no way to suppress project MCP loading and received permission denial errors on every run. Change the override to a nullish default so an explicit false (or true) is preserved; only absent values default to true. Fixes anthropics#1042 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Fixes #1042
Root cause
setupClaudeCodeSettingsunconditionally overwritesenableAllProjectMcpServerstotrueafter merging the user's settings input, making it impossible to opt out of project MCP server loading:Impact
Users with a
.mcp.jsoncontaining local-path MCP servers (e.g., servers that require AWS credentials not available in CI) cannot suppress project MCP loading. Every action run generates permission denial errors for tools that were never meant to run in CI.Fix
Replace the unconditional override with a nullish default so an explicit
false(ortrue) from the user is preserved. Only absent values fall back totrue:This matches the nullish-coalescing pattern already used elsewhere in the file (
homeDir ?? homedir()).Tests
"should override enableAllProjectMcpServers even if false in input"→ now verifiesfalseis respected, not overridden"should respect explicit true for enableAllProjectMcpServers"to cover the explicit-truecase