openllmetry icon indicating copy to clipboard operation
openllmetry copied to clipboard

🐛 Bug Report: MCP Span Missing for stdio Transport Mode

Open elinacse opened this issue 3 months ago • 4 comments

Which component is this bug for?

Traceloop SDK

📜 Description

As per MCP instrumentation these spans are expected mcp.method.name mcp.request.argument mcp.request.id mcp.response.value mcp.session.init_options But when running MCP server in stdio mode only RequestStreamWriter span is coming no ResponseStreamWriter span is present (mcp.response.value) span is missing and also mcp.session.init_options span is mising hence we are not getting the tool response details .

👟 Reproduction steps

  1. Initialize MCP server with traceloop
  2. Run mcp server in stdio mode
  3. check in traceloop the particular span(ResponseStreamWriter -> mcp.response.value), mcp.session.init_options is missing

👍 Expected behavior

mcp.response.value ,mcp.session.init_options span should be present for stdio mode .

👎 Actual Behavior with Screenshots

Image

Here in the picture root span is also missing

🤖 Python Version

3.13

📃 Provide any additional context for the Bug.

No response

👀 Have you spent some time to check if this bug has been raised before?

  • [x] I checked and didn't find similar issue

Are you willing to submit PR?

None

elinacse avatar Sep 04 '25 16:09 elinacse

Thanks @elinacse! Do you mind sharing a minimal reproducible example?

nirga avatar Sep 04 '25 16:09 nirga

@nirga Here is the sample mcp server which I tested with Claude Desktop

weather.py

Image

Here is the picture for the sample the route spna is missing and we only see RequestStreamWriter No ResponseStreamWriter is there .

CC: @gyliu513

elinacse avatar Sep 04 '25 17:09 elinacse

@fali007 ^^

gyliu513 avatar Sep 04 '25 18:09 gyliu513

https://github.com/traceloop/openllmetry/pull/3383

elinacse avatar Sep 15 '25 12:09 elinacse