A zero-configuration tool for automatically exposing Spring Boot endpoints as Model Context Protocol (MCP) tools.
- Direct integration - Mount an MCP server directly to your Spring Boot application with zero configuration
- Automatic discovery of all Spring REST endpoints and conversion to MCP tools
- Preserving schemas of your request and response models
Add the dependency to your Maven pom.xml
:
<dependency>
<groupId>com.github.imthath-m</groupId>
<artifactId>rest-mcp-server</artifactId>
<version>0.2.1</version>
</dependency>
Currently, SpringBoot-MCP is not available on Maven central repository. So you have to add the following respoistory in pom.xml
, to ensure JitPack serves it directly from GitHub.
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
After adding the dependency, you need to remove the following starter web dependency from your pom.xml
file.
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
This step is required because, this package depends on spring-ai-starter-mcp-server-webflux
which already does the basic setup with a Netty server.
That's it! Your auto-generated MCP server is now available at https://localhost:8080/sse
. You can configure this and other features of the MCP server by using variables specified here.
Once you run the app, you should see the following line your console.
o.s.a.m.s.a.McpServerAutoConfiguration : Registered tools: <number of endpoints>, notification: true
FYI, The REST endpoints in your service will continue to be available in the respective paths.
SpringBoot-MCP uses the method names from your REST Controllers as the MCP tool names.
Once your Spring Boot app with MCP integration is running, you can connect to it with any MCP client supporting SSE or stdio protocols.
- Run your Spring Boot application
- In Cursor -> Settings -> MCP -> Add new MCP server, use the URL
http://localhost:8080/sse
as SSE endpoint - Cursor will discover all available tools automatically
Example cursor config file named mcp.json
.
{
"mcpServers": {
"server-name": {
"url": "http://localhost:8080/sse"
}
}
}
Contributions are welcome! Please feel free to submit a Pull Request.
- Java 21 or higher
- Spring Boot 3.x
MIT License. Copyright (c) 2025. Mohammed Imthathullah.