# modelcontextprotocol/java-sdk

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/modelcontextprotocol-java-sdk).**

3,190 stars · 815 forks · Java · mit

## Links

- GitHub: https://github.com/modelcontextprotocol/java-sdk
- Homepage: https://modelcontextprotocol.github.io/java-sdk
- awesome-repositories: https://awesome-repositories.com/repository/modelcontextprotocol-java-sdk.md

## Description

This is a software development kit for integrating the Model Context Protocol into Java applications. It serves as a framework for building AI servers and communication layers that exchange prompts, resources, and tool definitions between AI clients and servers.

The SDK provides a transport-agnostic communication layer, allowing bidirectional data exchange over standard I/O, HTTP, or Server-Sent Events. It includes a generative AI resource manager for exposing structured data and prompt templates, and a standardized interface for implementing protocol clients and servers.

The project covers broad capability areas including tool integration through schema-driven dispatch, context management via URI-template resource mapping, and prompt engineering with parameterized templates. It also incorporates security primitives for filesystem root definition and pluggable authorization hooks, alongside monitoring tools for operation progress tracking and structured log transmission.

## Tags

### Artificial Intelligence & ML

- [Model Context Protocol Integrations](https://awesome-repositories.com/f/artificial-intelligence-ml/ai-assistant-integrations/model-context-protocol-integrations.md) — Implements the Model Context Protocol to expose system data and functions to AI models in Java applications. ([source](https://java.sdk.modelcontextprotocol.io/latest/server/))
- [MCP Client Implementations](https://awesome-repositories.com/f/artificial-intelligence-ml/artificial-intelligence-tooling/agent-and-tool-integrations/mcp-server-integrations/transport-layer-implementations/mcp-client-implementations.md) — Provides transport-agnostic client implementations to connect to MCP servers and consume AI tools. ([source](https://cdn.jsdelivr.net/gh/modelcontextprotocol/java-sdk@main/README.md))
- [AI Tooling Protocols](https://awesome-repositories.com/f/artificial-intelligence-ml/ai-tooling-protocols.md) — Implements a standardized protocol for exchanging prompt templates, resources, and tool definitions between AI clients and servers.
- [Tool Discovery and Invocation](https://awesome-repositories.com/f/artificial-intelligence-ml/external-server-connectivity/tool-discovery-and-invocation.md) — Enables the discovery of available tools and their execution using structured output and schema validation. ([source](https://modelcontextprotocol.github.io/java-sdk/))
- [Resource Exposure](https://awesome-repositories.com/f/artificial-intelligence-ml/mcp-servers/resource-exposure.md) — Exposes read-only data such as file contents and database records as context for AI models via URIs. ([source](https://java.sdk.modelcontextprotocol.io/latest/server/))
- [Model Context Protocol Servers](https://awesome-repositories.com/f/artificial-intelligence-ml/model-context-protocol-servers.md) — Provides server-side implementations for exposing tools and context to AI models via the Model Context Protocol. ([source](https://cdn.jsdelivr.net/gh/modelcontextprotocol/java-sdk@main/README.md))
- [Prompt Templates](https://awesome-repositories.com/f/artificial-intelligence-ml/prompt-templates.md) — Allows the creation of structured prompt templates with parameter substitution and context injection. ([source](https://java.sdk.modelcontextprotocol.io/latest/server/))
- [AI Prompt Engineering Templates](https://awesome-repositories.com/f/artificial-intelligence-ml/ai-prompt-engineering-templates.md) — Facilitates developing structured and parameterized prompt templates for consistent AI model interactions.
- [Content Generation Requests](https://awesome-repositories.com/f/artificial-intelligence-ml/generative-ai-models/content-generation-requests.md) — Provides capabilities to send sampling requests to clients for generating text or images. ([source](https://java.sdk.modelcontextprotocol.io/latest/server/))
- [Transport Layer Connectivity](https://awesome-repositories.com/f/artificial-intelligence-ml/mcp-servers/transport-layer-connectivity.md) — Implements communication channels including standard I/O, HTTP, and SSE for protocol server connectivity. ([source](https://java.sdk.modelcontextprotocol.io/latest/client/))
- [Sampling Delegation Clients](https://awesome-repositories.com/f/artificial-intelligence-ml/model-server-clients/sampling-delegation-clients.md) — Implements the sampling delegation mechanism allowing servers to request AI completions from connected clients. ([source](https://java.sdk.modelcontextprotocol.io/latest/client/))

### Data & Databases

- [AI Context Resource Management](https://awesome-repositories.com/f/data-databases/data-resource-management/ai-context-resource-management.md) — Provides mechanisms to manage data resources accessed via unique URIs to serve as context for AI models.
- [Strict Tool Argument Validators](https://awesome-repositories.com/f/data-databases/json-schema-modeling/schema-validators/schema-constrained-sampling/strict-tool-argument-validators.md) — Validates tool arguments against JSON schemas before routing them to server handlers.

### Development Tools & Productivity

- [Tool Definition Frameworks](https://awesome-repositories.com/f/development-tools-productivity/ai-agent-development-tools/tool-definition-frameworks.md) — Provides a framework for creating executable functions and schemas that allow AI models to perform tasks.
- [Dynamic Resource Templates](https://awesome-repositories.com/f/development-tools-productivity/identifier-generators/uri-resource-identifiers/dynamic-resource-templates.md) — Maps URI templates to internal data handlers for providing dynamic context to AI models.

### Networking & Communication

- [AI Client-Server Communication Protocols](https://awesome-repositories.com/f/networking-communication/ai-client-server-communication-protocols.md) — Establishes bidirectional data streams between AI clients and servers using standard protocol interfaces.
- [Model Context Protocols](https://awesome-repositories.com/f/networking-communication/communication-protocols-architectures/communication-protocols-standards/integration-protocols/model-context-protocols.md) — Standardizes communication and version negotiation between AI models and tool-providing servers. ([source](https://modelcontextprotocol.github.io/java-sdk/))
- [AI Tool Servers](https://awesome-repositories.com/f/networking-communication/tcp-protocol-implementations/custom-protocol-servers/ai-tool-servers.md) — Provides a framework for hosting servers that expose custom tools and resources to AI models via a standardized protocol.
- [Data Streaming](https://awesome-repositories.com/f/networking-communication/data-streaming.md) — Implements non-blocking pipelines for bidirectional data streaming and concurrent request handling. ([source](https://cdn.jsdelivr.net/gh/modelcontextprotocol/java-sdk@main/README.md))
- [JSON-RPC Implementations](https://awesome-repositories.com/f/networking-communication/json-rpc-implementations.md) — Uses the JSON-RPC protocol for structured request-response messaging to coordinate tool and resource access.
- [Protocol-Agnostic Transport Layers](https://awesome-repositories.com/f/networking-communication/protocol-agnostic-transport-layers.md) — Implements a transport-agnostic layer supporting bidirectional communication over STDIO, HTTP, and Server-Sent Events.

### Web Development

- [Context Data Resources](https://awesome-repositories.com/f/web-development/static-file-servers/on-demand-source-serving/context-data-resources.md) — Retrieves structured, URI-addressable data from server-side sources to provide context for AI interactions. ([source](https://java.sdk.modelcontextprotocol.io/latest/client/))

### Part of an Awesome List

- [Asynchronous Protocol Streams](https://awesome-repositories.com/f/awesome-lists/devtools/websockets-and-real-time/bidirectional-agent-streams/asynchronous-protocol-streams.md) — Employs asynchronous pipelines to handle concurrent requests and real-time data flow.
- [Artificial Intelligence](https://awesome-repositories.com/f/awesome-lists/ai/artificial-intelligence.md) — Standardized interface for interacting with AI models and tools.

### Operating Systems & Systems Programming

- [Protocol-Transport Decoupling Layers](https://awesome-repositories.com/f/operating-systems-systems-programming/transport-abstraction-layers/multi-protocol-i-o-abstraction-layers/protocol-transport-decoupling-layers.md) — Decouples protocol logic from the underlying communication layer to support multiple transport types.

### Security & Cryptography

- [API Access Restrictions](https://awesome-repositories.com/f/security-cryptography/domain-access-restrictions/request-access-restrictions/api-access-restrictions.md) — Applies pluggable authorization hooks to restrict API endpoint access to authenticated clients. ([source](https://cdn.jsdelivr.net/gh/modelcontextprotocol/java-sdk@main/README.md))
- [Filesystem Access Boundaries](https://awesome-repositories.com/f/security-cryptography/identity-access-management/access-control/data-resource-permissions/filesystem-access-boundaries.md) — Defines and updates the directory and file boundaries that the AI server is permitted to access. ([source](https://java.sdk.modelcontextprotocol.io/latest/client/))
- [Transport Layer Security](https://awesome-repositories.com/f/security-cryptography/transport-layer-security.md) — Protects communication channels against DNS rebinding through header validation and transport-layer authorization hooks. ([source](https://modelcontextprotocol.github.io/java-sdk/))
