The official Java SDK for Model Context Protocol servers and clients. Maintained in collaboration with Spring AI
Repo modelcontextprotocol/java-sdk, read from GitHub 1 min ago. modelcontextprotocol has not joined Take My Repo.
This release adds support for the 2026-07-28 MCP specification revision: a stateless server and a client in io.modelcontextprotocol.modern, next to the existing (legacy) client and server, which are unchanged.
The 2026-07-28 specification brought breaking changes to the protocol, and completely revamped the Streamable HTTP. This new protocol is stateless, and drops the concept of session entirely. The Java SDK already has a subset of the older protocol that is stateless (see for example McpStatelessSyncServer and HttpServletStatelessServerTransport). To differentiate this "modern, stateless" protocol from the "legacy, stateless" implementation, the new protocol implementation lives in the io.modelcontextprotocol.modern package, with io.modelcontextprotocol.modern.server.McpServer and io.modelcontextprotocol.modern.client.McpClient as entrypoints.
The modern API may still change in minor releases until 3.0.
initialize handshake. A client stands for one user, does no I/O when built, and can share its transport with other clients.McpClient.sync(transport) / McpClient.async(transport), with a request spec per operation, e.g. client.tool("create_issue").arguments(args).call()._meta block, version renegotiation, multi round-trip input_required results (form and URL elicitation), Mcp-* / Mcp-Param-* headers, subscriptions/listen, server/discover and tool listing caching based on ttlMs.HttpClient) and STDIO transports. Sampling, roots, logging and extensions are not supported yet.addRoot, setLoggingLevel, createMessage, listRoots, loggingNotification and the capability builder methods). The handler registration methods are not deprecated, since peers may still use them. Behavior and wire format are unchanged.McpTransportContext no longer has content-based equals/hashCode. Read entries with get(String) instead, by @chemicL in #1288find by @chemicL in #1282CompletionsFeature and McpSync/AsyncCompletionRepository are removed; use McpSyncPrompt.withCompletionHandler, McpSyncResourceTemplate and supportsCompletion() on the repository, by @chemicL in #1316McpParamHeaders is replaced by McpHeaders, which also carries the Mcp-Name header, by @Kehrlann in #1335InputResponses.get and RequestStateCodec.open return null instead of an empty Optional, by @chemicL in #1325Mcp-Param headers by @Kehrlann in #1286Mcp-Name header in the McpTransportContext, for extension validation, by @Kehrlann in #1335McpServer.Builder#restrictSubscriptions by @Kehrlann in #1332initialize requests with UnsupportedProtocolVersion, listing the supported versions, by @Kehrlann in #1333Mcp-* headers with more than one value by @Kehrlann in #1323subscriptions/listen without params or notifications returns an error by @Kehrlann in #1324McpTransportContext#putAll(Map) by @chemicL in #1288@Nullable, by @Kehrlann in #1331HttpServletStreamableServerTransportProvider: avoid completing the async context twice by @Kehrlann in #1308HttpClientStreamableTransport: fix a race condition on 404 responses that cancelled the request instead of propagating the error, by @Kehrlann in #1306LoggingMessageNotification#data accepts non-String payloads by @Kehrlann in #1201list_changed when removing a resource template by @subhashpolisetti in #1266Content-Type validation by @tarun-agarwal1044 in #1207subscriptions/listen by @Kehrlann in #1327io.projectreactor:reactor-bom 2024.0.0 โ 2026.0.0-RC1 by @chemicL in #1191 and @Kehrlann in #1267org.jspecify:jspecify 1.0.0 (new) by @Kehrlann in #1331com.fasterxml.jackson.core:jackson-databind 2.21.1 โ 2.22.4 and jackson-annotations 2.21 โ 2.22 by @Kehrlann in #1267 (and #1233)tools.jackson.core:jackson-databind 3.1.4 โ 3.1.8 in #1238com.networknt:json-schema-validator 2.0.4 โ 2.0.8 and 3.0.6 โ 3.0.8 by @Kehrlann in #1259org.slf4j:slf4j-api 2.0.16 โ 2.0.20 in #1224mcp-test no longer depends on Spring by @Kehrlann in This affects the modern server (2026-07-28 preview).:
These affect the modern server (2026-07-28 preview).:
Mcp-Param headers in the modern server by @Kehrlann in #1286putAll(Map) to McpTransportContext by @chemicL in #1288
McpTransportContext no longer has content-based equals/hashCode.LoggingMessageNotification#data accepts non-String payload by @Kehrlann in #1201list_changed when removing a resource template by @subhashpolisetti in #1266com.networknt:json-schema-validator 2.0.4 -> 2.0.8 and 3.0.6 -> 3.0.8 by @Kehrlann in #1259com.fasterxml.jackson.core:jackson-annotations from 2.21 to 2.22 @Kehrlann in #1267io.projectreactor:reactor-bom from 2024.0.0 to 2024.0.18 by @dependabot[bot] in #1239com.fasterxml.jackson.core:jackson-databind from 2.21.1 to 2.21.8 by @dependabot[bot] in #1233tools.jackson.core:jackson-databind from 3.1.4 to 3.1.8 by @dependabot[bot] in #1238org.slf4j:slf4j-api from 2.0.16 to 2.0.20 by @dependabot[bot] in #1224ch.qos.logback:logback-classic from 1.6.5 to 1.6.6 by @dependabot[bot] in #1305Full Changelog: v2.2.0-M1...v2.2.0-M2
Modern stateless server for MCP 2026-07-28: #1170 by @chemicL
The first step toward the stateless Streamable HTTP paradigm. It is a new server in io.modelcontextprotocol.modern, independent of the legacy McpSchema, and it passes all 37 required 2026-07-28 conformance scenarios.
Full Changelog: v2.1.0...v2.2.0-M1
HttpClient-based transports are now Publisher-based, and request customizers compose on the builders.
ClientCapabilities and ServerCapabilities (SEP-2133). #1064 by @YousefHaggyServerHttpHeaderValidator replaces ServerTransportSecurityValidator. #982 by @neerajbhattsendMessage is now thread-safe. #935 by @nquinquenelMonos. #1175 by @kamishengaddRoot/removeRoot when roots listChanged is unset. #1179 by @KehrlannJSONRPCErrorResponse. #1182 by @Kehrlann@slachiewicz, @YousefHaggy, @kamisheng, @itzjb, @neerajbhatt and @nquinquenel
Full Changelog: v2.0.1...v2.1.0
Full Changelog: v1.1.4...v1.1.5
Full Changelog: v0.18.4...v0.18.5