/doctor reports false positive "Missing environment variables" warnings for MCP servers configured via settings.json env block

Resolved 💬 3 comments Opened Mar 20, 2026 by alien8d Closed Mar 23, 2026

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:

  1. User runs make claude-env-dev (or manually sets vars) → writes env vars to .claude/projects/.../settings.json
  2. The command tells user to restart Claude Code
  3. After restart, /doctor still shows "Missing environment variables" warnings
  4. 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

  1. Configure .mcp.json with env vars using ${VAR} syntax (e.g., "LANGSMITH_API_KEY": "${LANGSMITH_API_KEY}")
  2. Set those vars in .claude/projects/.../settings.json under the env key
  3. Run /doctor
  4. 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.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗