mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-09-01 12:03: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> |
||
|---|---|---|
| .. | ||
| auth | ||
| http | ||
| middleware | ||
| openapi | ||
| proxy | ||
| __init__.py | ||
| test_app_state.py | ||
| test_auth_integration.py | ||
| test_context.py | ||
| test_file_server.py | ||
| test_icons.py | ||
| test_import_server.py | ||
| test_input_validation.py | ||
| test_log_level.py | ||
| test_logging.py | ||
| test_mount.py | ||
| test_run_server.py | ||
| test_server.py | ||
| test_server_interactions.py | ||
| test_server_lifespan.py | ||
| test_streamable_http_no_redirect.py | ||
| test_tool_annotations.py | ||
| test_tool_exclude_args.py | ||
| test_tool_transformation.py | ||