Spring Boot
这是一个使用 Spring Boot 和 Spring AI MCP 的示例项目,展示了如何集成和使用 MCP 功能。A Spring Boot server implementation for Model Context Protocol (MCP), providing weather information services through MCP interfaces.
What is Spring Boot?
Spring Boot is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to 这是一个使用 spring boot 和 spring ai mcp 的示例项目,展示了如何集成和使用 mcp 功能。a spring boot server implementation for model context protocol (mcp), providing weather information services through mcp interfaces.
这是一个使用 Spring Boot 和 Spring AI MCP 的示例项目,展示了如何集成和使用 MCP 功能。A Spring Boot server implementation for Model Context Protocol (MCP), providing weather information services through MCP interfaces.
This server falls under the Coding Agents category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- 这是一个使用 Spring Boot 和 Spring AI MCP 的示例项目,展示了如何集成和使用 MCP 功能。A
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx mcp-springbootConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use Spring Boot
MCP Spring Boot Server is a reference implementation that demonstrates how to expose tools through the Model Context Protocol using Spring Boot and the Spring AI MCP library. It provides weather information tools over Server-Sent Events and shows developers how to build, configure, and test a Java-based MCP server that any MCP-compatible client can consume.
Prerequisites
- JDK 17 or later installed
- Maven 3.6 or later installed
- Spring Boot 3.2.0 or later (managed via the Maven POM)
- An MCP-compatible client such as Claude Desktop for testing
- Basic familiarity with Spring Boot application development
Clone the repository
Clone the mcp-springboot-server repository to your local machine.
git clone https://github.com/James-Zou/mcp-springboot-server.git
cd mcp-springboot-serverBuild the project with Maven
Use Maven to compile the project and download all Spring AI MCP dependencies.
mvn clean installStart the Spring Boot MCP server
Run the application. It starts on port 8080 by default and exposes MCP tools via Server-Sent Events at /mcp/messages.
mvn spring-boot:run
# Server starts at http://localhost:8080
# MCP SSE endpoint: http://localhost:8080/mcp/messagesConfigure Claude Desktop to connect to the running server
Add the Spring Boot MCP server to your claude_desktop_config.json. Since it uses SSE transport, the client connects to the HTTP endpoint rather than launching a subprocess.
{
"mcpServers": {
"mcp-springboot": {
"url": "http://localhost:8080/mcp/messages",
"transport": "sse"
}
}
}Customize the server for your own tools
To add your own MCP tools, create a Spring component annotated with @Tool from the spring-ai-mcp library and register it as a bean. Adjust application.properties to set the server name and version.
# src/main/resources/application.properties
server.port=8080
spring.ai.mcp.server.name=my-mcp-service
spring.ai.mcp.server.version=1.0.0
spring.ai.mcp.server.type=SYNC
spring.ai.mcp.server.sse-message-endpoint=/mcp/messagesSpring Boot Examples
Client configuration
claude_desktop_config.json configuration for the Spring Boot MCP server running locally on port 8080 over SSE transport.
{
"mcpServers": {
"mcp-springboot": {
"url": "http://localhost:8080/mcp/messages",
"transport": "sse"
}
}
}Prompts to try
Example prompts to use once the Spring Boot MCP server is running and connected.
- "What is the current weather in Shanghai?"
- "Get me the weather information for New York City"
- "List all available MCP tools provided by this server"
- "What city would you recommend visiting based on today's weather?"
- "Compare the weather in London and Tokyo right now"Troubleshooting Spring Boot
Port 8080 is already in use when starting the server
Change the port in src/main/resources/application.properties by setting server.port=8081 (or any free port), then update the URL in your claude_desktop_config.json to match.
Claude Desktop cannot connect to the SSE endpoint
Verify the Spring Boot server is running by visiting http://localhost:8080/mcp/messages in a browser or with curl. Ensure no firewall is blocking port 8080 and that the transport type in the config is set to 'sse'.
Maven build fails with dependency resolution errors
Ensure your Maven settings.xml is configured to reach Maven Central. If behind a corporate proxy, add proxy settings to ~/.m2/settings.xml. Run mvn clean install -U to force dependency updates.
Frequently Asked Questions about Spring Boot
What is Spring Boot?
Spring Boot is a Model Context Protocol (MCP) server that 这是一个使用 spring boot 和 spring ai mcp 的示例项目,展示了如何集成和使用 mcp 功能。a spring boot server implementation for model context protocol (mcp), providing weather information services through mcp interfaces. It connects AI assistants to external tools and data sources through a standardized interface.
How do I install Spring Boot?
Follow the installation instructions on the Spring Boot GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with Spring Boot?
Spring Boot works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is Spring Boot free to use?
Yes, Spring Boot is open source and available under the Apache-2.0 license. You can use it freely in both personal and commercial projects.
Spring Boot Alternatives — Similar Coding Agents Servers
Looking for alternatives to Spring Boot? Here are other popular coding agents servers you can use with Claude, Cursor, and VS Code.
Dify
★ 142.2kProduction-ready platform for agentic workflow development.
Ruflo
★ 54.0k🌊 The leading agent orchestration platform for Claude. Deploy intelligent multi-agent swarms, coordinate autonomous workflows, and build conversational AI systems. Features enterprise-grade architecture, self-learning swarm intelligence, RAG integrat
Goose
★ 45.7kan open source, extensible AI agent that goes beyond code suggestions - install, execute, edit, and test with any LLM
Antigravity Awesome Skills
★ 38.3kInstallable GitHub library of 1,400+ agentic skills for Claude Code, Cursor, Codex CLI, Gemini CLI, Antigravity, and more. Includes installer CLI, bundles, workflows, and official/community skill collections.
AgentScope
★ 25.5kBuild and run agents you can see, understand and trust.
Serena
★ 24.5kA coding agent toolkit that provides IDE-like semantic code retrieval and editing tools, enabling LLMs to efficiently navigate and modify codebases using symbol-level operations instead of basic file reading and string replacements.
Browse More Coding Agents MCP Servers
Explore all coding agents servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up Spring Boot in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use Spring Boot?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.