Model Context Protocol
as of v1.44.0MCP clients and servers: tool calls, prompts, resources and sessions over JSON-RPC, on stdio or Streamable HTTP. Defined in the GenAI registry.
- attributes
- 4
- metrics
- 4
- signals
- 2
- stable
- 0
- deprecated
- 0
Rules
What the lists below cannot show: these rules live in the convention's prose, not in its registry. Paraphrased from main/docs/gen-ai/mcp.md; the upstream wording wins.
Inject the trace context into the request's
params._meta, using the unprefixed keystraceparent,tracestateandbaggage(SEP-414). The receiver extracts it from there and uses it as the remote parent.One Streamable HTTP request can carry several MCP messages, and one message can span several HTTP requests on retry. The server span takes its parent from
params._metaand links the ambient (HTTP) context if there is one.{mcp.method.name} {target}, where the target isgen_ai.tool.nameorgen_ai.prompt.name:tools/call get-weather. With no low-cardinality target, just{mcp.method.name}.mcp.resource.urigoes in the name only when a user opts in.A
CallToolResultwithisError: trueis a successful JSON-RPC call, so it carries no error code. Seterror.typetotool_error. A JSON-RPC error setsrpc.response.status_codeanderror.typeto the code; an HTTP failure without one uses the HTTP status code.On the server,
-32700,-32600,-32601,-32602(including an unknown tool) and-32002mean the caller sent something the server could not serve. They are not errors on the server span; every other code is.- SHOULD NOTOne span per tool call
If GenAI instrumentation already traces the tool execution, the MCP client adds its attributes to that
execute_toolspan instead of creating another. Setgen_ai.operation.nametoexecute_toolon tool calls only. MCP is JSON-RPC, but the RPC and HTTP conventions miss the messages inside a streaming call. Use
mcp.method.namerather thanrpc.method.The operation and session duration histograms are in seconds, with explicit bucket boundaries
[0.01, 0.02, 0.05, 0.1, 0.2, 0.5, 1, 2, 5, 10, 30, 60, 120, 300].gen_ai.tool.call.arguments,gen_ai.tool.call.resultand prompt arguments (gen_ai.prompt.variable.<name>) may hold sensitive data, so they are recorded only when a user opts in.
Signals
What this domain emits, and the attributes each one carries, most strongly required first. An attribute marked * is required on that signal; * is conditionally required.
Spans 2
- mcp.clientclientDevelopmentThis span describes the MCP call from the client side.
mcp.method.name*gen_ai.prompt.name*gen_ai.tool.name*mcp.resource.uri*error.typegen_ai.operation.namegen_ai.prompt.variablejsonrpc.protocol.versionjsonrpc.request.idmcp.protocol.versionmcp.session.idnetwork.protocol.name+7 more
- mcp.serverserverDevelopmentThis span describes the processing of the MCP request or notification initiated by the peer.
mcp.method.name*gen_ai.prompt.name*gen_ai.tool.name*mcp.resource.uri*client.addressclient.porterror.typegen_ai.operation.namegen_ai.prompt.variablejsonrpc.protocol.versionjsonrpc.request.idmcp.protocol.version+7 more
Metrics 4
- mcp.client.operation.durationDevelopmenthistogram · sThe duration of the MCP request or notification as observed on the sender from the time it was sent until the response or ack is received.
- mcp.client.session.durationDevelopmenthistogram · sThe duration of the MCP session as observed on the MCP client.
- mcp.server.operation.durationDevelopmenthistogram · sMCP request or notification duration as observed on the receiver from the time it was received until the result or ack is sent.
- mcp.server.session.durationDevelopmenthistogram · sThe duration of the MCP session as observed on the MCP server.
Specification
- Spansare bound by the trace specification — 302 requirements across 7 documents, 168 of them MUST or SHALL.
- Metricsare bound by the metrics specification — 561 requirements across 8 documents, 287 of them MUST or SHALL.
The specification prose never names this domain. That is not an omission: the specification defines signals, not subject matter — what binds mcp telemetry is the general rules above, and the conventions themselves carry the rest.
On the wire, this lands in trace/v1/trace, metrics/v1/metrics. Field-by-field definitions are under OTLP.
Attributes 4
mcp4 attributes
- mcp.method.nameDevelopmentGenAIThe name of the request or notification method.
- mcp.protocol.versionDevelopmentGenAIThe version of the Model Context Protocol used.
- mcp.resource.uriDevelopmentGenAIThe value of the resource uri.
- mcp.session.idDevelopmentGenAIIdentifies MCP session.
Recent changes
Breaking and notable changes to this domain across the last 6 semantic-conventions releases.
- deprecatedmetricmcp.client.operation.durationMoved to the OpenTelemetry GenAI semantic conventions repository.
- deprecatedmetricmcp.client.session.durationMoved to the OpenTelemetry GenAI semantic conventions repository.
- deprecatedattributemcp.method.nameMoved to the OpenTelemetry GenAI semantic conventions repository.
- deprecatedattributemcp.protocol.versionMoved to the OpenTelemetry GenAI semantic conventions repository.
- deprecatedattributemcp.resource.uriMoved to the OpenTelemetry GenAI semantic conventions repository.
- deprecatedmetricmcp.server.operation.durationMoved to the OpenTelemetry GenAI semantic conventions repository.
- deprecatedmetricmcp.server.session.durationMoved to the OpenTelemetry GenAI semantic conventions repository.
- deprecatedattributemcp.session.idMoved to the OpenTelemetry GenAI semantic conventions repository.
Topics are this site's grouping of upstream namespaces, not a structure the OpenTelemetry project publishes. JSON · All domains