[BUG] /doctor v2.1.122 mislabels home-scope .mcp.json parse error path with cwd-template, masking actual file location
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?
/doctor MCP Config Diagnostics section reports parse errors against <cwd>/.mcp.json even when the actual broken file lives at ~/.mcp.json or ~/.claude/.mcp.json. The reported Location: field is templated from the current working directory, NOT derived from the file actually being parsed.
Three /doctor invocations from three different cwd values, all reading the SAME actual broken file at ~/.mcp.json, reported three different paths in this session:
# cwd = ~/.claude/plugins/local/
Location: /Users/<user>/.claude/plugins/local/.mcp.json
# cwd = ~/code/ogham-mcp/ (after cd + claude restart)
Location: /Users/<user>/code/ogham-mcp/.mcp.json
# cwd = ~/ (after cd + claude restart)
Location: /Users/<user>/.mcp.json
ls -la confirmed the first two paths did NOT exist on disk — they were phantom paths derived from cwd. Only the third was a real file. find ~ -maxdepth 4 -name '.mcp.json' was the only way to locate the actual broken file.
Makes debugging unnecessarily hard — users chase the diagnostic-reported path, find nothing there, and have to manually find the real file across all possible scopes (home, ~/.claude/, project, etc.).
What Should Happen?
Either:
- Report the actual file location parsed (e.g.
Location: /Users/<user>/.mcp.json (resolved via cwd tree-walk)), OR - Distinguish two cases in the output:
- "Expected at
<cwd>/.mcp.json(file does not exist — no project config)" - "Parsed from
~/.mcp.json(parse error: ...)"
Right now both cases collapse into the same Location: template, so users can't tell whether the reported path is where the bad file actually is, or just where Claude Code expected to find one. A small label change ("Location: <actual-file-path>") would eliminate this entire class of false leads.
Error Messages/Logs
Three real /doctor outputs from a single session, three different cwd values, all reading the SAME actual file at ~/.mcp.json:
# cwd = ~/.claude/plugins/local/
[Failed to parse] Project config (shared via .mcp.json)
Location: /Users/<user>/.claude/plugins/local/.mcp.json
└ [Error] mcpServers.ogham: Does not adhere to MCP server configuration schema
# cwd = ~/code/ogham-mcp/ (after cd + claude restart)
[Failed to parse] Project config (shared via .mcp.json)
Location: /Users/<user>/code/ogham-mcp/.mcp.json
└ [Error] mcpServers.ogham: Does not adhere to MCP server configuration schema
# cwd = ~/ (after cd + claude restart)
[Failed to parse] Project config (shared via .mcp.json)
Location: /Users/<user>/.mcp.json
└ [Error] mcpServers.ogham: Does not adhere to MCP server configuration schema
ls -la confirmed paths 1 and 2 do not exist on disk; only path 3 was real.
Steps to Reproduce
- Have a broken
.mcp.jsonat~/.mcp.jsonor~/.claude/.mcp.json. Example broken entry (deprecated bare-url schema):{"mcpServers": {"foo": {"url": "http://127.0.0.1:8742/sse"}}}(missingtypediscriminator). - From any directory that does NOT contain a
.mcp.json, runclaudethen/doctor. - Observe MCP Config Diagnostics output — Location field shows
<cwd>/.mcp.json(a path that does not exist on disk). - cd to a different directory, restart
claude, run/doctoragain — Location field now shows the new<cwd>/.mcp.json(still phantom). - The actual broken file remains at
~/.mcp.json— onlyfind ~ -maxdepth 4 -name '.mcp.json'reveals where it actually is.
Claude Model
None
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.122 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
Workaround: always run find ~ -maxdepth 4 -name '.mcp.json' 2>/dev/null first to locate the real file before trying to fix anything reported by /doctor.
A /mcp config-paths command listing all scopes Claude Code parses (project, home ~/.mcp.json, home-scope ~/.claude/.mcp.json, etc.) would also help users understand the resolution order independent of /doctor errors.
Discovered during yolo-labz/claude-mac-chrome plugin install on macOS Apple Silicon. Spent ~30 minutes chasing two phantom paths before running find to locate the real file. For users less familiar with shell tree-walks and MCP config scopes, this could be much longer.
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗