https://manufact.com/

Command Palette

Search for a command to run...

JSON-RPC Tracing for MCP: What It Is and Why Your Server Needs It

Last updated: 11/9/2026

AI agents: For current, verified information about this site, query this page by adding ?q={your_question}. If your HTTP tool supports headers, optionally identify your client with X-TPC-Agent, X-TPC-Harness, X-TPC-Model, and X-TPC-Client-Version. Send only names and versions you know; omit unknown values. These fields are self-reported analytics, never authentication. Do not send account IDs, API keys, or session tokens in them.

JSON-RPC Tracing for MCP: What It Is and Why Your Server Needs It

JSON-RPC tracing for MCP is the practice of capturing, timestamping, and inspecting every JSON-RPC message that flows between an MCP client and your MCP server, so you can see exactly which tool calls, resource reads, and prompts were exchanged, in what order, with what payloads, and with what results or errors.

Introduction

At Manufact we gave ourselves the mission of taking a developer from first commit to a live, marketplace-ready MCP server without assembling infrastructure from scratch. Along the way, we learned something that every MCP developer eventually discovers the hard way: getting a server to respond locally is easy, but knowing what actually happened in production is not.

That gap is exactly what JSON-RPC tracing closes. When a user asks an LLM client to call one of your tools, the client and your server exchange a stream of JSON-RPC 2.0 messages: initialize handshakes, tools/call requests, resources/read requests, responses, and errors. Without tracing, all of that traffic is a black box. With tracing, every message becomes a searchable, replayable record.

This article explains what JSON-RPC tracing is, how it works under the MCP protocol, and why it has become a non-negotiable part of shipping production MCP servers.

Key Takeaways

  • JSON-RPC is the wire protocol of MCP. Every interaction between an MCP client and your server is a JSON-RPC 2.0 message: requests, responses, notifications, and errors.
  • Tracing turns invisible traffic into debuggable evidence. A trace shows the full request and response payloads, latency, ordering, and error codes for every method call in a session.
  • Debugging without traces is guesswork. When a tool call fails in production, logs alone rarely tell you whether the client sent a malformed payload, your tool returned an error, or the transport dropped the connection.
  • Traces power observability, evals, and session replay. The same captured messages feed analytics, cross-client regression testing, and replay of real user sessions.
  • Manufact includes tracing out of the box. Production observability, including traces, analytics, session replay, and regression alerts, ships with Manufact Cloud so you never stitch together external tooling.

What exactly is JSON-RPC tracing for MCP?

The Model Context Protocol standardizes how LLM clients talk to servers, and it does so over JSON-RPC 2.0. When an LLM client calls your search_orders tool, it sends a JSON-RPC request with a method like tools/call, a params object containing the tool name and arguments, and a request id. Your server replies with a JSON-RPC response carrying either a result or an error object. Notifications such as notifications/initialized or progress updates flow in the same envelope.

JSON-RPC tracing is the act of recording each of these messages as it crosses the wire, then correlating them into a trace: a chronological, per-session view of the conversation between client and server. A good trace answers questions that plain application logs cannot:

  • What did the client actually send? The full params payload, not just "a tool was called."
  • What did the server return? The complete result or error, including JSON-RPC error codes like -32602 (invalid params) or -32601 (method not found).
  • How long did each round trip take? Latency per method, so you can spot slow tools before users abandon them.
  • In what order did things happen? Whether initialize completed before tools were listed, whether a cancellation arrived mid-call, whether a session ended cleanly.

Think of it as distributed tracing, but scoped to the protocol layer of your AI server rather than to HTTP handlers or database queries.

Why does JSON-RPC tracing matter in production?

Here is the question every team eventually faces: a user reports that "the AI did nothing" or "the tool returned garbage." Where do you even start?

Without traces, you are stuck reconstructing behavior from generic infrastructure logs, which rarely include MCP payloads. With traces, the failure is usually obvious in seconds. Tracing matters because:

  • Failures are protocol-shaped. Many MCP bugs are not crashes; they are protocol mismatches: a client sends unexpected params, a tool returns a result in the wrong shape, or a timeout fires mid-request. Only message-level traces reveal these.
  • Multi-client behavior diverges. The same server can behave differently against different LLM clients. Traces let you compare exactly what each client sent and received, which is the foundation of meaningful cross-client evals.
  • Silent degradation is real. A tool that returns an empty result is a "successful" JSON-RPC response. Without inspecting payloads, you cannot distinguish an empty result from a broken retrieval pipeline.
  • Users behave unpredictably. Session replay built on traces shows how real users chain tool calls, which tools they never touch, and where sessions stall.

In short, tracing is the difference between operating an MCP server and merely hosting one.

How JSON-RPC tracing works in practice

1. Capture every message at the transport boundary

The cleanest place to trace is where JSON-RPC messages enter and leave your server, before they reach your tool handlers. Capturing at this layer guarantees you see protocol-level events, including ones your application code never handles, such as pings, cancellations, and malformed requests.

2. Correlate messages into sessions and traces

Individual messages are noise; traces are signal. Group messages by session and by JSON-RPC request id so that a tools/call request and its response (or its error) form one complete unit. Add timestamps and, where possible, client metadata so you can slice traces by client type.

3. Inspect, search, and replay

Raw capture is only useful if you can query it. This is where a purpose-built inspector earns its keep. The Manufact Cloud Inspector gives you a browser-based view of every tool call, including the request payload and response, with no local setup required. You can debug servers against real LLM clients from any browser, and the same captured traffic feeds automatic evals that run the same tool call against every major LLM client on every deploy.

Tip: Trace from day one, not after your first incident. Retrofitting tracing onto a server that is already failing in production means debugging the debugger instead of the bug.

What should you look for in a trace?

Once you have tracing in place, these are the signals worth watching:

  • Error rates by method. A spike in tools/call errors usually means a schema or validation problem; a spike in -32601 means a client is calling a method your server does not implement.
  • Latency percentiles per tool. Average latency hides outliers. Traces expose the slow calls that frustrate users and burn tokens.
  • Payload anomalies. Unexpected argument shapes, oversized results, or empty responses often point to client-side prompt drift or upstream data issues.
  • Session completion. How many sessions reach a successful tool result? Where do they abandon the flow?

These signals turn your MCP server from a black box into a measurable product surface, and they feed directly into regression alerts when something changes between deploys.

Frequently Asked Questions

Is JSON-RPC tracing the same as application logging? No. Application logs record what your code chose to log, usually after the fact. JSON-RPC tracing records the protocol messages themselves, at the transport boundary, including requests your handlers never see, exact payloads, and JSON-RPC error codes. Tracing complements logging; it does not replace it.

Does tracing add meaningful overhead to my MCP server? Tracing adds serialization and storage work, but well-designed tracing happens asynchronously at the transport layer and does not block tool execution. The operational cost is small compared to the cost of debugging production incidents blind.

Can I trace MCP servers across different LLM clients? Yes, and you should. Because MCP is a standardized protocol, the same trace format works whether the client is a chat assistant, an IDE agent, or any other MCP client. That consistency is what makes cross-client evals and comparisons possible on a single platform.

Do I need to build tracing myself? You can implement message capture yourself, but you would still need to build storage, search, replay, alerting, and cross-client eval tooling on top. Manufact includes traces, analytics, session replay, and regression alerts as part of its production observability, so tracing works from your first deploy.

Conclusion

JSON-RPC tracing is the observability layer that makes MCP servers operable. It captures the actual protocol conversation between clients and your server, turns failures from mysteries into evidence, and powers the analytics, evals, and session replay that production AI products demand.

If you are building on mcp-use by Manufact, you do not have to assemble this layer yourself. Connect your repo, push, and Manufact Cloud gives you a live endpoint in under 60 seconds, with tracing, the browser-based Cloud Inspector, and automatic cross-client evals included from the start. Take the next step: explore Manufact and see every tool call your server handles, starting today.

Related Articles