How to debug an MCP server: see every request and response
Updated
When an agent misuses a tool or a server returns something odd, logs from either side rarely tell the whole story. The protocol messages do. Here's how to capture them without changing the server or the agent.
Capture the real traffic
Insert RelayOrb between the client and the server. It forwards bytes unchanged and records every message, including server-to-client requests and notifications. Anything the server writes to stderr still goes to the client's logs.
Wrap the server
relayorb record --name dbg -- python -m my_mcp_serverRead the timeline
relayorb show dbg lists each request with its latency and outcome: ok, error (a JSON-RPC error), or tool error (a result with isError: true). Unanswered requests show as no answer, which points straight at hangs.
Dig into a single call
The JSON view has the full params and response for every call. Pipe it to jq to filter.
Find failing tool calls
relayorb show dbg --json | jq '.calls[] | select(.status != "ok") | {label, params, response}'Reproduce it
Export the session and replay it to get the same answers again, or run relayorb check against a fixed build to confirm the bug is gone.
Install RelayOrb
Free and open source (Apache-2.0). A single binary for macOS, Linux, and Windows. No account, no cloud, no telemetry.
macOS / Linux
curl -fsSL https://relayorb.com/install.sh | shWindows and other options: GitHub Releases.
FAQ
- How is this different from MCP Inspector?
- MCP Inspector is an interactive UI for calling a server by hand. RelayOrb records what a real agent actually did, so you can debug, replay, and test real sessions.
- Will recording change how the server behaves?
- No. Bytes are forwarded unchanged in both directions. Recording happens on a copy, on a separate thread.