Model Context Protocol (MCP)
The Model Context Protocol (MCP) is a standardized protocol that enables AI models to interact with external tools and resources in a structured way. It supports multiple transport mechanisms to provide flexibility across different environments.
MCP Java SDK
The MCP Java SDK provides a Java implementation of the Model Context Protocol, enabling standardized interaction with AI models and tools through both synchronous and asynchronous communication patterns.
The Java MCP implementation follows a three-layer architecture:
|
MCP Client | |
---|---|
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, handling:
|
![]() |
MCP Server | |
---|---|
The MCP Server is a foundational component in the Model Context Protocol (MCP) architecture that provides tools, resources, and capabilities to clients. It implements the server-side of the protocol, responsible for:
|
![]() |
For detailed implementation guidance, using the low-level MCP Client/Server APIs, refer to the MCP Java SDK documentation. For simplified setup using Spring Boot, use the MCP Boot Starters described below.
Spring AI MCP Integration
Spring AI provides MCP integration through the following Spring Boot starters:
Client Starters
-
spring-ai-mcp-client-spring-boot-starter
- Core starter providing STDIO and HTTP-based SSE support -
spring-ai-mcp-client-webflux-spring-boot-starter
- WebFlux-based SSE transport implementation
Server Starters
-
spring-ai-mcp-server-spring-boot-starter
- Core server with STDIO transport support -
spring-ai-mcp-server-webmvc-spring-boot-starter
- Spring MVC-based SSE transport implementation -
spring-ai-mcp-server-webflux-spring-boot-starter
- WebFlux-based SSE transport implementation