java-sdk: The Official Java SDK for Model Context Protocol
This repository profile is provided by osrepos.com, an open source repository discovery platform.

Summary
The `java-sdk` is the official Java SDK for interacting with Model Context Protocol servers and clients. It provides a standardized interface for Java applications to communicate with AI models and tools, supporting both synchronous and asynchronous patterns. Developed in collaboration with Spring AI, it offers robust integration for building AI-powered applications.
Repository Information
Topics
Click on any tag to explore related repositories
Use at your own risk
OSRepos shares public repositories for knowledge and discovery only. Any installation, execution, configuration, or use of code from these repositories is the user's own responsibility. Always review the repository, source code, dependencies, licenses, and security implications before running or installing anything. OSRepos is not responsible for issues, damages, or losses resulting from third-party repositories.
Introduction
The java-sdk is the official Java SDK designed to facilitate interaction with Model Context Protocol (MCP) servers and clients. This SDK empowers Java applications to seamlessly integrate with AI models and tools through a standardized interface, supporting both synchronous and asynchronous communication patterns. Maintained in collaboration with Spring AI, the java-sdk offers comprehensive support for building modern AI-driven applications, including Spring Boot integration for both client and server functionalities.
Installation
To get started with the java-sdk, you can build it directly from the source code. Stable releases are also available via Maven Central.
Building from Source
./mvnw clean install -DskipTests
Running Tests
To run the tests, ensure you have Docker and npx pre-installed on your system.
./mvnw test
For stable releases, you can find the java-sdk on Maven Central.
Examples
The java-sdk provides extensive capabilities for both consuming and exposing Model Context Protocol endpoints. For detailed examples and comprehensive guides on using the SDK, refer to the official documentation:
- MCP Java Client: Learn how to use the MCP client to interact with MCP servers.
- MCP Java Server: Discover how to implement and configure MCP servers.
Additionally, for Spring-based applications, the SDK extends its functionality with Spring Boot integration, allowing for quick bootstrapping of AI applications:
- Spring AI MCP Client Boot Starter:
- Spring AI MCP Server Boot Starter:
These resources provide practical examples and detailed instructions to help you integrate MCP into your Java and Spring AI projects.
Why Use the java-sdk?
The java-sdk is built with a strong focus on pragmatism, interoperability, and pluggability, making it a robust choice for developing AI-powered applications in Java. Its design decisions address key challenges in the Java ecosystem, ensuring developers can be productive quickly while maintaining flexibility.
Key aspects that make the java-sdk a compelling choice include:
- Pragmatic Design: The SDK aims to make developers productive quickly by providing sensible defaults and clear abstractions.
- Interoperability: It aligns with widely adopted libraries and practices in the Java ecosystem, such as Jackson for JSON serialization and SLF4J for logging.
- Pluggability: The architecture allows for alternatives where projects prefer different stacks, for example, by offering pluggable JSON libraries, client/server transports, and authorization hooks.
- Thoughtful Technology Choices:
- JSON Serialization: Uses Jackson as the default, widely adopted and performant, but provides an abstraction (
mcp-json) for easy swapping. - Programming Model: Leverages Reactive Streams with Project Reactor for asynchronous and streaming interactions, crucial for MCP's bidirectional protocol. A synchronous facade is also provided for simpler, blocking use cases.
- Observability: Integrates SLF4J for logging and Reactor Context for propagating observability data across asynchronous boundaries, ensuring compatibility with modern tracing and metrics frameworks.
- Remote Clients and Servers: Offers JDK HttpClient as the default client transport and Jakarta Servlet for server transport, with optional Spring WebClient, WebFlux, and WebMVC integrations for Spring-based projects. It also includes pluggable authorization hooks for server-side security.
- JSON Serialization: Uses Jackson as the default, widely adopted and performant, but provides an abstraction (
- Modular Structure: The SDK is organized into distinct modules, allowing users to include only the necessary components, promoting lightweight and efficient dependency management.
Links
Explore the java-sdk further through these official resources:
- GitHub Repository: https://github.com/modelcontextprotocol/java-sdk
- Issue Tracker: https://github.com/modelcontextprotocol/java-sdk/issues
- CI/CD: https://github.com/modelcontextprotocol/java-sdk/actions
- Reference Documentation: https://modelcontextprotocol.io/sdk/java/mcp-overview
- Spring AI MCP Documentation: https://docs.spring.io/spring-ai/reference/api/mcp/mcp-overview.html
- Maven Central: https://central.sonatype.com/artifact/io.modelcontextprotocol.sdk/mcp
Related repositories
Similar repositories that may be relevant next.

CompreFace: Free and Open-Source Face Recognition System with REST API
April 12, 2026
CompreFace is a leading free and open-source face recognition system that offers a robust REST API for various facial analysis tasks. It can be easily integrated into any system without requiring prior machine learning expertise, thanks to its Docker-based deployment. This powerful solution supports face recognition, detection, verification, and more, leveraging state-of-the-art methods like FaceNet and InsightFace.

Peergos: A P2P Secure File Storage, Social Network, and Application Protocol
October 21, 2025
Peergos is a peer-to-peer, secure platform designed for private file storage, social networking, and application hosting. It emphasizes user control over data, offering end-to-end encryption and fine-grained access control. Built on a decentralized architecture, Peergos aims to create a private web experience where users are protected from surveillance and data tracking.

shopping-assistant: An AI-Powered Webshop Demo Exploring LLM Interactions
October 11, 2025
The `shopping-assistant` project is a Java-based webshop demo, 'Bizarre Bazaar', featuring an AI-powered shopping assistant. It explores various LLM interaction modes, from helpful guidance with state management and security guardrails to demonstrating prompt injection attacks and an unethical assistant. This educational application provides practical examples of integrating AI into e-commerce, highlighting both its potential and crucial security considerations.

quarkus-langchain4j-workshop: Build AI-Infused Apps with Quarkus and LangChain4j
October 11, 2025
Explore the `quarkus-langchain4j-workshop` to learn how to develop AI-infused applications using Quarkus and LangChain4j. This workshop provides a structured approach, guiding you through various steps to build powerful AI solutions. It's an excellent resource for developers looking to integrate large language models into their Quarkus projects.
Source repository
Open the original repository on GitHub.
8 counted GitHub visits