Skip to main content

Crate agentmux_mcp

Crate agentmux_mcp 

Source
Expand description

agentmux-mcp — MCP stdio server that exposes AgentMux’s MuxAPI tools (Shell, SendMessage, memory, panes, …) to Claude.

Claude Code launches this binary as an MCP server (via .mcp.json’s "command": "agentmux-mcp" entry, auto-injected by agent_config.rs). Communication is JSON-RPC 2.0 over stdin/stdout.

The Shell tool starts a persistent shell process on agentmux-srv and returns immediately with a shell_id. Output streams live in the conversation as a ShellNode row without blocking the agent.

Env vars (inherited from agentmux-srv’s agent env injection): AGENTMUX_LOCAL_URL — sidecar HTTP base URL AGENTMUX_AUTH_KEY — X-AuthKey header secret AGENTMUX_BLOCKID — block UUID for shell event scoping (preferred). Injected by agent_handlers/input.rs into every persistent subprocess env; inherited by this MCP subprocess. AGENTMUX_AGENT_BUS_ID — MuxBus routing identifier (fallback only). Often set to the agent type string (e.g. “claude”) in .mcp.json, NOT the block UUID — do not use it as the shell scope unless AGENTMUX_BLOCKID is absent.

Modules§

doctor 🔒
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.
identity 🔒
Agent identity at the MCP boundary, jekt ids and outgoing jekt / UI-automation signatures. Split out of main.rs unchanged (SPEC_LARGE_FILE_MODULE_ANALYSIS_2026_09_30.md §4.2).
self_keys 🔒
Identity M4d-3: this agent’s signing keys, fetched from srv (GET /agentmux/agents/self/keys) rather than only read from .mcp.json (SPEC_AGENT_IDENTITY_CARRIED_NOT_DERIVED_2026_09_23.md §6.5.10).
srv_http 🔒
HTTP helpers for calls to the sidecar srv. Split out of main.rs unchanged (SPEC_LARGE_FILE_MODULE_ANALYSIS_2026_09_30.md §4.2).
tool_helpers 🔒
Helpers the tool handlers share: cron, durations, quit-self and bulk-stop outcomes, delivery text. Split out of main.rs unchanged (SPEC_LARGE_FILE_MODULE_ANALYSIS_2026_09_30.md §4.2).
tool_schemas 🔒
MCP tool schemas — the inputSchema JSON advertised to the client, one const per tool.
tools 🔒
call_tool’s handlers, one file per tool family (docs/specs/SPEC_LARGE_FILE_MODULE_ANALYSIS_2026_09_30.md §4.2 (a)). Each family’s call handles the tools it owns and returns not_in_family() for any other name, so no tool list is written twice.
window_capture 🔒
Window capture and discovery, plus the audit log both write.

Structs§

LoopEntry 🔒
Metadata kept alongside each running loop’s task handle.

Functions§

call_tool 🔒
main 🔒

Type Aliases§

LoopRegistry 🔒
In-process registry of running loops, keyed by loop_id. Lives for this MCP process’s lifetime (== the agent session), so loops are reaped automatically when the agent pane closes.