Feature: Agent-accessible config diagnostics tool (programmatic /doctor)

Resolved 💬 3 comments Opened Apr 2, 2026 by uptownhr Closed Apr 6, 2026

Problem

When Claude Code's agent encounters a configuration error (e.g., invalid MCP server schema, malformed settings), it has no programmatic way to diagnose the issue. The agent can read config files but cannot validate them against schemas or check connection status.

Real-world example: I wrote "type": "url" in .mcp.json when the correct value was "type": "sse". The agent had no way to detect this — the user had to manually run /doctor, screenshot the error, and share it back. This round-trip is slow and defeats the purpose of an autonomous coding agent.

Current state

  • /doctor and claude doctor exist but are user-facing only — the agent cannot invoke them or read their output
  • mcp__ide__getDiagnostics exists for IDE/LSP diagnostics but not for Claude Code's own config
  • Community tools (cc-health-check, claude-config-doctor, claude-health) fill gaps but aren't integrated
  • Related issues: #29824 (MCP validation), #6846 (SDK health monitoring)

Proposal

Expose a tool (or set of tools) that allows the agent to programmatically access diagnostic information, similar to what /doctor provides:

getDiagnostics() → {
  mcp_servers: [{ name, status, errors }],
  settings: { valid, errors },
  keybindings: { valid, errors },
  plugins: [{ name, status, errors }],
  version: { current, latest }
}

This would let the agent:

  1. Self-diagnose config issues instead of asking the user to run /doctor
  2. Validate changes before suggesting a restart (e.g., after editing .mcp.json)
  3. Proactively fix schema errors, missing fields, or invalid values

Alternatives considered

  • Running claude doctor via Bash: Not available inside the agent's session
  • Schema validation in the agent: Possible but fragile — schemas change, and connection status can't be checked this way
  • Community skills: Useful but don't have access to internal state (connection status, runtime errors)

🤖 Generated with Claude Code

View original on GitHub ↗

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