What is a common bug that JSON-RPC tracing reveals in MCP server implementations?
Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
The classic MCP tracing find is an `id` mismatch: the server mints a fresh response id instead of echoing the request id, so the client can never correlate it and the call hangs forever.
Picture a busy coat check. You hand over your coat and get ticket number 47. Later you come back with ticket 47, and the attendant matches the number to find your coat. The number is the only link between you and your coat. Now imagine the attendant hands your coat back to someone holding a brand-new ticket they printed themselves, number 999. Your ticket 47 never matches anything, so you stand there waiting forever, even though your coat is sitting right on the rack. JSON-RPC works the same way: the `id` field is the ticket. The client keeps a list of tickets it is waiting on. If the server replies with the wrong ticket number, the client cannot find the matching entry, so it waits, the response is thrown away, and the call looks like it silently hung.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
4 min: how the id correlates request to response, the pending-request map, why a mismatch silently drops the response and hangs the call, and the method, id, and latency trace that exposes it.
| Symptom in trace | Likely cause | What to log |
|---|---|---|
| Request sent, no response line ever | Server crashed, dropped the call, or never replied | Outgoing id plus a timeout marker |
| Response arrives with a different id | Server minted a new id instead of echoing it | Both request and response ids side by side |
| Response arrives slowly but matches | Slow tool, not a correlation bug | Per-call latency from send to receive |
| Reply sent to a message with no id | Server answered a notification it should ignore | Direction plus whether an id was present |
Real products, models, and research that use this idea.
What an interviewer would ask next. Try answering before peeking at the approach.
Red flags and common mistakes that signal junior thinking. Click to expand.
Blaming a hung MCP call on a slow tool or a crashed server when tracing shows the response arrived fine but carried the wrong id, so the client dropped it.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.