About Spring MCP Bridge
Spring MCP Bridge scans REST endpoints in Spring Boot projects and generates a Python/FastAPI MCP server that forwards calls to the existing API. It is for developers exposing Java APIs to MCP clients without changing the original project.
Key features
- 01Scan REST controllers and endpoints
- 02Extract parameters, models, and return types
- 03Convert Java types to JSON Schema
- 04Generate a Python/FastAPI server
- 05Derive tool descriptions from Javadoc
- 06Generate a README and usage instructions
Use cases
- 01Generate an MCP server for an existing Spring Boot API
- 02Make API endpoints callable by MCP clients
- 03Create tool descriptions from existing Javadoc
MCP support
The generated server maps MCP calls to Spring REST requests and forwards them to the Spring Boot application. It provides an MCP schema for compatible clients.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.
Tools
Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.
Details
From the project READMESpring MCP Bridge
Spring MCP Bridge is a tool that automatically converts REST endpoints from Spring Boot applications into an MCP (Message Conversation Protocol) server, allowing AI assistants like Claude, Cursor, and other MCP-compatible tools to directly interact with your APIs.
*It does not currently include authentication. If your Spring Boot API requires authentication, you will need to modify the handler code to include the appropriate headers or tokens.
📖 Overview
Integrating existing APIs with AI assistants typically requires manual coding or complex configuration. Spring MCP Bridge eliminates this complexity by automatically scanning your Spring Boot project and generating a ready-to-use MCP server.
✨ Features
- Automatic Scanning: Discovers all REST endpoints (@RestController, @GetMapping, etc.)
- Zero Configuration: No modifications needed to existing Spring Boot code
- Model Preservation: Maintains request and response models as MCP tools
- Javadoc Extraction: Uses existing documentation to enhance MCP tool descriptions
- Complete Documentation: Generates README and clear instructions for use
🚀 Installation
# Clone the repository
git clone https://github.com/brunosantos/spring-mcp-bridge.git
# Enter the directory
cd spring-mcp-bridge
🛠️ Usage
- Scan your Spring Boot project:
python spring_boot_mcp_converter.py --project /path/to/spring-project --output ./mcp_server --name MyAPI
- Run the generated MCP server:
cd mcp_server
pip install -r requirements.txt
python main.py
- Connect 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
- Configure your MCP client (Claude, Cursor, etc.) to use
📋 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:
- Scan the Spring Boot project for REST controllers
- Identify model types, parameters, and return types
- Generate a fully functional MCP server in Python/FastAPI
- Create a compatible MCP schema that describes all endpoints
🔄 How It Works
- Scanning: Analyzes Java source code to extract metadata from REST endpoints
- Conversion: Converts Java types to JSON Schema types for MCP compatibility
- Generation: Creates a FastAPI application that maps MCP calls to Spring REST calls
- Forwarding: Routes requests from MCP client to the Spring Boot application
🔍 Spring Boot Features Supported
- REST Controllers (
@RestController,@Controller) - HTTP Methods (
@GetMapping,@PostMapping,@PutMapping,@DeleteMapping,@PatchMapping) - Request Parameters (
@RequestParam) - Path Variables (
@PathVariable) - Request Bodies (
@RequestBody) - Java Models and DTOs
⚙️ Configuration
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
To test the MCP server:
- Ensure your Spring Boot application is running
- Start the MCP server
- Visit
http://localhost:8000/docsto see the FastAPI documentation - Check the MCP schema at
http://localhost:8000/.well-known/mcp-schema.json - Connect with an MCP client like Claude
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
👨💻 Author
Bruno Santos
🙏 Acknowledgments
- Inspired by FastAPI-MCP and the growing ecosystem of MCP-compatible tools
- Thanks to the Spring Boot and FastAPI communities
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.