Skip to content

Proposal: SEP-414 trace context scenario (_meta.traceparent format) #571

Open

Description

@mkwitko

The draft spec (basic/index.mdx, "OpenTelemetry trace context", SEP-414) reserves traceparent, tracestate and baggage in _meta and says: "When present, their values MUST follow W3C Trace Context and W3C Baggage formats respectively." The suite has no check for this today (src/seps/ has no sep-414.yaml; the request-metadata scenario only covers the io.modelcontextprotocol/* keys). I would like to propose one and ask before writing code, per AGENTS.md.

Client scenario trace-context-meta (a Scenario): the mock server records every request and notification; for each message whose params._meta carries one of the three reserved keys, validate the value.

  • sep-414-client-traceparent-format: FAILURE if any observed value is not a string matching W3C Trace Context (version 00, non-zero trace-id and parent-id); SUCCESS if all observed values are valid; SKIPPED if the client never sent one, since the requirement applies only "when present".
  • sep-414-client-tracestate-format, sep-414-client-baggage-format: same rule for the other two keys.

Open point: the reference everything-client sends no trace context today, so these checks would be SKIPPED against it. The positive example would need a branch that sets _meta.traceparent; a negative example client sends traceparent: "not-a-traceparent".

Server scenario server-trace-context-meta (a ClientScenario): send tools/list with the spec's own example values in _meta and check the server still serves it. The spec has no MUST for the server side, so this would be WARNING at most. Whether the suite also wants a check that servers tolerate unknown vendor-prefixed _meta keys is a question for you; I found no sentence in the spec that requires it.

Motivation: in practice clients do send malformed or absent trace context, and the only MUST in SEP-414 is the format. I have a longer write-up with check ids, severity mapping and sketches in the suite's conventions: https://github.com/mkwitko/mcp-reliability/blob/v0.1.0/docs/upstream/conformance-traceparent-scenario.md

If this fits, I can send the PR with the SEP yaml, both scenarios, the examples and the vitest negative case.

Activity

  1. ryjen commented on Nov 5, 2026

    @ryjen

    Review suggestion on the proposed SEP-414 fixture (design feedback only; I have not run a conformance reproduction):

    1. Keep the check conditional on presence of the reserved keys. A client that sends no trace context should be SKIPPED/not-applicable, not failed. Please distinguish that from a scenario which emitted no checks due to setup/dispatch failure.
    2. Exercise valid W3C traceparent and negative vectors (non-string, invalid field lengths/hex, all-zero trace-id or parent-id, unsupported version). For tracestate and baggage, use the actual W3C grammar rather than a permissive regex; document any intentionally untested grammar cases.
    3. Please keep the server-side case informational unless a normative server obligation can be cited. The published conformance plan currently classifies SEP-414 as exempt/non-normative for core conformance; it should not change the required pass denominator just because the harness has a new scenario.
    4. A separate security negative control may be useful as guidance rather than a protocol requirement: a syntactically valid caller-supplied _meta.traceparent must not be treated as actor identity, delegated authority, or permission to execute a tool. Trace continuity is correlation evidence, not authorization evidence. baggage can also contain sensitive/untrusted caller-controlled values; avoid echoing it into privileged logs or approval decisions without policy.

    I'd favor a small client-only format fixture first, then separately discuss optional server interoperability checks. This is based on the issue/spec text, not an independent test run.

  2. JoanAbad82 commented on Nov 15, 2026

    @JoanAbad82

    Thanks @mkwitko for the detailed SEP-414 proposal and the implementation groundwork. I reviewed the MCP specification, W3C Trace Context, and the conformance repository's contribution guidelines.

    Three points may be worth preserving in the test design:

    1. W3C version compatibility: Version ff is invalid, and version 00 has a defined format. However, W3C Trace Context §3.2.4 also defines forward-compatible parsing behavior for higher versions. Tests should distinguish sender-format validation from receiver compatibility to avoid false failures.

    2. Applicability versus execution: MCP requires W3C-compliant values when trace metadata is present. A client that legitimately omits trace context may produce SKIPPED checks. A client that never connects or exercises the scenario should instead produce an explicit failure, not an apparent successful skip.

    3. Frozen conformance requirements: The repository's requirements/2026-07-28.yaml is explicitly frozen. Adding SEP-414 coverage should not silently change that release's required checks or Tier-1 scoring. The appropriate placement and scoring deserve maintainer confirmation.

    These are design-review observations, not claims based on executed tests.

    Would @mkwitko and the maintainers welcome a focused, complementary contribution—for example, W3C version edge-case fixtures and regression assertions—or is that already covered by the planned implementation?

    I'd be happy to contribute within an agreed, non-overlapping scope.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions