You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+12-11Lines changed: 12 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,9 +20,9 @@ For comprehensive guides and SDK API documentation
20
20
-[Java MCP Server](https://modelcontextprotocol.github.io/java-sdk/server/) - Learn how to implement and configure a MCP servers.
21
21
22
22
#### Spring AI MCP documentation
23
-
[Spring AI MCP](https://docs.spring.io/spring-ai/reference/api/mcp/mcp-overview.html) extends the MCP Java SDK with Spring Boot integration, providing both [client](https://docs.spring.io/spring-ai/reference/api/mcp/mcp-client-boot-starter-docs.html) and [server](https://docs.spring.io/spring-ai/reference/api/mcp/mcp-server-boot-starter-docs.html) starters.
24
-
The [MCP Annotations](https://docs.spring.io/spring-ai/reference/api/mcp/mcp-annotations-overview.html) - provides annotation-based method handling for MCP servers and clients in Java.
25
-
The [MCP Security](https://docs.spring.io/spring-ai/reference/api/mcp/mcp-security.html) - provides comprehensive OAuth 2.0 and API key-based security support for Model Context Protocol implementations in Spring AI.
23
+
[Spring AI MCP](https://docs.spring.io/spring-ai/reference/2.0-SNAPSHOT/api/mcp/mcp-overview.html) extends the MCP Java SDK with Spring Boot integration, providing both [client](https://docs.spring.io/spring-ai/reference/2.0-SNAPSHOT/api/mcp/mcp-client-boot-starter-docs.html) and [server](https://docs.spring.io/spring-ai/reference/2.0-SNAPSHOT/api/mcp/mcp-server-boot-starter-docs.html) starters.
24
+
The [MCP Annotations](https://docs.spring.io/spring-ai/reference/2.0-SNAPSHOT/api/mcp/mcp-annotations-overview.html) - provides annotation-based method handling for MCP servers and clients in Java.
25
+
The [MCP Security](https://docs.spring.io/spring-ai/reference/2.0-SNAPSHOT/api/mcp/mcp-security.html) - provides comprehensive OAuth 2.0 and API key-based security support for Model Context Protocol implementations in Spring AI.
26
26
Bootstrap your AI applications with MCP support using [Spring Initializer](https://start.spring.io).
27
27
28
28
## Development
@@ -139,21 +139,21 @@ MCP supports both clients (applications consuming MCP servers) and servers (appl
139
139
140
140
#### Client Transport in the SDK
141
141
142
-
***SDK Choice**: JDK HttpClient (Java 11+) as the default client, with optional Spring WebClient support
142
+
***SDK Choice**: JDK HttpClient (Java 11+) as the default client
143
143
144
-
***Why**: The JDK HttpClient is built-in, portable, and supports streaming responses. This keeps the default lightweight with no extra dependencies. Spring WebClient support is available for Spring-based projects.
144
+
***Why**: The JDK HttpClient is built-in, portable, and supports streaming responses. This keeps the default lightweight with no extra dependencies.
145
145
146
-
***How we expose it**: MCP Client APIs are transport-agnostic. The core module ships with JDK HttpClient transport. A Spring module provides WebClient integration.
146
+
***How we expose it**: MCP Client APIs are transport-agnostic. The core module ships with JDK HttpClient transport. Spring WebClient-based transport is available in [Spring AI](https://docs.spring.io/spring-ai/reference/2.0-SNAPSHOT/api/mcp/mcp-overview.html) 2.0+.
147
147
148
148
***How it fits the SDK**: This ensures all applications can talk to MCP servers out of the box, while allowing richer integration in Spring and other environments.
149
149
150
150
#### Server Transport in the SDK
151
151
152
-
***SDK Choice**: Jakarta Servlet implementation in core, with optional Spring WebFlux and Spring WebMVC providers
152
+
***SDK Choice**: Jakarta Servlet implementation in core
153
153
154
-
***Why**: Servlet is the most widely deployed Java server API. WebFlux and WebMVC cover a significant part of the Spring community. Together these provide reach across blocking and non-blocking models.
154
+
***Why**: Servlet is the most widely deployed Java server API, providing broad reach across blocking and non-blocking models without additional dependencies.
155
155
156
-
***How we expose it**: Server APIs are transport-agnostic. Core includes Servlet support. Spring modules extend support for WebFlux and WebMVC.
156
+
***How we expose it**: Server APIs are transport-agnostic. Core includes Servlet support. Spring WebFlux and WebMVC server transports are available in [Spring AI](https://docs.spring.io/spring-ai/reference/2.0-SNAPSHOT/api/mcp/mcp-overview.html) 2.0+.
157
157
158
158
***How it fits the SDK**: This allows developers to expose MCP servers in the most common Java environments today, while enabling other transport implementations such as Netty, Vert.x, or Helidon.
159
159
@@ -176,9 +176,10 @@ The SDK is organized into modules to separate concerns and allow adopters to bri
176
176
*`mcp-json-jackson3` – Jackson 3 implementation of JSON binding
177
177
*`mcp` – Convenience bundle (core + Jackson 3)
178
178
*`mcp-test` – Shared testing utilities
179
-
*`mcp-spring` – Spring integrations (WebClient, WebFlux, WebMVC)
180
179
181
-
For example, a minimal adopter may depend only on `mcp` (core + Jackson), while a Spring-based application can use `mcp-spring` for deeper framework integration.
180
+
Spring integrations (WebClient, WebFlux, WebMVC) are now part of [Spring AI](https://docs.spring.io/spring-ai/reference/2.0-SNAPSHOT/api/mcp/mcp-overview.html) 2.0+ (group `org.springframework.ai`).
181
+
182
+
For example, a minimal adopter may depend only on `mcp` (core + Jackson), while a Spring-based application can use the Spring AI `mcp-spring-webflux` or `mcp-spring-webmvc` artifacts for deeper framework integration.
182
183
183
184
Additionally, `mcp-test` contains integration tests for `mcp-core`.
184
185
`mcp-core` needs a JSON implementation to run full integration tests.
Thank you for helping us keep the SDKs and systems they interact with secure.
3
+
Thank you for helping keep the Model Context Protocol and its ecosystem secure.
4
4
5
5
## Reporting Security Issues
6
6
7
-
This SDK is maintained by [Anthropic](https://www.anthropic.com/) as part of the Model
8
-
Context Protocol project.
7
+
If you discover a security vulnerability in this repository, please report it through
8
+
the [GitHub Security Advisory process](https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing-information-about-vulnerabilities/privately-reporting-a-security-vulnerability)
9
+
for this repository.
9
10
10
-
The security of our systems and user data is Anthropic’s top priority. We appreciate the
11
-
work of security researchers acting in good faith in identifying and reporting potential
12
-
vulnerabilities.
11
+
Please **do not** report security vulnerabilities through public GitHub issues, discussions,
12
+
or pull requests.
13
13
14
-
Our security program is managed on HackerOne and we ask that any validated vulnerability
Copy file name to clipboardExpand all lines: docs/client.md
+34-19Lines changed: 34 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,8 @@ The MCP Client is a key component in the Model Context Protocol (MCP) architectu
19
19
!!! tip
20
20
The core `io.modelcontextprotocol.sdk:mcp` module provides STDIO, SSE, and Streamable HTTP client transport implementations without requiring external web frameworks.
21
21
22
-
Spring-specific transport implementations are available as an **optional** dependency `io.modelcontextprotocol.sdk:mcp-spring-webflux` for [Spring Framework](https://docs.spring.io/spring-ai/reference/api/mcp/mcp-client-boot-starter-docs.html) users.
22
+
The Spring-specific WebFlux transport (`mcp-spring-webflux`) is now part of [Spring AI](https://docs.spring.io/spring-ai/reference/2.0-SNAPSHOT/api/mcp/mcp-overview.html) 2.0+ (group `org.springframework.ai`) and is no longer shipped by this SDK.
23
+
See the [MCP Client Boot Starter](https://docs.spring.io/spring-ai/reference/2.0-SNAPSHOT/api/mcp/mcp-client-boot-starter-docs.html) documentation for Spring-based client setup.
23
24
24
25
The client provides both synchronous and asynchronous APIs for flexibility in different application contexts.
25
26
@@ -135,26 +136,20 @@ The client provides both synchronous and asynchronous APIs for flexibility in di
135
136
136
137
The transport layer handles the communication between MCP clients and servers, providing different implementations for various use cases. The client transport manages message serialization, connection establishment, and protocol-specific communication patterns.
137
138
138
-
=== "STDIO"
139
+
### STDIO
139
140
140
-
Creates transport for process-based communication using stdin/stdout:
141
+
Creates transport for process-based communication using stdin/stdout:
Copy file name to clipboardExpand all lines: docs/index.md
+5-52Lines changed: 5 additions & 52 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
---
2
-
title: Overview
2
+
title: Index
3
3
description: Introduction to the Model Context Protocol (MCP) Java SDK
4
4
---
5
5
@@ -27,7 +27,7 @@ enables standardized integration between AI models and tools.
27
27
- Java HttpClient-based SSE client transport for HTTP SSE Client-side streaming
28
28
- Servlet-based SSE server transport for HTTP SSE Server streaming
29
29
- [Streamable HTTP](https://modelcontextprotocol.io/specification/2025-11-25/basic/transports#streamable-http) transport for efficient bidirectional communication (client and server)
30
-
- Optional Spring-based transports (convenience if using Spring Framework):
30
+
- Optional Spring-based transports (available in [Spring AI](https://docs.spring.io/spring-ai/reference/2.0-SNAPSHOT/api/mcp/mcp-overview.html) 2.0+, no longer part of this SDK):
31
31
- WebFlux SSE client and server transports for reactive HTTP streaming
32
32
- WebFlux Streamable HTTP server transport
33
33
- WebMVC SSE server transport for servlet-based HTTP streaming
@@ -41,56 +41,9 @@ enables standardized integration between AI models and tools.
41
41
!!! tip
42
42
The core `io.modelcontextprotocol.sdk:mcp` module provides default STDIO, SSE, and Streamable HTTP client and server transport implementations without requiring external web frameworks.
43
43
44
-
Spring-specific transports are available as optional dependencies for convenience when using the [MCP Client Boot Starter](https://docs.spring.io/spring-ai/reference/api/mcp/mcp-client-boot-starter-docs.html) and [MCP Server Boot Starter](https://docs.spring.io/spring-ai/reference/api/mcp/mcp-server-boot-starter-docs.html).
45
-
Also consider the [MCP Annotations](https://docs.spring.io/spring-ai/reference/api/mcp/mcp-annotations-overview.html) and [MCP Security](https://docs.spring.io/spring-ai/reference/api/mcp/mcp-security.html).
46
-
47
-
## Architecture
48
-
49
-
The SDK follows a layered architecture with clear separation of concerns:
50
-
51
-

52
-
53
-
-**Client/Server Layer (McpClient/McpServer)**: Both use McpSession for sync/async operations,
54
-
with McpClient handling client-side protocol operations and McpServer managing server-side protocol operations.
55
-
-**Session Layer (McpSession)**: Manages communication patterns and state.
- StdioTransport (stdin/stdout) in the core module
58
-
- HTTP SSE transports in dedicated transport modules (Java HttpClient, Spring WebFlux, Spring WebMVC)
59
-
- Streamable HTTP transports for efficient bidirectional communication
60
-
61
-
The MCP Client is a key component in the Model Context Protocol (MCP) architecture, responsible for establishing and managing connections with MCP servers.
The MCP Server is a foundational component in the Model Context Protocol (MCP) architecture that provides tools, resources, and capabilities to clients.
67
-
It implements the server-side of the protocol.
68
-
69
-

70
-
71
-
Key Interactions:
72
-
73
-
-**Client/Server Initialization**: Transport setup, protocol compatibility check, capability negotiation, and implementation details exchange.
74
-
-**Message Flow**: JSON-RPC message handling with validation, type-safe response processing, and error handling.
75
-
-**Resource Management**: Resource discovery, URI template-based access, subscription system, and content retrieval.
76
-
77
-
## Module Structure
78
-
79
-
The SDK is organized into modules to separate concerns and allow adopters to bring in only what they need:
80
-
81
-
| Module | Artifact ID | Purpose |
82
-
|--------|------------|---------|
83
-
|`mcp-bom`|`mcp-bom`| Bill of Materials for dependency management |
|`mcp-test`|`mcp-test`| Shared testing utilities and integration tests |
89
-
|`mcp-spring-webflux`|`mcp-spring-webflux`| Spring WebFlux integration (SSE and Streamable HTTP) |
90
-
|`mcp-spring-webmvc`|`mcp-spring-webmvc`| Spring WebMVC integration (SSE and Streamable HTTP) |
91
-
92
-
!!! tip
93
-
A minimal adopter may depend only on `mcp` (core + Jackson 3), while a Spring-based application can add `mcp-spring-webflux` or `mcp-spring-webmvc` for deeper framework integration.
44
+
Spring-specific transports (WebFlux, WebMVC) are now part of [Spring AI](https://docs.spring.io/spring-ai/reference/2.0-SNAPSHOT/api/mcp/mcp-overview.html) 2.0+ and are no longer shipped by this SDK.
45
+
Use the [MCP Client Boot Starter](https://docs.spring.io/spring-ai/reference/2.0-SNAPSHOT/api/mcp/mcp-client-boot-starter-docs.html) and [MCP Server Boot Starter](https://docs.spring.io/spring-ai/reference/2.0-SNAPSHOT/api/mcp/mcp-server-boot-starter-docs.html) from Spring AI.
46
+
Also consider the [MCP Annotations](https://docs.spring.io/spring-ai/reference/2.0-SNAPSHOT/api/mcp/mcp-annotations-overview.html) and [MCP Security](https://docs.spring.io/spring-ai/reference/2.0-SNAPSHOT/api/mcp/mcp-security.html).
0 commit comments