Skip to content

Commit 9357ae4

Browse files
committed
Move mcp-spring-webflux and mcp-spring-webmvc to Spring AI 2.0
The Spring-specific transport modules (mcp-spring-webflux, mcp-spring-webmvc) have been moved out of the MCP Java SDK into the Spring AI project (org.springframework.ai group), effective with MCP Java SDK 1.0 and Spring AI 2.0. This is a breaking change. - Delete mcp-spring-webflux and mcp-spring-webmvc source modules - Remove both artifacts from mcp-bom and root pom.xml module list - Update docs and README - Add blog post explaining the breaking change with before/after migration examples Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
1 parent 159eb96 commit 9357ae4

File tree

56 files changed

+119
-9157
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+119
-9157
lines changed

README.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -139,21 +139,21 @@ MCP supports both clients (applications consuming MCP servers) and servers (appl
139139

140140
#### Client Transport in the SDK
141141

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
143143

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.
145145

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/api/mcp/mcp-overview.html) 2.0+.
147147

148148
* **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.
149149

150150
#### Server Transport in the SDK
151151

152-
* **SDK Choice**: Jakarta Servlet implementation in core, with optional Spring WebFlux and Spring WebMVC providers
152+
* **SDK Choice**: Jakarta Servlet implementation in core
153153

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.
155155

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/api/mcp/mcp-overview.html) 2.0+.
157157

158158
* **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.
159159

@@ -176,9 +176,10 @@ The SDK is organized into modules to separate concerns and allow adopters to bri
176176
* `mcp-json-jackson3` – Jackson 3 implementation of JSON binding
177177
* `mcp` – Convenience bundle (core + Jackson 3)
178178
* `mcp-test` – Shared testing utilities
179-
* `mcp-spring` – Spring integrations (WebClient, WebFlux, WebMVC)
180179

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/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.
182183

183184
Additionally, `mcp-test` contains integration tests for `mcp-core`.
184185
`mcp-core` needs a JSON implementation to run full integration tests.
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
---
2+
date: 2026-02-20
3+
authors:
4+
- mcp-team
5+
categories:
6+
- Release
7+
- Migration
8+
---
9+
10+
# Spring Transports Move to Spring AI 2.0
11+
12+
Starting with **MCP Java SDK 1.0** and **Spring AI 2.0**, the Spring-specific transport modules (`mcp-spring-webflux` and `mcp-spring-webmvc`) are no longer part of this SDK. They now live in the Spring AI project under the `org.springframework.ai` group.
13+
14+
<!-- more -->
15+
16+
## What Changed
17+
18+
The `mcp-spring-webflux` and `mcp-spring-webmvc` artifacts have moved from:
19+
20+
```xml
21+
<groupId>io.modelcontextprotocol.sdk</groupId>
22+
```
23+
24+
to:
25+
26+
```xml
27+
<groupId>org.springframework.ai</groupId>
28+
```
29+
30+
The class names are unchanged, but the Java packages have moved from `io.modelcontextprotocol.server.transport` / `io.modelcontextprotocol.client.transport` to `org.springframework.ai.mcp.server.webflux.transport`, `org.springframework.ai.mcp.server.webmvc.transport`, and `org.springframework.ai.mcp.client.webflux.transport`.
31+
32+
## Who Is Affected
33+
34+
- **Spring Boot users via auto-configuration**: update your `pom.xml` / `build.gradle` coordinates only — no Java code changes needed.
35+
- **Direct users of transport classes**: update both the Maven/Gradle coordinates and the import statements in your code.
36+
37+
## What to Do
38+
39+
**1. Update your dependency coordinates:**
40+
41+
```xml
42+
<!-- Before -->
43+
<dependency>
44+
<groupId>io.modelcontextprotocol.sdk</groupId>
45+
<artifactId>mcp-spring-webflux</artifactId>
46+
</dependency>
47+
48+
<!-- After -->
49+
<dependency>
50+
<groupId>org.springframework.ai</groupId>
51+
<artifactId>mcp-spring-webflux</artifactId>
52+
</dependency>
53+
```
54+
55+
**2. Update imports (if you reference transport classes directly):**
56+
57+
```java
58+
// Before
59+
import io.modelcontextprotocol.server.transport.WebFluxSseServerTransportProvider;
60+
import io.modelcontextprotocol.client.transport.WebFluxSseClientTransport;
61+
62+
// After
63+
import org.springframework.ai.mcp.server.webflux.transport.WebFluxSseServerTransportProvider;
64+
import org.springframework.ai.mcp.client.webflux.transport.WebFluxSseClientTransport;
65+
```
66+
67+
The core `io.modelcontextprotocol.sdk:mcp` module is unaffected and continues to provide STDIO, SSE, and Streamable HTTP transports without any Spring dependency.
68+
69+
For the full list of moved classes and Spring AI starter options, see the [Spring AI MCP documentation](https://docs.spring.io/spring-ai/reference/api/mcp/mcp-overview.html).

docs/client.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ The MCP Client is a key component in the Model Context Protocol (MCP) architectu
1919
!!! tip
2020
The core `io.modelcontextprotocol.sdk:mcp` module provides STDIO, SSE, and Streamable HTTP client transport implementations without requiring external web frameworks.
2121

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/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/api/mcp/mcp-client-boot-starter-docs.html) documentation for Spring-based client setup.
2324

2425
The client provides both synchronous and asynchronous APIs for flexibility in different application contexts.
2526

@@ -174,7 +175,7 @@ The transport layer handles the communication between MCP clients and servers, p
174175

175176
=== "SSE (WebFlux)"
176177

177-
Creates WebFlux-based SSE client transport. Requires the `mcp-spring-webflux` dependency:
178+
Creates WebFlux-based SSE client transport. Requires the `mcp-spring-webflux` dependency from [Spring AI](https://docs.spring.io/spring-ai/reference/api/mcp/mcp-overview.html) 2.0+ (group `org.springframework.ai`):
178179

179180
```java
180181
WebClient.Builder webClientBuilder = WebClient.builder()

docs/index.md

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ enables standardized integration between AI models and tools.
2727
- Java HttpClient-based SSE client transport for HTTP SSE Client-side streaming
2828
- Servlet-based SSE server transport for HTTP SSE Server streaming
2929
- [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/api/mcp/mcp-overview.html) 2.0+, no longer part of this SDK):
3131
- WebFlux SSE client and server transports for reactive HTTP streaming
3232
- WebFlux Streamable HTTP server transport
3333
- WebMVC SSE server transport for servlet-based HTTP streaming
@@ -41,7 +41,8 @@ enables standardized integration between AI models and tools.
4141
!!! tip
4242
The core `io.modelcontextprotocol.sdk:mcp` module provides default STDIO, SSE, and Streamable HTTP client and server transport implementations without requiring external web frameworks.
4343

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).
44+
Spring-specific transports (WebFlux, WebMVC) are now part of [Spring AI](https://docs.spring.io/spring-ai/reference/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/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) from Spring AI.
4546
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).
4647

4748
## Architecture
@@ -55,8 +56,9 @@ The SDK follows a layered architecture with clear separation of concerns:
5556
- **Session Layer (McpSession)**: Manages communication patterns and state.
5657
- **Transport Layer (McpTransport)**: Handles JSON-RPC message serialization/deserialization via:
5758
- StdioTransport (stdin/stdout) in the core module
58-
- HTTP SSE transports in dedicated transport modules (Java HttpClient, Spring WebFlux, Spring WebMVC)
59+
- HTTP SSE transports in dedicated transport modules (Java HttpClient, Servlet)
5960
- Streamable HTTP transports for efficient bidirectional communication
61+
- Spring WebFlux and Spring WebMVC transports (available in [Spring AI](https://docs.spring.io/spring-ai/reference/api/mcp/mcp-overview.html) 2.0+)
6062

6163
The MCP Client is a key component in the Model Context Protocol (MCP) architecture, responsible for establishing and managing connections with MCP servers.
6264
It implements the client-side of the protocol.
@@ -78,19 +80,19 @@ Key Interactions:
7880

7981
The SDK is organized into modules to separate concerns and allow adopters to bring in only what they need:
8082

81-
| Module | Artifact ID | Purpose |
82-
|--------|------------|---------|
83-
| `mcp-bom` | `mcp-bom` | Bill of Materials for dependency management |
84-
| `mcp-core` | `mcp-core` | Core reference implementation (STDIO, JDK HttpClient, Servlet, Streamable HTTP) |
85-
| `mcp-json-jackson2` | `mcp-json-jackson2` | Jackson 2.x JSON serialization implementation |
86-
| `mcp-json-jackson3` | `mcp-json-jackson3` | Jackson 3.x JSON serialization implementation |
87-
| `mcp` | `mcp` | Convenience bundle (`mcp-core` + `mcp-json-jackson3`) |
88-
| `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) |
83+
| Module | Artifact ID | Group | Purpose |
84+
|--------|------------|-------|---------|
85+
| `mcp-bom` | `mcp-bom` | `io.modelcontextprotocol.sdk` | Bill of Materials for dependency management |
86+
| `mcp-core` | `mcp-core` | `io.modelcontextprotocol.sdk` | Core reference implementation (STDIO, JDK HttpClient, Servlet, Streamable HTTP) |
87+
| `mcp-json-jackson2` | `mcp-json-jackson2` | `io.modelcontextprotocol.sdk` | Jackson 2.x JSON serialization implementation |
88+
| `mcp-json-jackson3` | `mcp-json-jackson3` | `io.modelcontextprotocol.sdk` | Jackson 3.x JSON serialization implementation |
89+
| `mcp` | `mcp` | `io.modelcontextprotocol.sdk` | Convenience bundle (`mcp-core` + `mcp-json-jackson3`) |
90+
| `mcp-test` | `mcp-test` | `io.modelcontextprotocol.sdk` | Shared testing utilities and integration tests |
91+
| `mcp-spring-webflux` _(external)_ | `mcp-spring-webflux` | `org.springframework.ai` | Spring WebFlux integration — part of [Spring AI](https://docs.spring.io/spring-ai/reference/api/mcp/mcp-overview.html) 2.0+ |
92+
| `mcp-spring-webmvc` _(external)_ | `mcp-spring-webmvc` | `org.springframework.ai` | Spring WebMVC integration — part of [Spring AI](https://docs.spring.io/spring-ai/reference/api/mcp/mcp-overview.html) 2.0+ |
9193

9294
!!! 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.
95+
A minimal adopter may depend only on `mcp` (core + Jackson 3). Spring-based applications should use the `mcp-spring-webflux` or `mcp-spring-webmvc` artifacts from [Spring AI](https://docs.spring.io/spring-ai/reference/api/mcp/mcp-overview.html) 2.0+ (group `org.springframework.ai`), no longer part of this SDK.
9496

9597
## Next Steps
9698

docs/quickstart.md

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -44,22 +44,25 @@ Add the following dependency to your project:
4444
</dependency>
4545
```
4646

47-
If you're using the Spring Framework and want Spring-specific transport implementations, add one of the following optional dependencies:
47+
If you're using Spring Framework, the Spring-specific transport implementations are now part of [Spring AI](https://docs.spring.io/spring-ai/reference/api/mcp/mcp-overview.html) 2.0+ (group `org.springframework.ai`):
4848

4949
```xml
50-
<!-- Optional: Spring WebFlux-based SSE and Streamable HTTP client and server transport -->
50+
<!-- Optional: Spring WebFlux-based SSE and Streamable HTTP client and server transport (Spring AI 2.0+) -->
5151
<dependency>
52-
<groupId>io.modelcontextprotocol.sdk</groupId>
52+
<groupId>org.springframework.ai</groupId>
5353
<artifactId>mcp-spring-webflux</artifactId>
5454
</dependency>
5555

56-
<!-- Optional: Spring WebMVC-based SSE and Streamable HTTP server transport -->
56+
<!-- Optional: Spring WebMVC-based SSE and Streamable HTTP server transport (Spring AI 2.0+) -->
5757
<dependency>
58-
<groupId>io.modelcontextprotocol.sdk</groupId>
58+
<groupId>org.springframework.ai</groupId>
5959
<artifactId>mcp-spring-webmvc</artifactId>
6060
</dependency>
6161
```
6262

63+
!!! note
64+
When using the `spring-ai-bom` or Spring AI starter dependencies (`spring-ai-starter-mcp-server-webflux`, `spring-ai-starter-mcp-server-webmvc`, `spring-ai-starter-mcp-client-webflux`) no explicit version is needed — the BOM manages it automatically.
65+
6366
=== "Gradle"
6467

6568
The convenience `mcp` module bundles `mcp-core` with Jackson 3.x JSON serialization:
@@ -89,17 +92,17 @@ Add the following dependency to your project:
8992
}
9093
```
9194

92-
If you're using the Spring Framework and want Spring-specific transport implementations, add one of the following optional dependencies:
95+
If you're using Spring Framework, the Spring-specific transport implementations are now part of [Spring AI](https://docs.spring.io/spring-ai/reference/api/mcp/mcp-overview.html) 2.0+ (group `org.springframework.ai`):
9396

9497
```groovy
95-
// Optional: Spring WebFlux-based SSE and Streamable HTTP client and server transport
98+
// Optional: Spring WebFlux-based SSE and Streamable HTTP client and server transport (Spring AI 2.0+)
9699
dependencies {
97-
implementation "io.modelcontextprotocol.sdk:mcp-spring-webflux"
100+
implementation "org.springframework.ai:mcp-spring-webflux"
98101
}
99102

100-
// Optional: Spring WebMVC-based SSE and Streamable HTTP server transport
103+
// Optional: Spring WebMVC-based SSE and Streamable HTTP server transport (Spring AI 2.0+)
101104
dependencies {
102-
implementation "io.modelcontextprotocol.sdk:mcp-spring-webmvc"
105+
implementation "org.springframework.ai:mcp-spring-webmvc"
103106
}
104107
```
105108

@@ -153,8 +156,8 @@ The following dependencies are available and managed by the BOM:
153156
- **JSON Serialization**
154157
- `io.modelcontextprotocol.sdk:mcp-json-jackson3` - Jackson 3.x JSON serialization implementation (included in `mcp` bundle).
155158
- `io.modelcontextprotocol.sdk:mcp-json-jackson2` - Jackson 2.x JSON serialization implementation for projects that require Jackson 2.x compatibility.
156-
- **Optional Transport Dependencies** (convenience if using Spring Framework)
157-
- `io.modelcontextprotocol.sdk:mcp-spring-webflux` - WebFlux-based SSE and Streamable HTTP transport implementation for reactive applications.
158-
- `io.modelcontextprotocol.sdk:mcp-spring-webmvc` - WebMVC-based SSE and Streamable HTTP transport implementation for servlet-based applications.
159+
- **Optional Spring Transport Dependencies** (part of [Spring AI](https://docs.spring.io/spring-ai/reference/api/mcp/mcp-overview.html) 2.0+, group `org.springframework.ai`)
160+
- `org.springframework.ai:mcp-spring-webflux` - WebFlux-based SSE and Streamable HTTP transport implementation for reactive applications.
161+
- `org.springframework.ai:mcp-spring-webmvc` - WebMVC-based SSE and Streamable HTTP transport implementation for servlet-based applications.
159162
- **Testing Dependencies**
160163
- `io.modelcontextprotocol.sdk:mcp-test` - Testing utilities and support for MCP-based applications.

0 commit comments

Comments
 (0)