Spring Boot

v1.0.0Coding Agentsstable

这是一个使用 Spring Boot 和 Spring AI MCP 的示例项目,展示了如何集成和使用 MCP 功能。A Spring Boot server implementation for Model Context Protocol (MCP), providing weather information services through MCP interfaces.

mcp-springbootmcpai-integration
Share:
11
Stars
0
Downloads
0
Weekly
0/5

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

Integrate Spring Boot applications with MCP for AI-assisted development.
Access weather information services through MCP interfaces.
James-Zou

Maintainer

LicenseApache-2.0
Languagejava
Versionv1.0.0
UpdatedApr 14, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx mcp-springboot

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

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
1

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-server
2

Build the project with Maven

Use Maven to compile the project and download all Spring AI MCP dependencies.

mvn clean install
3

Start 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/messages
4

Configure 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"
    }
  }
}
5

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/messages

Spring 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.

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.

Quick Config Preview

{ "mcpServers": { "mcp-springboot": { "command": "npx", "args": ["-y", "mcp-springboot"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

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.

33,000+ ServersFree & Open SourceStep-by-Step Guides