/doctor reports false positive "Missing environment variables" warnings for MCP servers configured via settings.json env block
Bug Description
/doctor reports "Missing environment variables" warnings for MCP servers whose env vars are configured in the project-level settings.json env block — the correct and documented way to provide them.
This creates a confusing loop:
- User runs
make claude-env-dev(or manually sets vars) → writes env vars to.claude/projects/.../settings.json - The command tells user to restart Claude Code
- After restart,
/doctorstill shows "Missing environment variables" warnings - User runs the make target again → loop
Expected Behavior
/doctor should check the settings.json env block (both user-level and project-level) when evaluating whether MCP server environment variables are set, not just the shell environment.
Actual Behavior
/doctor only checks shell environment variables ($SHELL env). Since .mcp.json uses ${VAR} syntax that Claude Code resolves from settings.json at MCP server startup time, the vars ARE available to the MCP servers but /doctor doesn't know that.
Steps to Reproduce
- Configure
.mcp.jsonwith env vars using${VAR}syntax (e.g.,"LANGSMITH_API_KEY": "${LANGSMITH_API_KEY}") - Set those vars in
.claude/projects/.../settings.jsonunder theenvkey - Run
/doctor - Observe warnings like:
[Warning] [langsmith] mcpServers.langsmith: Missing environment variables: LANGSMITH_API_KEY
Environment
- Claude Code v2.1.80
- macOS (Darwin 25.2.0)
- 11 MCP servers configured in
.mcp.json
Impact
Users with many MCP servers see a wall of false warnings, making /doctor unreliable for identifying real issues. The false positives also create a frustrating restart loop as users try to resolve non-existent problems.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗