grpcproc
Documentation

AI agents (MCP)

grpcprocctl serves the Inspector as MCP tools, so an AI agent can inspect a cluster, read-only unless told otherwise.

grpcprocctl mcp is an MCP server over stdio. Its tools answer what the command line answers and return the same objects its --json prints. The server's instructions explain grpcproc to the agent: what a pid and a label are, what a deep mailbox or a busy process means.

Connecting

For Claude Code:

claude mcp add grpcproc -- grpcprocctl --plaintext --addr 10.0.0.5:9000 mcp

For any client that starts stdio servers from a configuration file:

{
  "mcpServers": {
    "grpcproc": {
      "command": "grpcprocctl",
      "args": ["--plaintext", "--addr", "10.0.0.5:9000", "mcp"]
    }
  }
}

The connection flags are grpcprocctl's own: TLS unless --plaintext, --cacert, --cert and --key. --timeout bounds each request a tool makes, and the server reports grpcprocctl's version to the client.

Tools

ToolWhat it answers
cluster_nodesEvery node the one serving the Inspector knows of, by the members its Membership reports and by links, with each one's links added up (by a metadata key, with group_links_by), and which could not be reached.
node_infoOne node: counts, dead letters, and each link with its traffic, queue and last error.
list_processesProcesses of a node, filtered by name, label, state or mailbox depth, and sorted: by mailbox, to find backlogs, or by busy time. At most 100 unless asked for more.
get_processOne process by pid or name, with what it says about itself, waiting a while for a busy one.
watch_eventsA node’s events, collected for a few seconds: spawns, exits with reasons, links, dead letters.
electionA leader election, as each node that takes part sees it, and who leads.
cron_jobsCron processes and their jobs, on a node or all of them.
saga_runsSaga runs by saga and status, a page at a time.
saga_runOne saga run: the error that stopped it, its waiting signals, and its data when the engine shows it.
global_namesWho holds a global name, or every name with a prefix, such as room:.
process_groupsA grpcproc/groups scope’s groups and its other nodes, as one node’s copy has them.
group_membersOne grpcproc/groups group’s members on every node, by pid.

With grpcprocctl mcp --allow-writes, it also offers the tools that change things:

ToolWhat it does
exit_processAsks a process to exit; its supervisor, if any, may restart it.
set_log_levelSets one process’s log level, to see more of it without restarting anything.
move_leaderHas an election’s leader hand over, to a node or to the most up-to-date follower.
cordon_node, uncordon_nodeKeeps a node from leading, to work on its host, or lets it lead again.
enable_cron_job, disable_cron_job, remove_cron_jobChanges a job of a cron process.
resume_saga_runMakes a stuck saga run active again.

The tools that stop a process, move a leader, cordon a node or remove a job are marked destructive, which a client can use to ask before it lets the agent run one.

Example

Asked why orders are slow, an agent might:

  1. call cluster_nodes, and see every node up, and no link failing;
  2. call list_processes on orders-1 sorted by mailbox, and find ledger-writer with 41 messages waiting, the oldest for a second;
  3. call get_process on it, and read inspect_error: busy for 1.187s: it is inside a handler, on one message;
  4. call watch_events, and see no exits or dead letters: the process is slow, not failing, so the cause is what that handler waits on.

With writes allowed, it could then raise the log level of the process to see what its handler is doing.

Safety

  • Read-only unless told. Without --allow-writes, the tools that change things are not offered at all.
  • The Inspector decides too. An Inspector served with inspect.ReadOnly() refuses every write, whatever the tool; credentials and interceptors guard it as they guard your other services.
  • Bounded answers. Lists are capped, watches last at most a minute, and every input an agent sends is checked before it reaches a node.