A
addozhang/spring-rest-to-mcp
Convert Spring REST API to MCP Server with OpenRewrite
View on GitHub ↗Link checked 2026-11-12 · automated check blocked (HTTP 429), status unconfirmed
We have neither an install command nor a public remote endpoint from this repository, so we do not print a config. A made-up one is worse than none. How each client wires MCP up →
- Source
- collected from the abordage/awesome-mcp list · type: MCP server
- Harvest history
- first seen 2026-11-05 · last seen 2026-11-14 · seen 10× · listed by 10 sources
- Score
- score 1,003 · 10 sources · mcp
FAQ (answers come from our records)
Who is it for?
We filed it under these tags: MCP 服务. The tags come from the entry itself, not a taxonomy we imposed.
Who maintains it?
first catalogued 2026-11-05;last seen 2026-11-14。There is no official certification or quality rating here — we record sources and dates only.
# Spring Web to MCP Converter 🚀
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
An OpenRewrite recipe collection that automatically converts Spring Web REST APIs to Spring AI Model Context Protocol (MCP) server tools.
## 📋 Introduction
This project provides a set of OpenRewrite recipes that help you migrate traditional Spring Web REST APIs to Spring AI's Model Context Protocol (MCP) server tools. The transformation includes:
1. 🔄 Converting Spring Web annotations to Spring AI MCP @Tool annotations
2. 🔧 Adding necessary MCP configuration and components
3. 📦 Updating Maven dependencies to include Spring AI MCP server components
The recipes automatically extract documentation from your existing REST controllers to create properly documented MCP tools, making your APIs accessible to AI agents through the Model Context Protocol.
For more details about Spring AI's implementation of MCP, see the Spring AI MCP documentation.
## 🛠️ How to Build and Install
### Prerequisites
Java 17 or higher
Maven 3.6+
### Prerequisites for Target REST API Projects
To successfully migrate your Spring Web REST API to MCP, your project should:
Use Spring Boot 3.2+ (3.2.0 or newer)
Use Spring Web MVC for REST controllers
Use Maven build tool
The recipe adds Spring AI MCP dependencies (version 1.0.0-SNAPSHOT or newer) to your project automatically.
### Build Steps
1. Clone this repository:
bash
git clone https://github.com/yourusername/web-to-mcp.git
cd web-to-mcp
2. Build the project:
bash
mvn clean install
This will compile the code and install the artifact to your local Maven repository.
## 🔥 How to Use
To apply the recipes to your Spring Web project, run the following Maven command:
bash
mvn org.openrewrite.maven:rewrite-maven-plugin:6.4.0:run \
-Drewrite.activeRecipes=RewriteWebToMCP \
-Drewrite.recipeArtifactCoordinates=com.atbug.rewrite:web-to-mcp:1.0-SNAPSHOT \
-Drewrite.exportDatatables=true
Important: This command needs to be executed twice:
1. First execution will update your pom.xml to add necessary repositories and dependencies
2. Second execution will perform the actual code conversion of your Spring Web controllers to MCP tools
## ✨ Features
The recipe performs several transformations that are organized into three main components:
### 1. POM Updates (UpdatePom)
Adds Spring Snapshots repository (https://repo.spring.io/snapshot)
Adds Central Portal Snapshots repository (https://central.sonatype.com/repository/maven-snapshots/)
Adds Spring AI MCP server WebMVC dependency (spring-ai-starter-mcp-server-webmvc)
### 2. Code Transformations
AddToolAnnotationToMappingMethod: Automatically converts Spring Web controller methods to MCP tools
Adds @Tool annotations to methods with Spring Web mapping annotations (@GetMapping, @PostMapping, etc.)
Extracts method descriptions from JavaDoc comments to populate the description attribute
Adds @ToolParam annotations to method parameters, preserving their descriptions from JavaDoc
AddToolCallbackProviderBean: Creates or updates a bean to register MCP tools
Identifies Spring Boot application entry point class
Creates a ToolCallbackProvider bean to register all controllers with @Tool annotations
Intelligently updates existing provider beans if they already exist
AddSpringAIMcpProperties: Configures MCP server properties
## 📋 Introduction
This project provides a set of OpenRewrite recipes that help you migrate traditional Spring Web REST APIs to Spring AI's Model Context Protocol (MCP) server tools. The transformation includes:
1. 🔄 Converting Spring Web annotations to Spring AI MCP @Tool annotations
2. 🔧 Adding necessary MCP configuration and components
3. 📦 Updating Maven dependencies to include Spring AI MCP server components
The recipes automatically extract documentation from your existing REST controllers to create properly documented MCP tools, making your APIs accessible to AI agents through the Model Context Protocol.
For more details about Spring AI's implementation of MCP, see the Spring AI MCP documentation.
## 🛠️ How to Build and Install
### Prerequisites
Java 17 or higher
Maven 3.6+
### Prerequisites for Target REST API Projects
To successfully migrate your Spring Web REST API to MCP, your project should:
Use Spring Boot 3.2+ (3.2.0 or newer)
Use Spring Web MVC for REST controllers
Use Maven build tool
The recipe adds Spring AI MCP dependencies (version 1.0.0-SNAPSHOT or newer) to your project automatically.
### Build Steps
1. Clone this repository:
bash
git clone https://github.com/yourusername/web-to-mcp.git
cd web-to-mcp
2. Build the project:
bash
mvn clean install
This will compile the code and install the artifact to your local Maven repository.
## 🔥 How to Use
To apply the recipes to your Spring Web project, run the following Maven command:
bash
mvn org.openrewrite.maven:rewrite-maven-plugin:6.4.0:run \
-Drewrite.activeRecipes=RewriteWebToMCP \
-Drewrite.recipeArtifactCoordinates=com.atbug.rewrite:web-to-mcp:1.0-SNAPSHOT \
-Drewrite.exportDatatables=true
Important: This command needs to be executed twice:
1. First execution will update your pom.xml to add necessary repositories and dependencies
2. Second execution will perform the actual code conversion of your Spring Web controllers to MCP tools
## ✨ Features
The recipe performs several transformations that are organized into three main components:
### 1. POM Updates (UpdatePom)
Adds Spring Snapshots repository (https://repo.spring.io/snapshot)
Adds Central Portal Snapshots repository (https://central.sonatype.com/repository/maven-snapshots/)
Adds Spring AI MCP server WebMVC dependency (spring-ai-starter-mcp-server-webmvc)
### 2. Code Transformations
AddToolAnnotationToMappingMethod: Automatically converts Spring Web controller methods to MCP tools
Adds @Tool annotations to methods with Spring Web mapping annotations (@GetMapping, @PostMapping, etc.)
Extracts method descriptions from JavaDoc comments to populate the description attribute
Adds @ToolParam annotations to method parameters, preserving their descriptions from JavaDoc
AddToolCallbackProviderBean: Creates or updates a bean to register MCP tools
Identifies Spring Boot application entry point class
Creates a ToolCallbackProvider bean to register all controllers with @Tool annotations
Intelligently updates existing provider beans if they already exist
AddSpringAIMcpProperties: Configures MCP server properties
Listed badge (optional)
Copy this line into the README if you want the listing mark. Optional, and it does not affect being listed.
[](https://anclum.com/en/s/addozhang-spring-rest-to-mcp/)
- Source
- awesome · https://github.com/addozhang/spring-rest-to-mcp
- Browse by field
- MCP servers
- Listed by
- 10 independent sources
- added
- today
More like this
Filed under
Every tag opens the full list for that filter. Counts are the live catalogue figures.