Introduction to the Model Context Protocol (MCP) Java SDK
mcp
module, no external web frameworks required):
SSE
and Streamable-HTTP
client transportSSE
and Streamable-HTTP
server transportSSE
and Streamable-HTTP
client and server transportsSSE
and Streamable-HTTP
transport for servlet-based HTTP streamingio.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 Spring AI Framework.SSE
& Streamable-HTTP
transports in dedicated transport modules (Java HttpClient, Spring WebFlux, Spring WebMVC)mcp
module already includes default STDIO
, SSE
and Streamable-HTTP
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:io.modelcontextprotocol.sdk:mcp-spring-webflux
- WebFlux-based Client and Server, SSE
and Streamable-HTTP
transport implementations.
The WebFlux implementation can be used in reactive applications while the WebClient-based MCP Client can be used in both reactive and imperative applications.
It is a highly scalable option and suitable and recommended for high-throughput scenarios.io.modelcontextprotocol.sdk:mcp-spring-webmvc
- WebMVC-based Server, SSE
and Streamable-HTTP
transport implementation for servlet-based applications.io.modelcontextprotocol.sdk:mcp-test
- Testing utilities and support for MCP-based applications.