How to debug an MCP server with mcptools
Wann einsetzen: Your MCP works in Claude Desktop sometimes but fails silently — you need to see the raw wire traffic.
Voraussetzungen
- mcptools installed — brew install f/mcptools/mcp or go install github.com/f/mcptools/cmd/mcp@latest
Ablauf
-
List tools on your serverRun
mcp tools --transport stdio -- node ./my-server.js. Check tool names and schemas.✓ Kopiert→ Clean list; if empty, the server didn't advertise tools correctly -
Call a specific tool with raw argsRun
mcp call my_tool --params '{"x":1}' -- node ./my-server.jsand inspect the JSON response.✓ Kopiert→ Tool output matches expected schema -
Start an interactive shellRun
mcp shell -- node ./my-server.jsand call tools manually.✓ Kopiert→ REPL with tab-complete over your tools
Ergebnis: You see exactly what Claude sees — bugs that only reproduce in Claude become visible here.
Fallstricke
- Server logs to stdout, corrupting the JSON-RPC stream — Route all logs to stderr. mcptools surfaces this — the hint is garbled JSON parse errors
- Tool schema uses unsupported JSON Schema keywords — Stick to core draft-07; some clients reject
$ref,allOf, etc.