modelcontextprotocol

java-sdk: Build Java Clients and Servers for Model Context Protocol

The official Java SDK for the Model Context Protocol (MCP), maintained in collaboration with Spring AI. It gives Java applications a shared way to consume MCP servers and expose MCP endpoints, with synchronous and asynchronous communication.

Stars
3.7k
Forks
1.1k
Stars, last 30 days
+32
Last commit
today
Contributors
86

Our take

Activeregular commits and releases

Health score

74/100

How it is scored
Activity
73
Community
74
Issues
75
Pull requests
74

+32 stars in the last 30 days

  • Releases more often than 79% of the projects we track
  • Merges more pull requests than 76% of the projects we track
  • More contributors than 75% of the projects we track

This is an actively maintained, broadly contributed Java implementation of MCP, with recent releases and a clear split between core support and Spring AI integrations.

Good fit if

  • You are building an MCP client or server in a Java 17+ application and want the official Java SDK.
  • You need both blocking and asynchronous programming options, or want to choose among the included transports.
  • You can provide your own authorization approach for server deployments, or use Spring AI for its Spring ecosystem integrations.

Look elsewhere if

  • You need a built-in authorization system in the core SDK.
  • Your project is not based on Java or does not target the JVM.
  • You require Spring WebClient, WebFlux, or WebMVC support directly from this repository rather than through Spring AI.
All health signals
Last commit2026-10-22 (today)
Commits, last 90 days97
Releases, last 12 months29 (latest v2.2.0-M1, 2026-10-16, pre-release)
Contributors86 (top contributor: 46% of commits)
Issues closed, last 90 days14+ (typically closed in 1 day)
Pull requests merged, last 90 days56 (typically merged in 0 days)
Project age21 months

Checked on 2026-10-23 with the GitHub API.

Project history

Daily GitHub snapshots since Oct 7, 2026. History covers stars and forks; health signals are not tracked historically.

Selected snapshot

Stars

3,773

Forks

1,108

Change since Nov 16, 2026: +5 stars·-1 forks

Overview

The official Java SDK for the Model Context Protocol (MCP), the protocol for connecting AI applications with tools and other capabilities, is maintained in collaboration with Spring AI. It provides Java applications with a standardized way to act as MCP clients or servers, supporting both synchronous and asynchronous communication.

The SDK is aimed at Java developers integrating MCP without tying their application to one transport or JSON library. Its core provides STDIO, JDK HttpClient, and Servlet support; Spring-specific transports and integrations are available through Spring AI.

Key Features

  • Provides client and server APIs for MCP applications.
  • Supports synchronous use alongside asynchronous, streaming APIs based on Reactive Streams, with Project Reactor as the internal implementation.
  • Includes STDIO, JDK HttpClient client transport, and Jakarta Servlet server support.
  • Keeps client and server APIs transport-agnostic so alternative transports can be integrated.
  • Uses a JSON binding abstraction with Jackson 3 as the default implementation and a Jackson 2 option.
  • Provides pluggable server authorization hooks rather than a built-in authorization system.
  • Organizes core, JSON integrations, dependency management, and testing utilities into separate Maven modules.

Use Cases

  • Build a Java application that calls tools exposed by one or more MCP servers.
  • Expose an existing Java service as an MCP server over Servlet or STDIO transport.
  • Use asynchronous or streaming interactions when an MCP workflow involves multiple in-flight requests or notifications.
  • Add MCP support to a Spring application using the Spring AI integrations instead of wiring transports directly.

What you need

Detected in the repository

  • Java (JVM) (from pom.xml)
  • Automated checks on GitHub Actions

License in plain words

MITpermissive

  • Commercial use: yes
  • Modify and redistribute: yes
  • You must keep: the copyright and license notice
  • Share your changes: no

A summary, not legal advice: the LICENSE file is what applies.

Getting Started

Build the project from a clone with:

./mvnw clean install -DskipTests

See the README and SDK documentation for dependencies, client and server guides, and usage examples.

Alternatives

  • mcp-framework: mcp-framework is a Rust and Tokio framework for building MCP clients, servers, and agents, while java-sdk provides MCP client and server support for Java applications.
ProjectLanguageLicenseStarsStatus
java-sdkJavaMIT3.7kActive
mcp-frameworkRustMIT25Quiet

Considerations

The SDK is active, with regular commits and releases, and contributions come from a broad group rather than depending mostly on one person. Its issue tracker shows recent closures and quick median resolution, though the measured closure count is a minimum. The latest listed release is a prerelease, so check release status and compatibility before standardizing on a version. Core server authorization is intentionally left to application-specific integrations, and Spring transports are maintained in Spring AI rather than this repository. The project is MIT-licensed.

Found this useful?

Share it with someone who would like java-sdk.

Comparisons