Skip to main content

Module doctor

Module doctor 

Source
Expand description

agentmux-mcp doctor [--heal]: why this agent’s AgentMux tools aren’t connected, run from its shell with no MCP session (docs/specs/SPEC_AGENT_MCP_SELF_HEAL_2026_10_10.md §7). It checks what a person would check by hand: that this binary starts and answers MCP, also through Claude Code’s shell prefix the way the CLI starts it; the agent’s .mcp.json; what srv saw and tried; and Claude Code’s own log for the server. Read-only, except --heal, which asks srv to run the repair for the caller’s own pane.

Structs§

Entry 🔒
The agentmux entry in the agent’s .mcp.json: its command and args.
Report 🔒
Srv 🔒

Constants§

HANDSHAKE_TIMEOUT 🔒
INITIALIZE 🔒

Functions§

check_cli_log 🔒
check_config 🔒
check_handshakes 🔒
Start the server the way the CLI does, and without the prefix too, so a failure says which part broke.
check_srv 🔒
cli_cache_dir 🔒
Where Claude Code keeps its per-project caches (the env-paths cache folder for claude-cli). Its own layout, so a miss is reported, not an error.
handshake 🔒
Send initialize and wait for the answer: the server’s version, or why not.
log_outcome 🔒
What the CLI’s log says happened: the last attempt’s error, with what the server printed on stderr (the useful half), or that it connected.
project_key 🔒
Claude Code’s folder name for a project: its path with every character that isn’t a letter or digit made -.
request_heal 🔒
run
Run the checks, print the report, and return the exit code: 1 when a check failed.
srv_health_line 🔒
One line on what srv saw and did, from its mcp-health answer.