Project-scoped MCP servers don't trigger approval prompt
Bug Report: Project-scoped MCP servers don't trigger approval prompt
Summary
When starting a Claude Code session in a project containing .mcp.json, the expected approval prompt for project-scoped MCP servers never appears. Users must manually create .claude/settings.local.json to enable servers, bypassing the intended security workflow.
Expected Behavior
- Start Claude Code session in project with
.mcp.json - Approval prompt appears: "This project wants to use MCP servers: [list]. Approve?"
- On approval,
.claude/settings.local.jsonis automatically created with enabled servers - Servers become available in
/mcp
Actual Behavior
- Start Claude Code session in project with
.mcp.json✅ - No approval prompt appears ❌
-
.claude/settings.local.jsonis NOT created ❌ - Servers do NOT appear in
/mcplist ❌ - Must manually create
.claude/settings.local.jsonwithenabledMcpServersarray
Steps to Reproduce
- Create project directory
- Add
.mcp.jsonwith MCP server configurations:
{
"mcpServers": {
"google-workspace": {
"command": "uv",
"args": ["--directory", "/path/to/server", "run", "main.py"],
"env": { ... }
}
}
}
- Start Claude Code session in project:
claude code - Expected: Approval prompt appears
- Actual: No prompt, servers not available
Observed Issues
-
claude mcp listdoes NOT show project-scoped servers from.mcp.json - No approval prompt at session start
- No indication that
.mcp.jsonwas even detected - Possible conflict when same-named servers exist in user-scoped config
Environment
- OS: macOS Darwin 25.0.0
- Claude Code CLI (latest)
-
.mcp.jsonexists in project root with valid configuration
Workaround
Manually create .claude/settings.local.json:
{
"enabledMcpServers": ["google-workspace", "mcp-datetime"]
}
Impact
- Breaks documented security model for project-scoped MCP servers
- Users unaware of
.claude/settings.local.jsonrequirement - No visibility into which servers are project vs user-scoped
- Approval mechanism completely non-functional
Suggested Fixes
-
Critical: Trigger approval prompt on session start when
.mcp.jsondetected - Add
--verboseflag to show MCP server discovery/loading process - Show scope indicators in
claude mcp list(user/project/local) - Warn when project servers conflict with user-scoped servers
- Document
.claude/settings.local.jsonapproval mechanism clearly
Update: Workaround confirmed working + documentation issue
After further investigation, the manual workaround does work, but the required .claude/settings.local.json structure is undocumented. The correct format is:
{
"permissions": {
"allow": [
"mcp__server-name__*"
],
"deny": []
},
"enableAllProjectMcpServers": true,
"enabledMcpjsonServers": [
"server-name"
]
}
Key findings:
- Property is
enabledMcpjsonServers(notenabledMcpServers) - Requires
enableAllProjectMcpServers: trueflag - Requires
permissions.allowarray withmcp__<server-name>__*pattern -
Name conflicts: Project-scoped servers with same names as user-scoped servers are completely ignored (recommend using unique names like
server-name-local)
After restart with correct .claude/settings.local.json structure, project-scoped servers now appear in /mcp list.
Core bug remains: No approval prompt appears on session start - users must manually create this file with the correct (undocumented) structure.
Found 3 possible duplicate issues:
- https://github.com/anthropics/claude-code/issues/6855
- https://github.com/anthropics/claude-code/issues/3321
- https://github.com/anthropics/claude-code/issues/1313
This issue will be automatically closed as a duplicate in 3 days.
- If your issue is a duplicate, please close it and 👍 the existing issue instead
- To prevent auto-closure, add a comment or 👎 this comment
🤖 Generated with Claude Code
Can you run /doctor from Claude Code in this project? When we've seen this before, it was a parsing issue from an invalid settings.json file.
I ran /doctor in this project and don't have any reported issues. Mind you I experienced this bug when there was no settings.json file in existence - Claude Code never created one in this project folder when I first used the claude command in the terminal. I think the only thing that may be different is the first time I initiated this session for the first time I did 'claude --dangerously-skip-permissions'
Can confirm this issue. Through systematic testing of both official methods:
Test 1: Official CLI method
- Used
claude mcp add --scope projectto add servers - Started
claude codesession in project directory - Result: ❌ No approval prompt appeared, servers not loaded,
/mcpshowed "No MCP servers configured"
Test 2: Official manual .mcp.json method
- Manually created
.mcp.jsonwith three MCP server configurations (HTTP, SSE, stdio transports) - Started
claude codesession in project directory - Result: ❌ No approval prompt appeared, servers not loaded,
/mcpshowed "No MCP servers configured"
Test 3: Applied workaround from this issue
- Created
[project]/.claude/settings.local.jsonwith minimal configuration:
{
"permissions": {
"allow": ["mcp__*"]
},
"enableAllProjectMcpServers": true
}
- Restarted
claude codesession - Result: ✅ All three servers loaded successfully and functional
Tested variations of workaround:
-
enableAllProjectMcpServers: true+ explicitenabledMcpjsonServersarray → works -
enableAllProjectMcpServers: true+ wildcard permissions only → works (more maintainable)
Both official methods documented at https://docs.claude.com/en/docs/claude-code/mcp#project-scope fail - manual workaround required.
Environment: macOS 26.0.1, Claude Code v2.0.27
here is something else I have discovered, if you use any of the MCP add to the project scope and you try to run, as the next action 'claude --dangerously-skip-permissions' then it skips the part where it asks if you want to allow use of the newly added project MCP servers. That feels like an instance where that permission should be skipped but the MCP servers made available nonetheless, but they are not made available.
Workaround Confirmed: Permission Acceptance Required
I can confirm this issue and have found a critical detail about the workaround:
Root Cause:
When you have a local .mcp.json file, you MUST run Claude Code without --dangerously-skip-permissions at least once in that project for it to accept and load the .mcp.json configuration.
Why This Matters:
-
.mcp.jsonfiles require explicit user trust/approval - Running with
--dangerously-skip-permissionsbypasses the permission dialog - Without the initial approval, MCP servers in
.mcp.jsonwon't be loaded - This only needs to be done once per project
Reproduction Steps:
- Add/modify
.mcp.jsonin your project - Run
claudewith--dangerously-skip-permissions(common workflow) - Result: No approval prompt appears, MCP servers don't load
-
claude mcp listshows "No MCP servers configured"
Working Workflow:
- Add/modify
.mcp.jsonin your project - Run
claudewithout--dangerously-skip-permissions - Accept the MCP server trust dialog when prompted
- Restart Claude Code
- MCP servers now load correctly
Environment:
- macOS
- Claude Code (latest version as of 2025-10-27)
- Testing with Playwright MCP server in project-scoped
.mcp.json
This explains why many users see silent failure - if they always use --dangerously-skip-permissions, they never see the approval dialog that's required for .mcp.json to work.
The workaround is not working for me for existing project directories.
If I am using a new project directory, Claude does prompt for approval and when the approval is accepted, the mcp servers that are allowed in ~/.claude/settings.json and managed-settings.json are written to the enabledMcpjsonServers list in the
This is the behavior I am seeing if the project directory already exists:
Reproduction Steps:
- Add/modify .mcp.json in your project
- .claude/settings.json has "enabledMcpjsonServers": ["test-server"],
- Run claude
- Result: No approval prompt appears, MCP servers don't load
- claude mcp list shows "No MCP servers configured"
Working Workflow:
- Add/modify .mcp.json in your project
- .claude/settings.json has "enabledMcpjsonServers": ["test-server"],
- Enable the mcp server in ~/.claude/settings.json
"allowedMcpServers": [{"serverName": "test-server"}]
You can also enable the server in managed-settings.json - Run claude
User is not asked to approve the mcp server+ - MCP server now loads correctly
The mcp servers are NOT written to .claude/settings.local.json
Environment:
- Windows 11
- Claude Code v2.0.55