mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-09-01 03:53:19 +02:00
Enable distributed tracing across protocols that don't support HTTP headers (like SSE) by propagating W3C Trace Context through MCP _meta fields. - Add propagate_context parameter (default: True) to OpenTelemetryMiddleware - Implement _extract_trace_context() to read traceparent/tracestate from request metadata - Implement _inject_trace_context() to write trace context to response metadata - Update all operation handlers to extract parent context and inject into results - Add comprehensive test coverage for context propagation - Update documentation with examples and configuration details This enables trace continuity across MCP calls, allowing clients to link server spans to their traces and propagate context downstream. Co-authored-by: William Easton <strawgate@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| cli | ||
| client | ||
| contrib | ||
| deprecated | ||
| experimental | ||
| integration_tests | ||
| prompts | ||
| resources | ||
| server | ||
| tools | ||
| utilities | ||
| __init__.py | ||
| conftest.py | ||
| test_examples.py | ||
| test_mcp_config.py | ||