Skip to content

OpenTelemetry: FastMCP client does not propagate trace context on initialize and list methods #3998

@strawgate

Description

@strawgate

Summary

FastMCP's client still behaves like an opaque MCP client on some protocol requests. initialize, tools/list, resources/list, resources/templates/list, and prompts/list create local client spans but do not inject trace context into MCP _meta.

Use case

Wrap a FastMCP client in an outer OpenTelemetry span, then connect and call initialize() or any of the list methods. The client emits a local span, but the server side does not receive traceparent / baggage through MCP _meta, so the handshake or discovery request is disconnected from the caller's trace.

Expected vs actual

Expected: these client requests should propagate _meta.traceparent and _meta.baggage the same way tools/call, resources/read, and prompts/get already do.

Actual: the client calls the MCP SDK methods directly, so those requests cross the protocol boundary without MCP trace context.

Related: #3887 tracks broader method coverage. This issue is specifically about propagation on methods the FastMCP client already wraps or exposes today.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working. Reports of errors, unexpected behavior, or broken functionality.clientRelated to the FastMCP client SDK or client-side functionality.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions