claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

Project scope MCP servers not displayed in claude mcp list command

Open WarrenZhu050413 opened this issue 4 months ago • 14 comments

[BUG] Project scope MCP servers not displayed in claude mcp list command

Environment

  • Platform (select one):
    • [x] Anthropic API
    • [ ] AWS Bedrock
    • [ ] Google Vertex AI
    • [ ] Other:
  • Claude CLI version: 1.0.83 (Claude Code)
  • Operating System: macOS 14.3 (Darwin 24.3.0)
  • Terminal: iTerm2

Bug Description

MCP servers added with project scope (-s project) work correctly during Claude Code execution and prompt for approval when starting sessions, but do not appear in claude mcp list output. This creates confusing user experience where servers are functional but invisible in the CLI listing.

Steps to Reproduce

  1. Navigate to any project directory
  2. Run claude mcp add -s project test-server echo "test"
  3. Verify server was added: claude mcp get test-server (this works)
  4. Start Claude Code in the project: observe approval prompt for "test-server" appears
  5. Run claude mcp list to see configured servers
  6. Observe that the project scope server does not appear in the list, despite being functional

Expected Behavior

Project scope servers added to .mcp.json should appear in claude mcp list output alongside user and local scope servers for consistency and transparency.

Actual Behavior

  • ✅ Project scope servers work correctly (prompt for approval, can be used during sessions)
  • ✅ Project scope servers can be managed via claude mcp get/remove commands
  • ❌ Project scope servers are invisible in claude mcp list output
  • /mcp slash command reports "No MCP servers configured" when only project scope servers exist

This creates confusing UX where functional servers appear "missing" in the primary listing command.

Additional Context

  • Project scope servers are correctly written to .mcp.json with proper JSON structure
  • Claude Code runtime successfully loads and prompts for approval of project scope servers
  • claude mcp get <name> successfully reads project scope servers and shows "Scope: Project config (shared via .mcp.json)"
  • claude mcp remove <name> -s project successfully removes project scope servers
  • Only user scope (-s user) and local scope (default) servers appear in claude mcp list
  • This appears to be a CLI reporting issue rather than a functional problem
  • Severity: Minor (confusing UX but servers work correctly)
  • Related issues: #1955 and #2156 (closed) reported similar behavior but focused on approval workflow
  • This report focuses specifically on the list command display issue that persists

Submitted via Claude Code

WarrenZhu050413 avatar Aug 17 '25 09:08 WarrenZhu050413

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/1955
  2. https://github.com/anthropics/claude-code/issues/3826
  3. https://github.com/anthropics/claude-code/issues/2156

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

github-actions[bot] avatar Aug 17 '25 09:08 github-actions[bot]

Hey there,

Just another user here, but wanted to chime in and say this is a really well-documented bug report. It's definitely confusing when the servers are clearly working (based on the approval prompt and in-session usage) but don't show up in the main list command.

It really does seem like a reporting bug in both claude mcp list and the /mcp slash command, rather than a functional issue. I was digging through the docs and the changelog, and everything confirms that project-scoped servers are a core feature (since v1.0.50 according to the changelog). The claude mcp list command was even updated in v1.0.58 to improve health status display, so it's strange that it's missing this scope.

Workaround

In the meantime, here's workarounds that might help you out:

  1. For checking a specific server: As you noted, claude mcp get <server-name> works perfectly to confirm a single project-scoped server is configured correctly.

  2. For listing all project servers: Since the info is right there in the .mcp.json file, you can use a quick shell command to list the server names directly. If you have jq installed, this works nicely:

    # In your project root, run this to list the names of all configured project servers
    jq -r '.mcpServers | keys[]' .mcp.json
    

It's not as good as the built-in command (no status info), but it at least gives you a quick list of what Claude should be seeing from the project config.

It's good that you referenced the other closed issues. Hopefully, with your detailed reproduction steps, the team can get this display issue patched up for good. Until then, hope the jq trick helps

coygeek avatar Aug 17 '25 17:08 coygeek

same problem here: .mcp.json is not read anymore. What is happening?

EDIT: I ran claude --debug and saw an error with my permissions.allow config/array (in settings.local.json). This is the line that was the cause of not loading mcp's: "Bash(find *)". The error was:

[DEBUG] Invalid settings in localSettings source - key: permissions.allow.9, error: [
  {
    "code": "custom",
    "message": "Use \":*\" for prefix matching, not just \"*\". Change to \"Bash(find :*)\" for prefix matching. Examples: Bash(npm run:*), Bash(git:*)",
    "params": {
      "received": "Bash(find *)"
    },
    "path": [
      "permissions",
      "allow",
      9
    ]
  }
]

TLDR; Remove all permissions in settings.local.json and see if it is working again.

Nikoms avatar Sep 01 '25 18:09 Nikoms

https://github.com/anthropics/claude-code/issues/5963#issuecomment-3243051224 This solution solved my problem! I removed the invalid settings reported and restarted claude, and the mcp server start working. Thanks!

cji3bp62000 avatar Sep 03 '25 14:09 cji3bp62000

Facing the same issue:

I have configured several MCP-servers (Supabase, Clickup, Context7) via .mcp.json in many projects.

However, on a new project i started to add this file too in the root-folder and restarted CC, but the mcp list is still missing (message: No MCP servers configured)

Running /doctor provides no useful information:

 Diagnostics
 └ Currently running: npm-global (1.0.108)
 └ Path: /Users/xxx/.nvm/versions/node/v20.17.0/bin/node
 └ Invoked: /Users/xxxx/.nvm/versions/node/v20.17.0/bin/claude
 └ Config install method: unknown
 └ Auto-updates enabled: default (true)
 └ Update permissions: Yes
 └ Search: OK (vendor)

But when I make a mistake in the .mcp.json, like using an API-Key as shell-variable that is not provided, the /doctor command will tell me "invalid or unexpected ENV variable". Fixing it back to the original state, hides this error message but doesnt list any mcp config either.

Running the command jq -r '.mcpServers | keys[]' .mcp.json (as suggested by @coygeek) will even list all configured servers.

itinance avatar Sep 08 '25 10:09 itinance

After running doctor --debug (as mentioned here https://github.com/anthropics/claude-code/issues/5963#issuecomment-3243051224) it suddenly detected my mcp-config in the local file .mcp.json. Now it sees the mcp-config even without running the debug-mode.

itinance avatar Sep 08 '25 10:09 itinance

Regarding the broken settings.json, which obviously causes CC to load local MCP configs, I asked Claude Code to write a script for fixing the settings accordingly: https://github.com/itinance/cc-settings-fixer

Feel free to automate!

itinance avatar Sep 08 '25 11:09 itinance

adding "enableAllProjectMcpServers": true to my settings.local.json or your global settings.json fixed it for me.

BumpyClock avatar Sep 19 '25 15:09 BumpyClock

Project-scoped MCP servers not listed due to invalid settings; fixed by permission pattern changes

Summary: Project-scoped MCP servers defined in .mcp.json were not showing up and /mcp initially reported none. The root cause was invalid Bash permission patterns in .claude/settings.json, which caused project settings (including enabledMcpjsonServers) to be ignored. After fixing the patterns to use :* suffix matching and removing unsupported mid-command wildcards, claude mcp list and /mcp both showed connected servers, and everything worked as expected.

Environment

  • Node.js: v20.19.5
  • Claude Code v1.0.117
  • MCP servers:
    • Context7 via bunx -y @upstash/context7-mcp@latest
    • Claude Flow via claude-flow mcp start

Symptoms

  • claude mcp list returned “No MCP servers configured” even after adding entries with --scope project.
  • /mcp inside a Claude Code session showed no servers and a notice about invalid settings.
  • claude --debug repeatedly logged “Invalid settings in projectSettings source” pointing to permissions.allow and permissions.deny.

Key debug output (excerpt)

[DEBUG] Invalid settings in projectSettings source - key: permissions.allow.0, error: 
  Use ":*" for prefix matching, not just "*". Change to "Bash(claude-flow :*)"
...
[DEBUG] Invalid settings ...
  Wildcards in the middle of commands are not supported. 
  Received: "Bash(curl * | bash)" and "Bash(wget * | sh)"

Root cause

  • Bash permission patterns in .claude/settings.json used bare * (e.g., Bash(git log *)) and unsupported mid-command wildcards (e.g., Bash(curl * | bash)), which invalidated the entire settings file.
  • Because settings were invalid, enabledMcpjsonServers was not applied, so project .mcp.json servers were effectively blocked.

Fix

  • Replaced every Bash(<prefix> *) with Bash(<prefix> :*) (prefix matching with :* only at the end).
  • Removed mid-command wildcards and normalized denies to prefix patterns.

Before (invalid examples):

"Bash(claude-flow *)",
"Bash(bun test *)",
"Bash(git diff *)",
"Bash(curl * | bash)",
"Bash(wget * | sh)",
"Bash(eval *)"

After (valid examples):

"Bash(claude-flow :*)",
"Bash(bun test :*)",
"Bash(git diff :*)",
"Bash(bash:*)",
"Bash(sh:*)",
"Bash(eval :*)"

Result

  • claude mcp list now shows:
    • context7: bunx -y @upstash/context7-mcp ... - ✓ Connected
    • claude-flow: claude-flow mcp start - ✓ Connected
  • /mcp UI shows “Status: connected” with the expected tools and capabilities for both servers.

Suggestion for UX/docs

  • When settings are invalid, surface a clear banner in /mcp and claude mcp list indicating that project servers are blocked due to settings validation errors, and point to the exact invalid keys.
  • Optionally highlight that project-scoped servers require valid settings for approval (enabledMcpjsonServers or enableAllProjectMcpServers) to avoid the “No servers configured” confusion when .mcp.json is otherwise correct.

edxeth avatar Sep 20 '25 21:09 edxeth

Can confirm this issue when using official project-scope methods, but it's resolved by the workaround from #9189.

Test without workaround (both official methods tried):

  • Method 1: Used claude mcp add --scope project to add servers via CLI
  • Method 2: Manually created .mcp.json with three MCP server configurations
  • Result with both methods: claude mcp list output: "No MCP servers configured"

Test with workaround from #9189:

  • Added .claude/settings.local.json with minimal configuration
  • Result: claude mcp list correctly shows all three project-scoped servers

Conclusion: This issue appears to be a symptom of #9189. When project-scoped servers fail to load (due to missing approval flow), they also don't appear in claude mcp list. Once the workaround from #9189 is applied and servers load correctly, claude mcp list works as expected.

Suggest this issue may be auto-resolved once #9189 is fixed.

Environment: macOS 26.0.1, Claude Code v2.0.27

clouatre avatar Oct 25 '25 22:10 clouatre

Can confirm this issue is still present in Claude Code v2.0.37 on macOS (Darwin 24.6.0).

WarrenZhu050413 avatar Nov 11 '25 21:11 WarrenZhu050413

Issue still exists in CC v2.0.55

mkbctrl avatar Nov 27 '25 21:11 mkbctrl

I has the same problem in Claude Code 2.0.60.

0anton avatar Dec 06 '25 10:12 0anton

+1

 Diagnostics
 └ Currently running: npm-global (2.0.62)
 └ Path: /Users/dkrom/.nvm/versions/node/v24.11.0/bin/node
 └ Invoked: /Users/dkrom/.nvm/versions/node/v24.11.0/bin/claude
 └ Config install method: global
 └ Auto-updates: default (true)
 └ Update permissions: Yes
 └ Search: OK (vendor)

KromDaniel avatar Dec 09 '25 16:12 KromDaniel