claude-code - 💡(How to fix) Fix enableAllProjectMcpServers should default to false for security [2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#46739Fetched 2026-04-12 13:34:19
View on GitHub
Comments
2
Participants
2
Timeline
6
Reactions
0
Timeline (top)
labeled ×4commented ×2

enableAllProjectMcpServers is not set to false by default, meaning cloning any repository that contains a .mcp.json file will auto-load those MCP servers into the Claude Code session without user consent.

Root Cause

enableAllProjectMcpServers is not set to false by default, meaning cloning any repository that contains a .mcp.json file will auto-load those MCP servers into the Claude Code session without user consent.

RAW_BUFFERClick to expand / collapse

Description

enableAllProjectMcpServers is not set to false by default, meaning cloning any repository that contains a .mcp.json file will auto-load those MCP servers into the Claude Code session without user consent.

Security concern

A malicious repository could include a .mcp.json that loads attacker-controlled MCP servers. When a developer clones the repo and opens Claude Code, those servers are automatically available — no prompt, no confirmation. This is a supply-chain attack vector via repository configuration files (similar to malicious .vscode/settings.json or .npmrc in cloned repos).

Proposed fix

Default enableAllProjectMcpServers to false. Require explicit opt-in per project or a one-time confirmation prompt when project-level MCP servers are detected.

References

  • Check Point research demonstrated MCP config hijacking as an attack vector
  • Trail of Bits recommends enableAllProjectMcpServers: false in their security config

Environment

  • Claude Code 2.1.84
  • Windows 10

extent analysis

TL;DR

Default enableAllProjectMcpServers to false to prevent automatic loading of MCP servers from cloned repositories.

Guidance

  • Set enableAllProjectMcpServers to false in the Claude Code configuration to mitigate the security concern.
  • Require explicit opt-in per project or implement a one-time confirmation prompt when project-level MCP servers are detected.
  • Verify the fix by cloning a repository with a .mcp.json file and checking that the MCP servers are not automatically loaded into the Claude Code session.
  • Consider updating the default configuration in future versions of Claude Code to reflect this security best practice.

Example

No code snippet is provided as the issue does not require a specific code change, but rather a configuration update.

Notes

This fix assumes that the enableAllProjectMcpServers configuration option is available and functional in Claude Code version 2.1.84. If this option is not available, alternative mitigation strategies may be necessary.

Recommendation

Apply the workaround by setting enableAllProjectMcpServers to false, as this is a straightforward and effective way to address the security concern. This change is recommended based on the security research and guidelines provided by Check Point and Trail of Bits.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix enableAllProjectMcpServers should default to false for security [2 comments, 2 participants]