Target branch: 2026-07-28-protocol-support
Requires:
A chimp client completes a tools/call, prompts/get or resources/read that a 2026-07-28 server answers with an input-required result. The client gathers the requested input through its handlers and retries the request, as many rounds as the server needs. The caller sees one call and one final result.
Handlers
- The roots, sampling and elicitation handlers can be given to any client, over any transport. A bidirectional transport is needed only for legacy servers that send requests themselves.
- The capabilities the client declares on every request reflect the handlers it has. A server may therefore only ask for input the client can produce.
The retry loop
- When a result has
resultType: input_required, the client answers every entry of inputRequests with the handler for its kind, then sends the original request again with all answers in inputResponses, under the same keys.
- The retry carries
requestState byte for byte as the server sent it. When the server sent none, the retry carries none. The client never inspects or changes the state.
- The retry is a new request with a new id and its own request metadata.
- An input-required result without
inputRequests leads to a retry with the state only.
- The loop continues while the server keeps asking, up to a bounded number of rounds. At the bound the call fails with
McpProtocolException.
- A result without
resultType is complete and ends the call. No retry happens.
Failures
- An input request of a kind the client has no handler for fails the call with
McpProtocolException. Nothing is retried.
- A handler that fails or refuses ends the call with that failure. A handler that answers with
decline or cancel produces a normal answer, and the server decides what happens next.
- An input-required result on any operation other than the three named above fails the call with
McpProtocolException, because the spec forbids it.
Coverage
- The rules above hold for the sync and streaming clients, over HTTP and stdio, on ZIO, Ox and Pekko.
- Behaviour towards legacy servers does not change.
- The conformance client handles the
sep-2322-client-request-state scenario, which calls test_mrtr_echo_state, test_mrtr_unrelated, test_mrtr_no_state and test_mrtr_no_result_type.
Spec:
Conformance scenarios that must pass after this task (2026-07-28 run):
- Client:
sep-2322-client-request-state.
Docs: yes.
docs/client/capabilities.md: the handlers work over every transport with a 2026-07-28 server, a bidirectional transport is needed only for legacy servers, how the retry loop behaves and where its bound is set. Updated McpClient.apply and bidirectional snippets.
Target branch: 2026-07-28-protocol-support
Requires:
A chimp client completes a
tools/call,prompts/getorresources/readthat a 2026-07-28 server answers with an input-required result. The client gathers the requested input through its handlers and retries the request, as many rounds as the server needs. The caller sees one call and one final result.Handlers
The retry loop
resultType: input_required, the client answers every entry ofinputRequestswith the handler for its kind, then sends the original request again with all answers ininputResponses, under the same keys.requestStatebyte for byte as the server sent it. When the server sent none, the retry carries none. The client never inspects or changes the state.inputRequestsleads to a retry with the state only.McpProtocolException.resultTypeis complete and ends the call. No retry happens.Failures
McpProtocolException. Nothing is retried.declineorcancelproduces a normal answer, and the server decides what happens next.McpProtocolException, because the spec forbids it.Coverage
sep-2322-client-request-statescenario, which callstest_mrtr_echo_state,test_mrtr_unrelated,test_mrtr_no_stateandtest_mrtr_no_result_type.Spec:
Conformance scenarios that must pass after this task (2026-07-28 run):
sep-2322-client-request-state.Docs: yes.
docs/client/capabilities.md: the handlers work over every transport with a 2026-07-28 server, a bidirectional transport is needed only for legacy servers, how the retry loop behaves and where its bound is set. UpdatedMcpClient.applyandbidirectionalsnippets.