Repository navigation
Description
AI disclaimer: used Claude Code to generate as much useful context as possible.
Is there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/node - express
SDK Version
10.48.0
Framework Version
@modelcontextprotocol/sdk 2.x (Node StreamableHTTPServerTransport)
Link to Sentry event
N/A — no spans are emitted
Reproduction Example/SDK Setup
Sentry.init({ dsn: process.env.DSN, tracesSampleRate: 1.0 });
app.all('/mcp', auth, async (req, res) => {
const transport = new StreamableHTTPServerTransport({
sessionIdGenerator: undefined, // stateless
enableJsonResponse: true,
});
const server = Sentry.wrapMcpServerWithSentry(
new McpServer({ name: 'x', version: '1.0.0' }),
{ recordInputs: true, recordOutputs: true },
);
registerTools(server);
await server.connect(transport);
await transport.handleRequest(req, res, req.body);
});Steps to Reproduce
- Use
@sentry/node≥ 10.39.0 (post-#19172). - Construct a per-request
McpServer+ NodeStreamableHTTPServerTransportwithsessionIdGenerator: undefined(stateless mode, per the official MCP SDKsimpleStatelessStreamableHttp.tsexample). - Wrap with
wrapMcpServerWithSentry,server.connect(transport),transport.handleRequest(...). - Call any tool from a client.
Expected Result
An mcp.server span with mcp.tool.name attribute for each tools/call, visible on the MCP insights dashboard.
Actual Result
Zero mcp.server spans emitted. http.server transactions for POST /mcp are recorded fine, but tool-call correlation never resolves, so spans are created on onmessage and never .end()-ed on send.
Additional Context
This is the stateless follow-up to JS-1663 / PR #19172, which the reporter flagged in this comment and a maintainer acknowledged here ("about the stateless issue, we'll get that fixed, it slipped by").
I'm using stateless because I am deploying to a scale-to-zero Fly.io server.
Priority
React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it.
Metadata
Metadata
Assignees
Projects
- StatusShow more project fieldsNo status
Activity
linear-code commentedon Apr 14, 2026
JS-2164
logaretm commentedon Apr 14, 2026
Thanks for reporting this, I have submitted a PR just moments ago.
maxproske commentedon Apr 14, 2026
That was incredibly quick. Thank you Abdelrahman :)
fix(core): handle stateless MCP wrapper transport correlation (getsen…
fix(core): handle stateless MCP wrapper transport correlation (#20293)
github-actions commentedon Apr 23, 2026
A PR closing this issue has just been released 🚀
This issue was referenced by PR #20293, which was included in the 10.50.0 release.