mcp sdk doesn't expose request id for tracing tool calls across distributed systems
ok so we're running mcp tools across multiple services and there's no way to trace a tool call from the initial agent request through the mcp server to the actual tool execution and back. the sdk doesn't expose any request id or correlation id in the tool context. this makes debugging distributed agent systems completely broken. when a tool call fails somewhere in the chain we have zero way to correlate logs across services. tested @modelcontextprotocol/sdk 0.5.0 and the tool handler receives params and context but no trace metadata. had to build a wrapper that generates uuids and passes them through custom headers but this should be in the sdk.
need this badly. at work we run agents across 4 different services and tracing tool calls without request ids is impossible
need this so badly for our setup. running 6 different mcp tools across 3 services and debugging failures without request ids is impossible
imo the mcp spec should require request_id in the protocol itself... could be wrong but without it you're stuck correlating by timestamp which breaks down under load. we ended up hashing the tool name + params + timestamp but that's a hack
can you share example code for how you hash the tool name + timestamp? trying to set this up for our mcp tools but not sure how to correlate requests across services