Is your feature request related to a problem? Please describe.
I'm trying to build my own MCP Gateway which sits between clients and upstream MCP servers. Today, ClientSession.CallTool always unmarshals to *CallToolResult, which is expensive for proxy-style passthrough and large tool responses.
Describe the solution you'd like
An addition to the client API to return raw tools/call result payloads. This would let MCP gateway implementations pass upstream JSON cheaply and reduce CPU utilization concerns for JSON decode/encode operations.
Describe alternatives you've considered
- Continue using
CallTool and accept the overhead
Additional context
This proposal would be conceptually similar to CallToolParamsRaw: #377
Happy to open the PR if this is something that we could add. Thanks!
PR for this feature: #968
Is your feature request related to a problem? Please describe.
I'm trying to build my own MCP Gateway which sits between clients and upstream MCP servers. Today,
ClientSession.CallToolalways unmarshals to*CallToolResult, which is expensive for proxy-style passthrough and large tool responses.Describe the solution you'd like
An addition to the client API to return raw
tools/callresult payloads. This would let MCP gateway implementations pass upstream JSON cheaply and reduce CPU utilization concerns for JSON decode/encode operations.Describe alternatives you've considered
CallTooland accept the overheadAdditional context
This proposal would be conceptually similar to
CallToolParamsRaw: #377Happy to open the PR if this is something that we could add. Thanks!
PR for this feature: #968