rest
A java package to automatically setup your spring boot REST controllers as an MCP server
claude mcp add --transport stdio imthath-m-rest-mcp-server java -jar path/to/your-app.jar \ --env JAVA_OPTS="Optional JVM options"
How to use
SpringBoot-MCP is a zero-configuration tool that automatically exposes your Spring Boot REST endpoints as MCP tools. By integrating the MCP server directly into your Spring application, you gain automatic discovery of all REST endpoints and their request/response schemas, surfaced as MCP tools via the SSE stream at /sse. Once your app is running, MCP clients can connect to that SSE endpoint and enumerate the available tools, enabling you to invoke your REST endpoints through MCP tooling with consistent naming derived from your controller methods.
To use the capabilities, add the rest-mcp-server dependency to your project (via Maven, as described in the README), remove the traditional spring-boot-starter-web dependency, and run your Spring Boot application. The MCP server is then available within your app and licenses the tools automatically. Connect with any MCP client supporting SSE (or stdio if configured) and point it to http://localhost:8080/sse to begin discovering and invoking your endpoints.
How to install
Prerequisites:
- Java 21 or higher
- Spring Boot 3.x
- Maven (or Gradle) for building the Spring Boot app
Installation steps:
- In your Spring Boot project, add the MCP dependency and configure the JitPack repository as shown:
- Remove the traditional Spring Web starter if you want the MCP server to manage the Netty-based server (as suggested by the project):
-
Build and run your Spring Boot application as usual (mvn spring-boot:run or your IDE). The MCP server will automatically expose all REST endpoints as MCP tools via SSE at https://localhost:8080/sse.
-
Connect an MCP client to the SSE endpoint to enumerate and invoke tools. For example, configure an MCP client to the URL http://localhost:8080/sse.
Additional notes
Notes and tips:
- The MCP server runs inside your Spring Boot application; there is no separate standalone MCP server binary by default.
- Ensure Java 21+ and Spring Boot 3.x are in use.
- The SSE endpoint is exposed at /sse by default; you can configure various MCP server properties in your Spring configuration as documented in the linked docs.
- The tool names are derived from the method names of your REST controllers, making them easy to discover in MCP clients.
- If you encounter issues, check that spring-ai-starter-mcp-server-webflux is properly included (it handles the Netty-based server behind the scenes).
- If you update dependencies, re-run your application to re-register the MCP tools.