GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |
GeezerVison is showing github.com — Add a modern client for MCP 2026-07-28 by chemicL · Pull Request #1325 · modelcontextprotocol/java-sdk Conversation
Member
The latest protocol revision introduced a stateless incarnation of the protocol. It requires no initialization handshake or session management, and it doesn't allow server-to-client requests. An instance of the modern client is meant to stand for one user. It does no I/O when built and can share its transport with other clients, so an application that handles authorization creates one per user over a single HTTP transport. Identity isn't passed to client methods; the caller's Clients are built with The client takes care of what the revision requires:
A round timeout bounds each exchange but not the time a user spends answering; a call timeout is optional. The sync client runs the loop and its handlers on the caller's thread. Transports: Streamable HTTP on the JDK On the server side, the HTTP and stdio wire constants are shared with the client, input requests are typed by method and mode, and the listen filter is open so features can honour extension fields. A conformance client in conformance-tests/client-modern passes the non-auth 2026-07-28 client scenarios. Part of #1011
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsThe latest protocol revision introduced a stateless incarnation of the
protocol. It requires no initialization handshake or session
management, and it doesn't allow server-to-client requests.
An instance of the modern client is meant to stand for one user. It
does no I/O when built and can share its transport with other clients,
so an application that handles authorization creates one per user over
a single HTTP transport. Identity isn't passed to client methods; the
caller's McpTransportContext reaches the transport's request customizer
and authorization error handler. The tool catalog is therefore that
user's view of the server. The client also uses it for x-mcp-header
mirroring.
Clients are built with McpClient.async(transport) or
McpClient.sync(transport), and each operation goes through an immutable
request spec, e.g. client.tool("create_issue").arguments(args).call().
Timeouts, progress, _meta and elicitation handlers are set on the
builder and can be overridden per call on the spec.
The client takes care of what the revision requires:
- the _meta block with version and capabilities on every request
- version renegotiation
- the multi round-trip loop for input_required results (with callOnce()
for callers that run it themselves)
- the Mcp-* and Mcp-Param-* headers, with one retry on -32020
- subscriptions/listen streams that report which parts of the filter
the server doesn't honour
A round timeout bounds each exchange but not the time a user spends
answering; a call timeout is optional.
The sync client runs the loop and its handlers on the caller's thread.
Transports: Streamable HTTP on the JDK HttpClient, and stdio. Sampling,
roots, logging and extensions are left out for now.
On the server side, the HTTP and stdio wire constants are shared with
the client, input requests are typed by method and mode, and the listen
filter is open so features can honour extension fields.
InputResponses.get and RequestStateCodec.open return null instead of an
empty Optional.
A conformance client in conformance-tests/client-modern passes the
non-auth 2026-07-28 client scenarios.
Signed-off-by: Dariusz Jedrzejczyk <[email protected]>
1 of 5 tasks
- listTools() asked the server for every page on each call. The client now keeps the listing for its ttlMs and returns it while it's fresh. listTools() returns a spec: list() serves the kept listing, and skipCache() always asks the server. A listen stream that reports tool changes drops the kept listing. - The client's own failures (missing input handler, too many input rounds, invalid result, lost response, timeout, lost listen stream, HTTP error status) now extend McpClientException. Errors the server answered remain McpException, so catching the two covers every failure of a call. - McpHttpRequestCustomizer.fromSync ran the customizer on whichever thread sent the request, sometimes the caller's and sometimes an HTTP client thread. It now runs on boundedElastic, as the authorization error handler's fromSync does, so a customizer may block, for example to fetch a token. Hooks get the call's identity only from the McpTransportContext, on every attempt. - McpHttpRequest and McpHttpResponseInfo can now be created outside the SDK, with McpHttpRequest.builder(...) and McpHttpResponseInfo.of(...), so a custom HTTP transport can call the request customizers and the authorization error handler. Signed-off-by: Dariusz Jedrzejczyk <[email protected]>
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
tzolov
previously approved these changes
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I like the design, but given the time constraints, I can't give it the thoughtful review it deserves.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
tzolov
approved these changes
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. conflict resolution is fine
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsUh oh!
There was an error while loading. Please reload this page.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ReviewersUh oh!
There was an error while loading. Please reload this page. AssigneesNo one assignedLabelsProjectsDevelopmentSuccessfully merging this pull request may close these issues. Uh oh!
There was an error while loading. Please reload this page. Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later. | |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |