[BUG] MCPs can only be seen from the directory you are in when they are added even though they are in the global config
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
MCP Server Detection Bug Report
Summary
Global MCP servers configured in ~/.claude/mcp_config.json are detected and work in one directory (fs-ci) but not in another (mobile-ios), even though both directories use the same global configuration file.
Environment
Claude Code Version: 2.1.7
System Information:
- OS: macOS 26.2 (Build 25C56)
- Kernel: Darwin 25.2.0
- Architecture: ARM64 (Apple Silicon)
- Node.js: v25.2.1
- npm: 11.7.0
Configuration
Global MCP Configuration
Location: ~/.claude/mcp_config.json
{
"mcpServers": {
"atlassian": {
"command": "mcp-remote",
"args": [
"https://mcp.atlassian.com/v1/mcp"
]
},
"github": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-github"
],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "[REDACTED]"
}
}
}
}
File Permissions: -rw-r--r-- (readable by all)
Local Project Configurations
mobile-ios: .claude/settings.local.json
{
"permissions": {
"allow": [
"Bash(find:*)",
"Bash(chmod:*)",
"Bash(./replace_person_manager_calls.sh:*)",
"mcp__XcodeBuildMCP__discover_projs",
"mcp__XcodeBuildMCP__list_schemes",
"mcp__XcodeBuildMCP__list_sims",
"mcp__XcodeBuildMCP__boot_sim",
"mcp__XcodeBuildMCP__open_sim",
"mcp__XcodeBuildMCP__build_sim",
"mcp__XcodeBuildMCP__clean",
"mcp__XcodeBuildMCP__get_sim_app_path",
"mcp__XcodeBuildMCP__get_app_bundle_id",
"mcp__XcodeBuildMCP__install_app_sim",
"mcp__XcodeBuildMCP__launch_app_logs_sim",
"mcp__XcodeBuildMCP__screenshot",
"mcp__XcodeBuildMCP__stop_sim_log_cap",
"Bash(./extract_and_chunk_pdf.sh:*)",
"Bash(brew list:*)",
"Bash(brew install:*)",
"Bash(python3:*)",
"Bash(swift build)",
"Bash(xcodebuild:*)",
"WebFetch(domain:beta.familysearch.org)",
"Skill(local-persistence)"
],
"deny": [],
"ask": []
}
}
fs-ci: .claude/settings.local.json
{
"permissions": {
"allow": [
"Bash(find:*)",
"mcp__atlassian__atlassianUserInfo",
"mcp__atlassian__search",
"mcp__atlassian__searchJiraIssuesUsingJql"
]
}
}
Observed Behavior
Working Directory: /Users/rickmeier1/sb/fs-ci
$ claude mcp list
Checking MCP server health...
atlassian: https://mcp.atlassian.com/v1/mcp (HTTP) - ✓ Connected
github: npx -y @modelcontextprotocol/server-github - ✓ Connected
✅ Result: Both MCP servers detected and connected successfully
Working Directory: /Users/rickmeier1/sb/mobile/mobile-ios
$ claude mcp list
No MCP servers configured. Use `claude mcp add` to add a server.
❌ Result: No MCP servers detected, despite using the same global config
Repository Context
Both directories are git repository roots:
mobile-ios: iOS multi-app repositoryfs-ci: CI/CD repository
Both have local .claude/ directories with settings.local.json files, but neither contains any local MCP configuration files (no mcp_config.json at project level).
Expected Behavior
The global MCP configuration in ~/.claude/mcp_config.json should be detected and used consistently across all directories. The claude mcp list command should show the same MCP servers (atlassian and github) in both directories.
Actual Behavior
The global MCP configuration is only detected in some directories but not others, despite there being no local MCP configuration that would override the global settings.
Potential Issues
- Directory-specific MCP detection logic: Something about the
mobile-iosdirectory prevents global MCP config discovery - Local settings interference: The presence of different local permissions in
settings.local.jsonmight affect MCP detection - Caching issue: MCP server list might be cached per-project and not refreshing
- Project initialization: The
mobile-iosproject might need some form of initialization to recognize global MCPs
Workarounds Attempted
None successful - the issue persists across sessions.
Additional Notes
- The permissions in
mobile-ios/.claude/settings.local.jsonreferencemcp__XcodeBuildMCP__*, but this MCP is not configured in the global config - The
.claude/directory structure differs slightly between projects (mobile-ios hasagents/andskills/subdirectories) - No local
mcp_config.jsonexists in either project directory
Reproduction Steps
- Create global MCP configuration in
~/.claude/mcp_config.json - Navigate to directory A and run
claude mcp list- servers appear - Navigate to directory B and run
claude mcp list- servers do not appear - Verify global config file has not changed and is readable
Impact
This prevents consistent use of MCP tools across different projects, requiring workarounds or manual configuration per project.
What Should Happen?
mcps should be available no mater which directory I start claude in
Error Messages/Logs
### Working Directory: `/Users/rickmeier1/sb/fs-ci`
$ claude mcp list
Checking MCP server health...
atlassian: https://mcp.atlassian.com/v1/mcp (HTTP) - ✓ Connected
github: npx -y @modelcontextprotocol/server-github - ✓ Connected
✅ **Result:** Both MCP servers detected and connected successfully
### Working Directory: `/Users/rickmeier1/sb/mobile/mobile-ios`
$ claude mcp list
No MCP servers configured. Use `claude mcp add` to add a server.
❌ **Result:** No MCP servers detected, despite using the same global config
Steps to Reproduce
cd dir1
claude mcp add ...
claude mcp list
... in the list
cd ../dir2
claude mcp list
<no mcps>
Claude Model
Not sure / Multiple models
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.7
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Other
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗