Skip to content

OTEL: Instrument all MCP methods, not just tools/call, resources/read, prompts/get #3887

@strawgate

Description

@strawgate

Summary

FastMCP instruments 3 of 29 well-known MCP methods. The MCP Semantic Conventions define mcp.method.name values for all 29. This issue tracks adding CLIENT + SERVER spans for the missing methods.

Currently instrumented (3 of 29)

Method CLIENT SERVER
tools/call
resources/read
prompts/get

High-priority missing methods

Method Notes
tools/list Called frequently for tool discovery — currently invisible in traces
resources/list Resource discovery
resources/templates/list Template discovery
prompts/list Prompt discovery
initialize Connection lifecycle — can't see session setup in traces
sampling/createMessage LLM sampling — where most time and cost is spent in agentic servers
ping Health checks

Lower-priority methods

Method Notes
completion/complete Auto-completion
elicitation/create User input elicitation
resources/subscribe / resources/unsubscribe Resource subscriptions
roots/list Root directory listing
logging/setLevel Log level changes
notifications/* (10 methods) Change notifications — at minimum notifications/tools/list_changed

delegate span review

The INTERNAL delegate {name} span emitted on mounted server delegation currently:

  • Has only 2 vendor attributes (fastmcp.provider.type, fastmcp.component.key)
  • Missing mcp.method.name (set on all other spans)
  • Not in the MCP spec

The parent SERVER span already carries fastmcp.provider.type=FastMCPProvider and fastmcp.delegate.original_name. Consider either removing the delegate span or adding mcp.method.name for consistency.

Methodology

Full audit: https://github.com/strawgate/fastmcp-pr-review/blob/main/otel-audit.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    clientRelated to the FastMCP client SDK or client-side functionality.enhancementImprovement to existing functionality. For issues and smaller PR improvements.serverRelated to FastMCP server implementation or server-side functionality.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions