Skip to content

[Server][Client][Protocol] SEP-414: W3C Trace Context propagation via _meta #355

Closed

Description

@chr-hertel

Implements SEP-414 for the MCP Spec 2026-07-28 release.

Tracked by umbrella #336. Additive, non-breaking.

Spec summary

Standardizes how W3C Trace Context (traceparent, tracestate, baggage) is conveyed in JSON-RPC _meta for non-HTTP transports, and how it interplays with HTTP headers. Lets servers and clients propagate spans across MCP boundaries.

PHP SDK changes

  • src/JsonRpc/MessageFactory.php and request DTOs — recognize/preserve _meta.traceparent and _meta.tracestate round-trip.
  • src/Server/Transport/StdioTransport.php — propagate trace context through _meta (no HTTP headers available).
  • src/Server/Transport/StreamableHttpTransport.php and src/Client/Transport/HttpTransport.php — bridge HTTP traceparent/tracestate headers ↔ JSON-RPC _meta per the spec rules.
  • src/Server/Protocol.php — make trace context available on RequestContext so tool handlers can use it (PSR-3 logger correlation, OTel instrumentation packages).
  • Optional helper src/Server/Tracing/TraceContext.php for parsing/serializing traceparent.
  • No new dependencies required — keep OTel integration opt-in via consumer code.

Related

Activity

  1. added
    Server
    Client
    Schema
    improves spec compliance
    enhancement
    on May 26, 2026
  2. added
    2026-07-28
    on May 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    2026-07-28ClientSchemaServerenhancementimproves spec compliance

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions