Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,21 +139,21 @@ MCP supports both clients (applications consuming MCP servers) and servers (appl

#### Client Transport in the SDK

* **SDK Choice**: JDK HttpClient (Java 11+) as the default client, with optional Spring WebClient support
* **SDK Choice**: JDK HttpClient (Java 11+) as the default client

* **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.
* **Why**: The JDK HttpClient is built-in, portable, and supports streaming responses. This keeps the default lightweight with no extra dependencies.

* **How we expose it**: MCP Client APIs are transport-agnostic. The core module ships with JDK HttpClient transport. A Spring module provides WebClient integration.
* **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+.

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

#### Server Transport in the SDK

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

* **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.
* **Why**: Servlet is the most widely deployed Java server API, providing broad reach across blocking and non-blocking models without additional dependencies.

* **How we expose it**: Server APIs are transport-agnostic. Core includes Servlet support. Spring modules extend support for WebFlux and WebMVC.
* **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+.

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

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

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.
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`).

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.

Additionally, `mcp-test` contains integration tests for `mcp-core`.
`mcp-core` needs a JSON implementation to run full integration tests.
Expand Down
69 changes: 69 additions & 0 deletions docs/blog/posts/spring-transport-migration.md
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we could rather have a 1.0 blog post and the Spring modules specifics could be a part of that bigger announcement blog post?

Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
---
date: 2026-02-20
authors:
- mcp-team
categories:
- Release
- Migration
---

# Spring Transports Move to Spring AI 2.0

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.

<!-- more -->
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<!-- more -->


## What Changed

The `mcp-spring-webflux` and `mcp-spring-webmvc` artifacts have moved from:

```xml
<groupId>io.modelcontextprotocol.sdk</groupId>
```

to:

```xml
<groupId>org.springframework.ai</groupId>
```

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

## Who Is Affected

- **Spring Boot users via auto-configuration**: update your `pom.xml` / `build.gradle` coordinates only — no Java code changes needed.
- **Direct users of transport classes**: update both the Maven/Gradle coordinates and the import statements in your code.

## What to Do

**1. Update your dependency coordinates:**

```xml
<!-- Before -->
<dependency>
<groupId>io.modelcontextprotocol.sdk</groupId>
<artifactId>mcp-spring-webflux</artifactId>
</dependency>

<!-- After -->
<dependency>
<groupId>org.springframework.ai</groupId>
<artifactId>mcp-spring-webflux</artifactId>
</dependency>
```

**2. Update imports (if you reference transport classes directly):**

```java
// Before
import io.modelcontextprotocol.server.transport.WebFluxSseServerTransportProvider;
import io.modelcontextprotocol.client.transport.WebFluxSseClientTransport;

// After
import org.springframework.ai.mcp.server.webflux.transport.WebFluxSseServerTransportProvider;
import org.springframework.ai.mcp.client.webflux.transport.WebFluxSseClientTransport;
```

The core `io.modelcontextprotocol.sdk:mcp` module is unaffected and continues to provide STDIO, SSE, and Streamable HTTP transports without any Spring dependency.

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).
5 changes: 3 additions & 2 deletions docs/client.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ The MCP Client is a key component in the Model Context Protocol (MCP) architectu
!!! tip
The core `io.modelcontextprotocol.sdk:mcp` module provides STDIO, SSE, and Streamable HTTP client transport implementations without requiring external web frameworks.

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

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

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

=== "SSE (WebFlux)"

Creates WebFlux-based SSE client transport. Requires the `mcp-spring-webflux` dependency:
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`):

```java
WebClient.Builder webClientBuilder = WebClient.builder()
Expand Down
30 changes: 16 additions & 14 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ enables standardized integration between AI models and tools.
- Java HttpClient-based SSE client transport for HTTP SSE Client-side streaming
- Servlet-based SSE server transport for HTTP SSE Server streaming
- [Streamable HTTP](https://modelcontextprotocol.io/specification/2025-11-25/basic/transports#streamable-http) transport for efficient bidirectional communication (client and server)
- Optional Spring-based transports (convenience if using Spring Framework):
- 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):
- WebFlux SSE client and server transports for reactive HTTP streaming
- WebFlux Streamable HTTP server transport
- WebMVC SSE server transport for servlet-based HTTP streaming
Expand All @@ -41,7 +41,8 @@ enables standardized integration between AI models and tools.
!!! tip
The core `io.modelcontextprotocol.sdk:mcp` module provides default STDIO, SSE, and Streamable HTTP client and server transport implementations without requiring external web frameworks.

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

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

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

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

| Module | Artifact ID | Purpose |
|--------|------------|---------|
| `mcp-bom` | `mcp-bom` | Bill of Materials for dependency management |
| `mcp-core` | `mcp-core` | Core reference implementation (STDIO, JDK HttpClient, Servlet, Streamable HTTP) |
| `mcp-json-jackson2` | `mcp-json-jackson2` | Jackson 2.x JSON serialization implementation |
| `mcp-json-jackson3` | `mcp-json-jackson3` | Jackson 3.x JSON serialization implementation |
| `mcp` | `mcp` | Convenience bundle (`mcp-core` + `mcp-json-jackson3`) |
| `mcp-test` | `mcp-test` | Shared testing utilities and integration tests |
| `mcp-spring-webflux` | `mcp-spring-webflux` | Spring WebFlux integration (SSE and Streamable HTTP) |
| `mcp-spring-webmvc` | `mcp-spring-webmvc` | Spring WebMVC integration (SSE and Streamable HTTP) |
| Module | Artifact ID | Group | Purpose |
|--------|------------|-------|---------|
| `mcp-bom` | `mcp-bom` | `io.modelcontextprotocol.sdk` | Bill of Materials for dependency management |
| `mcp-core` | `mcp-core` | `io.modelcontextprotocol.sdk` | Core reference implementation (STDIO, JDK HttpClient, Servlet, Streamable HTTP) |
| `mcp-json-jackson2` | `mcp-json-jackson2` | `io.modelcontextprotocol.sdk` | Jackson 2.x JSON serialization implementation |
| `mcp-json-jackson3` | `mcp-json-jackson3` | `io.modelcontextprotocol.sdk` | Jackson 3.x JSON serialization implementation |
| `mcp` | `mcp` | `io.modelcontextprotocol.sdk` | Convenience bundle (`mcp-core` + `mcp-json-jackson3`) |
| `mcp-test` | `mcp-test` | `io.modelcontextprotocol.sdk` | Shared testing utilities and integration tests |
| `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+ |
| `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+ |

!!! tip
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.
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.

## Next Steps

Expand Down
29 changes: 16 additions & 13 deletions docs/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,22 +44,25 @@ Add the following dependency to your project:
</dependency>
```

If you're using the Spring Framework and want Spring-specific transport implementations, add one of the following optional dependencies:
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`):

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

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

!!! note
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.

=== "Gradle"

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

If you're using the Spring Framework and want Spring-specific transport implementations, add one of the following optional dependencies:
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`):

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

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

Expand Down Expand Up @@ -153,8 +156,8 @@ The following dependencies are available and managed by the BOM:
- **JSON Serialization**
- `io.modelcontextprotocol.sdk:mcp-json-jackson3` - Jackson 3.x JSON serialization implementation (included in `mcp` bundle).
- `io.modelcontextprotocol.sdk:mcp-json-jackson2` - Jackson 2.x JSON serialization implementation for projects that require Jackson 2.x compatibility.
- **Optional Transport Dependencies** (convenience if using Spring Framework)
- `io.modelcontextprotocol.sdk:mcp-spring-webflux` - WebFlux-based SSE and Streamable HTTP transport implementation for reactive applications.
- `io.modelcontextprotocol.sdk:mcp-spring-webmvc` - WebMVC-based SSE and Streamable HTTP transport implementation for servlet-based applications.
- **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`)
- `org.springframework.ai:mcp-spring-webflux` - WebFlux-based SSE and Streamable HTTP transport implementation for reactive applications.
- `org.springframework.ai:mcp-spring-webmvc` - WebMVC-based SSE and Streamable HTTP transport implementation for servlet-based applications.
- **Testing Dependencies**
- `io.modelcontextprotocol.sdk:mcp-test` - Testing utilities and support for MCP-based applications.
Loading