Agents & MCP
Connect the MCP server#
The server is clawmetry mcp — a stdio process your client launches. There is
no port to open and no service to run separately.
Prerequisites#
The ClawMetry daemon must be running, because the MCP server reads through it.
clawmetry status # daemon: runningIf it is not: clawmetry sync.
Claude Code#
claude mcp add clawmetry -- clawmetry mcpVerify:
claude mcp listThen, inside Claude Code, ask it something only ClawMetry knows — "using clawmetry, how many sessions did I run yesterday?" — and check it calls the tool rather than guessing.
Any client, by configuration#
Most MCP clients take the same JSON shape. The file location differs; the block does not.
{
"mcpServers": {
"clawmetry": {
"command": "clawmetry",
"args": ["mcp"]
}
}
}If clawmetry is not on the PATH your client sees — common with GUI apps on
macOS, which do not inherit your shell environment — use the absolute path:
{
"mcpServers": {
"clawmetry": {
"command": "/opt/homebrew/bin/clawmetry",
"args": ["mcp"]
}
}
}which clawmetryCursor#
Add the same block to Cursor's MCP configuration, then restart Cursor. Cursor launches MCP servers itself, so a server added while it is running is not picked up until it restarts.
Codex, Goose, opencode and others#
All of them accept a stdio server with a command and arguments. Use the block above; consult the client for where its configuration file lives.
Pointing at a different machine#
The MCP server reads the local daemon. To query a different machine's telemetry, run the MCP server there — over SSH, for instance:
{
"mcpServers": {
"clawmetry-build-box": {
"command": "ssh",
"args": ["build-box", "clawmetry", "mcp"]
}
}
}The stdio transport passes cleanly over SSH, which makes this the simplest way to give a local agent visibility into a remote fleet node.
Verify by hand#
printf '%s\n' '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' | clawmetry mcpYou should see five tools. Then try a real call:
printf '%s\n' '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"get_health","arguments":{}}}' \
| clawmetry mcpTroubleshooting#
| Symptom | Cause | Fix |
|---|---|---|
| Every tool returns "daemon is not running" | The daemon is down, or its discovery file is stale | clawmetry sync |
| Client cannot start the server | clawmetry not on the client's PATH | Use the absolute path from which clawmetry |
| Tools list is empty | The client did not complete the handshake | Restart the client; check its MCP log |
| Results are empty but no error | The store genuinely has nothing in that window | Widen since, and check clawmetry status for ingest progress |
| Server was added but the agent ignores it | The agent does not know it should use it | Name it in the prompt, or add a skill |
The discovery file#
For reference, the server finds the daemon here:
{"port": 51843, "token": "…", "pid": 4711}It checks the pid is alive before trusting the port, so a stale file left by a crashed daemon produces the honest "not running" error rather than a connection attempt against whatever else has since taken that port.