Repository navigation
Description
Summary
Please add an opt-in client API that returns an MRTR InputRequiredResult (the
inputRequests and the opaque requestState) to the caller, instead of always resolving it
through McpClientHandlers inside McpClient. Re-issuing the call with the answers already works
through CallToolRequestParams.InputResponses / RequestState. Capturing the state is the only
missing piece.
Use case
We run an agent that brokers MCP tool calls for a person. When a server elicits during a
tools/call, the agent doesn't answer in-process. It hands the question back to its own
conversation (often to the user), and the answer can take minutes or hours.
Under MRTR this costs the server nothing: it returns input_required and keeps no state. But
the client does keep state. Today the only way to wait is to keep CallToolAsync suspended
inside ElicitationHandler until the answer arrives. If the client process restarts in the
meantime (a deploy, a crash, a pod reschedule), the in-flight CallToolAsync and the server's
requestState with it are gone. The call has to be redone from scratch, and the user may get
asked again.
If the client could get requestState back, it could keep it durably next to the pending
question. After a restart, it could resume the call by re-issuing it with inputResponses and
that requestState. That is how MRTR is designed to work: the continuation lives with the
client, not the server.
Current behaviour
In McpClientImpl.SendRequestAsync (2.2.0, 2.3.0 and main):
- After
_sessionHandler.SendRequestAsync, a result withresultType: "input_required"is
deserialized toInputRequiredResult. - Its
inputRequestsgo toResolveInputRequestsAsync, which calls the
Elicitation/Sampling/Roots handlers. - The request is cloned with
inputResponses+requestStateand retried, up to 10 times. - A
requestState-only result is retried automatically.
All public entry points share this path. We probed each against a real 2.2.0 server:
CallToolAsync(name, args)CallToolAsync(CallToolRequestParams)McpSession.SendRequestAsync(JsonRpcRequest)
Every one called ElicitationHandler and returned the resumed result, never the
InputRequiredResult.
The handlers can't help either: they get the request params but not the requestState, so even
a handler that wanted to save the continuation and give up can't see it.
Possible shapes
Any of these would work for us. You'll know which fits the SDK best.
- Per-request opt-out: e.g.
RequestOptions.ResolveInputRequests = false, or an option on
McpClientOptions. Atools/callthat comes backinput_requiredthen returns or throws it
to the caller, for example as anInputRequiredExceptioncarrying theInputRequiredResult.
That exception type already exists for servers. - A typed overload: e.g.
CallToolWithInputRequestsAsync(...)returning
ResultOrAlternate<CallToolResult, InputRequiredResult>, a type the Protocol namespace
already has. - Smallest change: expose
requestState(and the round's otherinputRequestskeys) to the
handlers through a context object, so a handler can save the continuation before it waits.
This doesn't remove the suspended call, but it makes a resume after restart possible.
With (1) or (2), the caller resumes with what's there today:
var resumed = await client.CallToolAsync(new CallToolRequestParams
{
Name = toolName,
Arguments = originalArguments,
InputResponses = answers, // keyed like inputRequests
RequestState = savedRequestState,
}, ct);Workarounds we looked at
- Wrap the client
ITransportand readinput_requiredresponses before the session handler
does. This works in principle, butMcpClientImplchecks the concrete transport type
(_transport is SseClientSessionTransportfor the initialize fallback, and
is StreamableHttpClientSessionTransport), so a wrapper changes behaviour. It also means
matching request ids by hand, so we'd rather not depend on it. - Bypass
McpClientfortools/call. This would lose discovery, auth, per-request_meta
and header handling.
Environment
- ModelContextProtocol 2.2.0 (checked again against 2.3.0 and
main) - Protocol revision
2026-07-28, Streamable HTTP, stateless server
Related, but not the same request: #1902 (server-side handler for InputRequiredResult), and
#1635 / #1814 (MRTR with task-backed tools).
Activity
Record MCP SDK 2.3.0 MRTR findings for hand-back resume (#752)