SEP-2448: MCP server execution telemetry#2448
Open
savula15 wants to merge 4 commits intomodelcontextprotocol:mainfrom
Open
SEP-2448: MCP server execution telemetry#2448savula15 wants to merge 4 commits intomodelcontextprotocol:mainfrom
savula15 wants to merge 4 commits intomodelcontextprotocol:mainfrom
Conversation
0efab48 to
3a7ba19
Compare
180b328 to
3faa2f4
Compare
EricGustin
pushed a commit
to ArcadeAI/arcade-mcp
that referenced
this pull request
Mar 25, 2026
…pability (#797) **Implements**: [SEP-2448: server execution telemetry] (modelcontextprotocol/modelcontextprotocol#2448) **Description:** **The Observability Gap (The Problem)** MCP clients propagate trace context to servers, but server-side execution remains a black box. The client sees a single tools/call or resources/read span; everything the server does (auth checks, policy evaluation, API calls, sub-tool invocations) is invisible. In cross-organization deployments, clients and servers use separate observability backends with no shared collector access, making traditional span export useless. <img width="1015" height="450" alt="Screenshot 2026-03-23 at 3 43 21 PM" src="https://github.com/user-attachments/assets/58c817b5-fee6-46a3-9877-d523a25368ad" /> **Server Execution Telemetry (The Solution)** Servers advertise serverExecutionTelemetry and return a curated slice of their execution spans directly in _meta.otel of the response. Clients ingest these verbatim OTLP spans into their own collector, stitching server-side execution into their distributed trace; no shared infrastructure required. The black box becomes transparent. <img width="945" height="574" alt="Screenshot 2026-03-23 at 3 43 44 PM" src="https://github.com/user-attachments/assets/38d97c94-aa73-4e62-9b4e-3264600e5ed0" /> . **Summary:** Implement MCP serverExecutionTelemetry capability that enables cross-organization distributed tracing by returning server-side OpenTelemetry spans to clients inline via _meta.otel.traces. Server-side (middleware): - TelemetryPassbackMiddleware intercepts tools/call and resources/read - ContextVarSpanCollector isolates span collection per-request via ContextVar - Propagates traceparent from client request for distributed trace stitching - Serializes collected spans to verbatim OTLP JSON (resourceSpans format), directly POSTable to /v1/traces - Top-level span filtering by default; full span tree via detailed opt-in - Middleware advertises capabilities via get_capabilities() on the Middleware base class - Provisional API: FutureWarning emitted until SEP-2448 is ratified Client-side (reference agent): - LangChain ReAct agent connects to MCP server via streamable_http_client with OAuth 2.1 - Detects serverExecutionTelemetry capability at initialization - Dynamically wraps discovered MCP tools with traceparent propagation and _meta.otel span request - Ingests returned server spans into Jaeger (OTLP JSON) and Galileo (OTLP protobuf) - Two-act demo: --no-passback (black box) vs default (full server-side visibility) Dependencies: - opentelemetry-api and opentelemetry-sdk added to arcade-mcp-server Bump arcade-mcp-server version to 1.18.0.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation and Context
This PR proposes a new MCP Standards Track SEP, Server Execution Telemetry, which defines an optional capability for MCP servers to return OpenTelemetry spans to clients in-band via
_meta.otelontools/callandresources/readresponses.Today, SEP-414 enables clients to propagate
traceparentinto MCP servers, but there is no standard way for servers to return execution telemetry to clients. This creates an observability gap in cross-organization MCP deployments, where tool execution and resource reads are otherwise opaque to the caller.This SEP addresses that gap by:
serverExecutionTelemetryserver capabilityresourceSpans) so they can be ingested directly into the client’s existing observability backendThe proposal is explicitly opt-in on both sides and is additive to the protocol.
How Has This Been Tested?
This PR is backed by:
feat/server-execution-telemetry(PR #797)Breaking Changes
None.
This is a specification-only change that introduces a new optional capability. Existing MCP clients and servers that do not recognize or implement this capability continue to behave as they do today.
Types of changes
Checklist
Additional context
This SEP complements SEP-414 by defining the response-side mechanism for distributed trace stitching across MCP boundaries.
Reference implementation:
feat/server-execution-telemetry(PR #797)Explainer video: TBD
Acknowledgements