Spring Boot Bridge MCP server

Automatically converts Spring Boot REST applications into MCP servers, enabling AI tools to interact with existing Spring APIs without rewriting backend services.
Back to servers
Provider
Bruno da Silva Santos
Release date
Apr 16, 2025
Language
Python
Stats
2 stars

Spring MCP Bridge is a tool that automatically converts REST endpoints from Spring Boot applications into an MCP (Message Conversation Protocol) server. This enables AI assistants like Claude, Cursor, and other MCP-compatible tools to directly interact with your Spring Boot APIs without requiring manual integration work.

Installation

First, clone the repository and navigate to the project directory:

# Clone the repository
git clone https://github.com/brunosantos/spring-mcp-bridge.git

# Enter the directory
cd spring-mcp-bridge

Usage

Scanning Your Spring Boot Project

The first step is to scan your Spring Boot project to generate an MCP server:

python spring_boot_mcp_converter.py --project /path/to/spring-project --output ./mcp_server --name MyAPI

Running the Generated MCP Server

After generating the MCP server, you can run it:

cd mcp_server
pip install -r requirements.txt
python main.py

Connecting via MCP Client

  • Configure your MCP client (Claude, Cursor, etc.) to use http://localhost:8000
  • The MCP schema will be available at http://localhost:8000/.well-known/mcp-schema.json

Command-Line Arguments

Argument Description Default
--project Path to Spring Boot project (required)
--output Output directory ./mcp_server
--name Application name SpringAPI
--debug Enable debug logging False

Example

python spring_mcp_bridge.py --project ~/projects/my-spring-api --output ./mcp_server --name MyAPI

The tool will:

  1. Scan the Spring Boot project for REST controllers
  2. Identify model types, parameters, and return types
  3. Generate a fully functional MCP server in Python/FastAPI
  4. Create a compatible MCP schema that describes all endpoints

Configuring the MCP Server

The generated MCP server can be configured by editing the main.py file:

# The Spring Boot base URL - modify this to match your target API
SPRING_BASE_URL = "http://localhost:8080"

Testing the Setup

To verify your MCP server is working correctly:

  1. Make sure your Spring Boot application is running
  2. Start the MCP server
  3. Visit http://localhost:8000/docs to see the FastAPI documentation
  4. Check the MCP schema at http://localhost:8000/.well-known/mcp-schema.json
  5. Connect with an MCP client like Claude

Supported Spring Boot Features

The bridge supports the following Spring Boot components:

  • REST Controllers (@RestController, @Controller)
  • HTTP Methods (@GetMapping, @PostMapping, @PutMapping, @DeleteMapping, @PatchMapping)
  • Request Parameters (@RequestParam)
  • Path Variables (@PathVariable)
  • Request Bodies (@RequestBody)
  • Java Models and DTOs

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

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

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later