The Model Context Protocol (MCP) has become the standard way for AI assistants and agents to call external tools and read external data. If your company runs Spring Boot services, MCP is how those services become something an AI assistant can use — safely, through an interface you control.
Spring AI 2.0, released on June 12, 2026 for Spring Boot 4, makes this remarkably small. The Spring team maintains the official MCP Java SDK, Spring AI 2.0 ships with MCP Java SDK 2.0 (compliant with the 2025-11-25 MCP specification), and exposing a Spring service as an MCP tool is now one annotation.
What an MCP server exposes
An MCP server offers three kinds of things. Tools are actions the model can call, like "get loan status." Resources are data the model can read, like a policy document. Prompts are reusable prompt templates. Spring AI 2.0 maps these to @McpTool, @McpResource and @McpPrompt.
Step 1: add the MCP server starter
Create a Spring Boot 4 project and add Spring AI's MCP server starter for Spring MVC (search for "MCP Server" on start.spring.io to get the exact artifact for your Spring AI version). Then give the server a name and version:
In Spring AI 2.0, Streamable HTTP is the default transport, replacing the deprecated SSE transport. A stateless variant is available when you need to scale horizontally, and STDIO remains available for local, process-based integrations.
Step 2: turn a Spring service into a tool
That's the whole integration. Spring AI discovers the annotated method, generates the tool's input schema from the parameters, and serves it over MCP. Tools can also accept an automatically injected McpSyncRequestContext for logging, progress reporting, sampling and elicitation.
Step 3: connect a client
Any MCP-compatible client — an AI assistant, an IDE agent, or your own Spring AI application using the MCP client starter — can connect to the server's endpoint and discover the tool. On the Spring AI client side, 2.0 moved the tool-calling loop into the advisor chain, so tool calls, retries and structured-output validation all compose cleanly.
Frequently asked questions
What is an MCP server in Java?
An MCP server is a service that exposes tools, resources and prompts over the Model Context Protocol so AI assistants and agents can use them. In Java, Spring AI provides auto-configuration and annotations such as @McpTool to build MCP servers on Spring Boot.
Does Spring AI 2.0 support MCP?
Yes. Spring AI 2.0 ships with MCP Java SDK 2.0, supports the 2025-11-25 MCP specification, includes annotation-based tools, resources and prompts, and uses Streamable HTTP as the default transport.
Which transport should a Spring AI MCP server use?
Streamable HTTP for remote servers (with the stateless variant for easier horizontal scaling) and STDIO for local, process-based integrations. The older SSE transport is deprecated.
@McpTool.