Super AI · 10 / 16

MCP Observability

How to see what agents and MCP servers are doing: traces across hops, metrics and objectives, audit events, cost attribution and evaluation, using OpenTelemetry's MCP conventions.

What it is

MCP observability is the practice of seeing what an agent asked for, what each MCP server did, and what it cost, across every hop of a request. Because a model chooses its own tools and arguments, you need the path recorded as well as the result: a trace of the run, metrics for health, structured audit events for governance, and evaluations for quality.

OpenTelemetry now defines semantic conventions for MCP: span names such as tools/call get-weather, standard attributes and metrics, and a way to carry W3C trace context inside the request's _meta so one trace follows a call from agent through gateway to server. Together with the protocol's own logging and progress features, they make agent systems debuggable and auditable.

How it works

Tracing a request through an MCP-enabled agent system A request passes from the user through the agent, model, gateway, MCP server and downstream API. The same trace context, carried in the request's metadata, links spans across all of them. Each hop emits traces, metrics, logs, audit events and evaluation scores that are tied back to that trace. ONE TRACE FOLLOWS THE REQUEST THROUGH EVERY HOP User request Agent plan · loop Model tokens · latency Gateway policy · audit MCP server tool work Downstream API system of record traceparent carried in params._meta · the same trace ID on every span, log line and audit event agent.run tools/call server + API next model call WHAT EACH HOP EMITS Traces spans per step Metrics rates · errors · latency Logs levels · redacted context Audit who · tool · outcome Evals tool choice · task success Record the path, not only the result: the model chooses the tools, so the sequence is the evidence.
One trace ID across every hop, with metrics, logs, audit events and evaluations tied back to it.
  1. Identify

    Agree names for agents, servers, tools, users and teams, and put a trace ID on everything.

  2. Instrument the edges

    Add spans and the standard metrics at the gateway and in each MCP server.

  3. Propagate context

    Inject trace context into params._meta so client, gateway and server share one trace.

  4. Record and redact

    Emit structured audit events and strip secrets and personal data before storage.

  5. Watch and alert

    Dashboards per tool and per agent, plus alerts on errors, latency, cost and policy changes.

  6. Evaluate and improve

    Score tool selection and task success on traced runs, then refine tools and prompts.

Why MCP needs its own observability

Observability tells you what a system did and why. With MCP, the system includes a model that chooses its own actions, so the usual dashboards of request counts and error codes are not enough.

Non-deterministic callers

The model decides which tool to call and with what arguments. The same request can take different paths, so you need the path recorded, not just the result.

Many hops, many owners

One user request may cross an agent, a model, a gateway, several MCP servers and downstream APIs, each owned by a different team.

Failures that look like success

A tool can return a valid response that is wrong, truncated or poisoned. HTTP 200 tells you nothing about whether the agent did the right thing.

Protocol-level traffic

MCP runs over JSON-RPC inside long-lived sessions and streams, so one HTTP request can carry many MCP calls. HTTP metrics alone do not describe what happened.

Cost hides in the loop

Agents repeat steps. Latency and token spend come from how many times they loop and how much each tool returns.

Security and audit need evidence

Investigating a misuse or an injection attempt requires a trustworthy record of who called which tool with what.

The signals

Traces

The causal story of one request: agent step, model call, tool call, server work, downstream calls, with timing and errors.

Metrics

Aggregates for dashboards and alerts: call rates, error rates, latency distributions, session counts, token and cost totals.

Logs

Detailed events with context: server diagnostics, warnings, validation failures, redacted arguments.

Audit events

A tamper-resistant, structured record of identity, tool, decision and outcome for governance.

Evaluations

Scores for tool selection, argument correctness and task success, linked to the traces they came from.

What the protocol already gives you

The MCP specification includes several features that double as telemetry sources.

Logging utility

Servers that declare the logging capability send notifications/message with a level (the syslog levels from debug to emergency), an optional logger name and JSON data. Clients can raise or lower verbosity with logging/setLevel. The spec says log messages must not contain credentials, personal information or internal details that could aid attacks.

Progress notifications

A request can carry a progressToken in its _meta. The receiver may then send notifications/progress with a growing progress value, an optional total and a message, which is useful for long-running tools and for showing users that work continues.

Cancellation and ping

Either side can cancel an in-flight request and check that the other is alive. Count cancellations and failed pings as health signals.

JSON-RPC errors

Protocol failures use standard error codes, such as -32602 for invalid params. Tool-level failures come back inside the result. Track both kinds, because they mean different things.

The _meta property bag

Requests and notifications can carry metadata in params._meta. It is the standard place to propagate trace context between client and server.

OpenTelemetry conventions for MCP

OpenTelemetry defines semantic conventions for MCP spans and metrics, so traces and dashboards look the same across servers, gateways and vendors. They are still in Development status, so confirm names against the current version before hard-coding them.

Use the MCP conventions

OpenTelemetry recommends its MCP semantic conventions over the generic RPC or HTTP ones, because they capture MCP-specific context such as message exchanges inside streaming calls. The conventions are marked Development, so names may still change.

Span names

{mcp.method.name} {target}, where the target is the tool or prompt name when there is one, for example tools/call get-weather. If no low-cardinality target exists, just the method name. Resource URIs are not put in span names by default to avoid high cardinality.

Span kind

CLIENT on the side that sends the request, SERVER on the side that handles it.

Core attributes

mcp.method.name is required. gen_ai.tool.name or gen_ai.prompt.name apply when the call involves a specific tool or prompt. mcp.resource.uri, jsonrpc.request.id, rpc.status_code and error.type are recorded when relevant, and gen_ai.operation.name can be execute_tool for tool calls.

Context propagation

Inject W3C trace context (traceparent, tracestate) and optionally baggage into params._meta of each request, unprefixed as SEP-414 describes. The server extracts it and uses it as the parent of its span, so one trace spans client, gateway and server over any transport.

Avoid double spans

MCP tool-call spans are compatible with the GenAI execute_tool span. If an outer GenAI instrumentation already traces the tool, add MCP attributes to that span instead of creating a second one.

tools/call with propagated trace context
{
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "name": "find_overdue_invoices",
    "arguments": { "minDays": 14 },
    "_meta": {
      "traceparent": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
    }
  },
  "id": 7
}

Anatomy of an agent trace

One user request becomes a tree of spans: the agent run, each model call, and each tool call seen from both the client and the server, with the downstream API beneath. This is what lets you answer "why was it slow" or "which step failed" in seconds.

trace · illustrative
agent.run  invoice-followup                                      6.8 s
├─ chat claude-model (plan)                                      1.9 s   tokens in 4.1k / out 220
├─ tools/call find_overdue_invoices       [CLIENT]               0.9 s
│  └─ tools/call find_overdue_invoices    [SERVER, billing]      0.8 s
│     └─ GET billing-api /v2/invoices     [CLIENT]               0.7 s
├─ chat claude-model (decide)                                    1.6 s   tokens in 6.3k / out 180
├─ tools/call send_reminder_email         [CLIENT]               1.2 s
│  └─ tools/call send_reminder_email      [SERVER, comms]        1.1 s   error.type=timeout
└─ chat claude-model (final)                                     1.2 s

Metrics and SLOs

The OpenTelemetry MCP conventions define four metrics.

MetricWhat it measuresWhy it matters
mcp.client.operation.durationHistogram of how long client-side MCP operations take, by method, tool and outcome.Latency the agent actually experiences, including network and queuing.
mcp.server.operation.durationHistogram of how long the server takes to handle each operation.Server-side latency. Compare with the client number to find transport or gateway delay.
mcp.client.session.durationHow long client sessions last.Spot sessions that drop early or never close.
mcp.server.session.durationHow long server-side sessions last.Capacity planning and leak detection.

Objectives worth setting

ObjectiveHow to measure itBreak down by
AvailabilityShare of tool calls that complete without a protocol or server errorPer server and per tool
Latencyp50 and p95 duration of tools/callPer tool, because tools differ widely
CorrectnessShare of calls where the agent picked the right tool with valid argumentsFrom evaluations, not from HTTP
Task successShare of agent runs that reach the goal within step and cost limitsPer agent and workflow
CostTokens and spend per successful taskPer agent, team and model
SafetyRate of blocked, flagged or approval-required callsPer policy and per tool

Logs and audit events

Metrics say something is wrong, traces show where, and structured events show who did what. A good audit event ties identity, tool, decision and outcome to a trace.

audit event · illustrative
{
  "time": "2026-12-03T14:02:11Z",
  "trace_id": "4bf92f3577b34da6a3ce929d0e0e4736",
  "caller": { "user": "a.lee@example.com", "agent": "invoice-followup", "client": "https://app.example.com/oauth/client-metadata.json" },
  "server": "billing",
  "method": "tools/call", "tool": "find_overdue_invoices",
  "arguments_hash": "sha256:9c1f…", "arguments_redacted": { "minDays": 14 },
  "decision": "allow", "policy": "finance-read-only",
  "status": "ok", "latency_ms": 212, "result_bytes": 2310
}

Cost and token attribution

Tokens by step

Record input and output tokens on every model call, tied to the trace, so you see which step costs most.

Tool output size

Large tool results inflate the next model call. Track result size per tool and cap or summarize it.

Tool-definition overhead

Every connected tool adds definitions to the context. Count tools in context and trim the list with a gateway.

Loops and retries

Count steps per run and retries per tool. A rising step count is an early sign of confusion or a bad tool.

Attribution

Tag spend with user, team, agent and server so budgets and chargeback are possible.

Budgets

Enforce per-run and per-user limits and emit a metric when one is hit.

Quality and evaluation

Healthy infrastructure does not mean a good agent. Score behavior on sampled and failed runs, and link every score to its trace.

Tool selection

Did the agent choose the right tool for the request?

Argument correctness

Were the arguments valid, complete and within policy?

Result handling

Did the agent use the result correctly, or ignore, misread or over-trust it?

Task success

Did the whole run achieve the goal within step and cost limits?

Safety behavior

Did it resist injected instructions and ask for approval when required?

Debugging playbook

SymptomWhere to lookTypical fix
Agent called the wrong toolTool descriptions, number of tools in context, tool-selection evalsRewrite descriptions, trim tools, split servers
Tool calls are slowClient vs. server duration, downstream spans, queueing at the gatewayFix the slow hop, add caching, raise limits
Intermittent failuresError type and status by tool, retries, session durations, cancellationsAdd timeouts and idempotency, fix the unreliable dependency
Agent loops or never finishesStep count per run, repeated identical calls, token growthAdd step budgets, improve error messages, fix the tool result
Costs spikeTokens per step, tool result size, tools in contextSummarize or cap results, trim tools, cache
Wrong answer, no errorFull trace with tool results and the model's use of themCheck data quality, truncation and injected content
Suspected misuse or injectionAudit events, unusual tools or destinations, description changesContain, revoke tokens, follow the incident playbook

Alerting

Privacy and security of telemetry

Where to instrument

Agent or client

Spans for the agent run, model calls and client-side tool calls. Sets the trace context and injects it into _meta.

Gateway

The best single place for identity, policy decisions, rate limits and audit events across all servers.

MCP server

Server spans, tool-level timing, downstream API calls, validation errors and business context only the server knows.

Downstream systems

Their own traces and logs, joined to the same trace through propagated context.

Common mistakes

Rolling it out

  1. Pick the identifiers

    Agree names for agent, server, tool, user and team, and put the trace ID on everything.

  2. Instrument the edges

    Add traces and the standard metrics at the gateway and in each MCP server.

  3. Propagate context

    Inject and extract trace context in params._meta so traces connect end to end.

  4. Add audit and redaction

    Emit structured audit events and apply redaction before anything is stored.

  5. Build the first dashboards

    Per-tool rate, errors and latency, per-agent cost and steps, and policy decisions.

  6. Add evaluations and alerts

    Score tool selection and task success, then alert on the signals above.

  7. Review regularly

    Use traces to improve tool descriptions, prune tools and set budgets.

Span and metric names follow the OpenTelemetry MCP conventions (Development status) and the 2025-11-25 MCP specification, and may change. Traces and events shown are illustrative.

Sources

Key concepts

MCP semantic conventions
OpenTelemetry's standard span, attribute and metric definitions for MCP.
Context propagation via _meta
Carrying traceparent and baggage inside MCP requests so traces connect across hops and transports.
Span naming
{mcp.method.name} {target}, such as tools/call get-weather, with low-cardinality targets.
Audit event
A structured, tamper-resistant record of caller, tool, decision and outcome.
Cardinality
The number of distinct label values. High-cardinality labels like user IDs or URIs belong in traces and logs, not metrics.
Tail-based sampling
Deciding to keep a trace after it finishes, so errors and slow runs are always retained.
Token attribution
Tying model token use to the user, agent, tool and trace that caused it.
Evaluation linked to traces
Quality scores that point back to the exact run that earned them.

Tools & platforms

Standards

  • OpenTelemetry
  • OTel MCP semantic conventions
  • W3C Trace Context
  • MCP logging and progress

Backends and platforms

  • Jaeger
  • Grafana Tempo and Loki
  • Prometheus
  • Datadog
  • Elastic
  • Honeycomb

LLM observability

  • Langfuse
  • LangSmith
  • Arize Phoenix
  • OpenLLMetry
  • MCP gateways

Skills employers look for

Enterprise use cases

Production agent platform

Per-tool and per-agent dashboards, with traces from user request through every MCP server.

Security investigation

Reconstruct which agent called which tool for which user after a suspected injection or misuse.

Cost control

Find the tools and steps that drive token spend, and cap them.

Server owner support

A tool owner sees exactly how agents call their server, where it fails and which descriptions confuse the model.

Common pitfalls

How MrAI.dev helps

We instrument your agents, gateway and MCP servers with OpenTelemetry, design the dashboards, objectives and alerts that matter, build redacted audit trails, and connect traces to evaluations so you can see, debug and govern agent behavior in production.

Book a discovery call