docs(java): clarify core vs optional transport implementations

- Emphasize that core mcp module includes default STDIO and SSE transport implementations
- Clarify that default implementations don't require external web frameworks
- Mark Spring-specific transport implementations as optional dependencies

Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
This commit is contained in:
Christian Tzolov 2025-03-30 10:06:19 +02:00 • committed by Christian Tzolov
commit dc8cbf6431
3 changed files with 28 additions and 20 deletions

View file

@ -16,8 +16,9 @@ The MCP Client is a key component in the Model Context Protocol (MCP) architectu
- Optional features like roots management and sampling support - Optional features like roots management and sampling support
<Tip> <Tip>
The [Spring-AI MCP Client](https://docs.spring.io/spring-ai/reference/api/mcp/mcp-client-boot-starter-docs.html) integration extends the MCP Java SDK to The core `io.modelcontextprotocol.sdk:mcp` module provides STDIO and SSE client transport implementations without requiring external web frameworks.
provide auto-configuration for MCP client functionality in Spring Boot applications and integrating with Spring AI’s [tool execution framework](https://docs.spring.io/spring-ai/reference/api/tools.html).
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.
</Tip> </Tip>
The client provides both synchronous and asynchronous APIs for flexibility in different application contexts. The client provides both synchronous and asynchronous APIs for flexibility in different application contexts.

View file

@ -22,18 +22,20 @@ If you're upgrading from 0.7.0, please refer to the [Migration Guide](https://gi
- [Prompt](https://spec.modelcontextprotocol.io/specification/2024-11-05/server/prompts/) handling and management - [Prompt](https://spec.modelcontextprotocol.io/specification/2024-11-05/server/prompts/) handling and management
- [Sampling](https://spec.modelcontextprotocol.io/specification/2024-11-05/client/sampling/) support for AI model interactions - [Sampling](https://spec.modelcontextprotocol.io/specification/2024-11-05/client/sampling/) support for AI model interactions
- Multiple transport implementations: - Multiple transport implementations:
- Default transports: - Default transports (included in core `mcp` module, no external web frameworks required):
- Stdio-based transport for process-based communication - Stdio-based transport for process-based communication
- Java HttpClient-based SSE client transport for HTTP SSE Client-side streaming - Java HttpClient-based SSE client transport for HTTP SSE Client-side streaming
- Servlet-based SSE server transport for HTTP SSE Server streaming - Servlet-based SSE server transport for HTTP SSE Server streaming
- Spring-based transports: - Optional Spring-based transports (convenience if using Spring Framework):
- WebFlux SSE client and server transports for reactive HTTP streaming - WebFlux SSE client and server transports for reactive HTTP streaming
- WebMVC SSE transport for servlet-based HTTP streaming - WebMVC SSE transport for servlet-based HTTP streaming
- Supports Synchronous and Asynchronous programming paradigms - Supports Synchronous and Asynchronous programming paradigms
<Tip>[Spring AI MCP](https://docs.spring.io/spring-ai/reference/api/mcp/mcp-overview.html) extends the MCP Java SDK with Spring Boot integration, <Tip>
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) Boot Starters. The core `io.modelcontextprotocol.sdk:mcp` module provides default STDIO and SSE client and server transport implementations without requiring external web frameworks.
You can bootstrap your AI Spring applications using the [Spring Initializer](https://start.spring.io/).</Tip>
Spring-specific transports are available as optional dependencies for convenience when using the [Spring Framework](https://docs.spring.io/spring-ai/reference/api/mcp/mcp-client-boot-starter-docs.html).
</Tip>
## Architecture ## Architecture
@ -80,16 +82,18 @@ The core MCP functionality:
</dependency> </dependency>
``` ```
For HTTP SSE transport implementations, add one of the following dependencies: The core `mcp` module already includes default STDIO and SSE transport implementations and doesn't require external web frameworks.
If you're using the Spring Framework and want to use Spring-specific transport implementations, add one of the following optional dependencies:
```xml ```xml
<!-- Spring WebFlux-based SSE client and server transport --> <!-- Optional: Spring WebFlux-based SSE client and server transport -->
<dependency> <dependency>
<groupId>io.modelcontextprotocol.sdk</groupId> <groupId>io.modelcontextprotocol.sdk</groupId>
<artifactId>mcp-spring-webflux</artifactId> <artifactId>mcp-spring-webflux</artifactId>
</dependency> </dependency>
<!-- Spring WebMVC-based SSE server transport --> <!-- Optional: Spring WebMVC-based SSE server transport -->
<dependency> <dependency>
<groupId>io.modelcontextprotocol.sdk</groupId> <groupId>io.modelcontextprotocol.sdk</groupId>
<artifactId>mcp-spring-webmvc</artifactId> <artifactId>mcp-spring-webmvc</artifactId>
@ -106,15 +110,17 @@ For HTTP SSE transport implementations, add one of the following dependencies:
} }
``` ```
For HTTP SSE transport implementations, add one of the following dependencies: The core `mcp` module already includes default STDIO and SSE transport implementations and doesn't require external web frameworks.
If you're using the Spring Framework and want to use Spring-specific transport implementations, add one of the following optional dependencies:
```groovy ```groovy
// Spring WebFlux-based SSE client and server transport // Optional: Spring WebFlux-based SSE client and server transport
dependencies { dependencies {
implementation platform("io.modelcontextprotocol.sdk:mcp-spring-webflux") implementation platform("io.modelcontextprotocol.sdk:mcp-spring-webflux")
} }
// Spring WebMVC-based SSE server transport // Optional: Spring WebMVC-based SSE server transport
dependencies { dependencies {
implementation platform("io.modelcontextprotocol.sdk:mcp-spring-webmvc") implementation platform("io.modelcontextprotocol.sdk:mcp-spring-webmvc")
} }
@ -169,10 +175,9 @@ Replace the version number with the version of the BOM you want to use.
The following dependencies are available and managed by the BOM: The following dependencies are available and managed by the BOM:
- Core Dependencies - Core Dependencies
- `io.modelcontextprotocol.sdk:mcp` - Core MCP library providing the base functionality and APIs for Model Context Protocol implementation. - `io.modelcontextprotocol.sdk:mcp` - Core MCP library providing the base functionality and APIs for Model Context Protocol implementation, including default STDIO and SSE client and server transport implementations. No external web frameworks required.
- Transport Dependencies - Optional Transport Dependencies (convenience if using Spring Framework)
- `io.modelcontextprotocol.sdk:mcp-spring-webflux` - WebFlux-based Server-Sent Events (SSE) transport implementation for reactive applications. - `io.modelcontextprotocol.sdk:mcp-spring-webflux` - WebFlux-based Server-Sent Events (SSE) transport implementation for reactive applications.
- `io.modelcontextprotocol.sdk:mcp-spring-webmvc` - WebMVC-based Server-Sent Events (SSE) transport implementation for servlet-based applications. - `io.modelcontextprotocol.sdk:mcp-spring-webmvc` - WebMVC-based Server-Sent Events (SSE) transport implementation for servlet-based applications.
- Testing Dependencies - Testing Dependencies
- `io.modelcontextprotocol.sdk:mcp-test` - Testing utilities and support for MCP-based applications. - `io.modelcontextprotocol.sdk:mcp-test` - Testing utilities and support for MCP-based applications.

View file

@ -22,10 +22,12 @@ The MCP Server is a foundational component in the Model Context Protocol (MCP) a
- Providing structured logging and notifications - Providing structured logging and notifications
<Tip> <Tip>
The [Spring-AI MCP Server](https://docs.spring.io/spring-ai/reference/api/mcp/mcp-server-boot-starter-docs.html) integration extends the MCP Java SDK to The core `io.modelcontextprotocol.sdk:mcp` module provides STDIO and SSE server transport implementations without requiring external web frameworks.
provide auto-configuration for MCP server functionality in Spring Boot applications.
Spring-specific transport implementations are available as an **optional** dependencies `io.modelcontextprotocol.sdk:mcp-spring-webflux`, `io.modelcontextprotocol.sdk:mcp-spring-webmvc` for [Spring Framework](https://docs.spring.io/spring-ai/reference/api/mcp/mcp-client-boot-starter-docs.html) users.
</Tip> </Tip>
The server supports both synchronous and asynchronous APIs, allowing for flexible integration in different application contexts. The server supports both synchronous and asynchronous APIs, allowing for flexible integration in different application contexts.
<Tabs> <Tabs>