modelcontextprotocol/java-sdk

Developer Tools

Lets JVM applications expose tools to, or call tools from, AI models over the Model Context Protocol.

3,742
1,115
Java
MIT
1 year old

If your team builds Java services and has been wiring bespoke JSON adapters so an AI assistant can call internal functions, this SDK replaces that glue with a maintained implementation of the Model Context Protocol. The decision is less whether MCP is interesting and more whether your existing Spring or plain-Java stack can absorb another protocol dependency.

The problem

A Java service usually wants one thing: let an AI client list and invoke a defined set of operations (a database lookup, an internal API call) without hand-rolling a transport, schema and session layer for each integration. Before this SDK, that meant writing JSON-RPC plumbing, deciding sync versus async behaviour and inventing your own capability discovery. Now the server side registers capabilities and the client side negotiates them through the protocol; sync and async pattern support is documented in the SDK itself. The result is that a Java process can act as a standard MCP server or client rather than a one-off integration.

What's different

This is the official SDK, maintained in collaboration with Spring AI, and that relationship shapes the design. If you already use Spring Boot, the Spring AI MCP starters offer client and server boot integration plus annotation-based method handling, so exposure can be declarative instead of manual. The repository also publishes conformance results against the MCP conformance suite at version 0.1.15: the server suite shows 40/40 passed, while the client suite reports 3/4 scenarios and 9/10 checks passed. That asymmetry is the main trade-off to weigh: the server path currently has stronger published validation evidence than the client path.

The SDK targets Java 17+ and ships through Maven Central with a BOM, so it fits modern JVM projects without dragging in a new runtime. Building and testing from source, however, requires Docker and npx because the test suite spins up external processes; that cost applies to contributors and to CI pipelines that run the full test suite, not necessarily to consumers who only use the published artifacts. The README excerpts do not spell out all transport or lifecycle details, so treat the SDK documentation as the real integration surface.

Who should try it

Good fit: a Java or Spring Boot team that already has internal tools or data-access services and wants an AI client to discover and invoke them under a standard protocol, especially if annotation-based Spring wiring reduces boilerplate. It also suits teams that need both client and server roles in the same codebase.

Poor fit: teams on Java versions below 17, or those who want a fully self-contained build without Docker and npx in their test tooling. Teams that need the client scenario to be tied out end-to-end should first look at the published conformance results rather than assume parity with the server side. Non-JVM teams get nothing here.

Requirements and limitations

Java 17 or newer is required. Dependencies come from Maven Central with a BOM, which simplifies version alignment across SDK modules. The source build and test workflow needs Docker and npx preinstalled, which affects CI design and local contributor onboarding more than library consumers. The client conformance suite is not yet fully passing (3/4 scenarios, 9/10 checks), and this is a young project (created January 2025), so API and protocol alignment should be checked against the version you actually depend on. The README excerpts are truncated, so transport options and production lifecycle guidance should be confirmed in the linked docs before committing.

HotRepo's take

HotRepo has tracked this repository since 2026-10-24, only two recorded dates, so trend direction cannot be judged. The one concrete signal is a weekly java board position of #5 with +18 stars for the week on 2026-10-25. Scope that before adopting: verify which conformance suite version and Java baseline your chosen SDK release maps to, and check the client conformance gaps against your integration plan.

Written by AI from the project's README, updated October 25, 2026. The project's own docs are the source of truth.