mcp-stateless-server-boot-starter-docs
Stateless Streamable-HTTP MCP Servers
Stateless Streamable-HTTP MCP 服务器专为简化部署而设计,在请求之间不维护会话状态。 这些服务器非常适合微服务架构和云原生部署。
提示: 设置
spring.ai.mcp.server.protocol=STATELESS属性
提示: 使用 Streamable-HTTP clients 连接到无状态服务器。
注意: 无状态服务器不支持向 MCP 客户端发送消息请求(例如,elicitation、sampling、ping)。
Stateless WebMVC Server
使用 spring-ai-starter-mcp-server-webmvc 依赖:
<dependency>
<groupId>org.springframework.ai</groupId>
<artifactId>spring-ai-starter-mcp-server-webmvc</artifactId>
</dependency>
并将 spring.ai.mcp.server.protocol 属性设置为 STATELESS。
spring.ai.mcp.server.protocol=STATELESS
- 使用 Spring MVC 传输的无状态操作
- 无会话状态管理