
theeterna/api2mcp4j 是从 https://github.com/theeterna/api2mcp4j. 导入的 MCP 服务器候选
概览
theeterna/api2mcp4j 是从 https://github.com/theeterna/api2mcp4j. 导入的 MCP 服务器候选
概述(AI 翻译)
将现有的Spring Boot REST控制器转换为MCP(模型上下文协议)工具——无需重写,无需处处使用@Tool]。
英语 ·中文 ·文档 ·积分矩阵
为什么是api2mcp4j?
大多数MCP集成会强制你:
- 在每个方法中添加
@Tool/@McpTool - 将业务逻辑复制到并行的“MCP”代码路径中
- 维护独立的工具描述
api2mcp4j 扫描你现有的 @RestController 豆子,并将其方法作为 MCP 工具展示——对业务代码零更改。就像 MyBatis-Plus 增强 MyBatis 一样,api2mcp4j 增强了 Spring AI MCP。
✨ 主要特色
| 🎯 非侵入性 | interface 示波器自动注册所有控制器;无需@Tool注释 |
| 🔍 5-解析器链 | Swagger v3 / Swagger v2 / Javadoc / Spring MVC / Jackson / Spring AI — 最佳描述获胜 |
| 🛠️ 完整MCP覆盖工具 / 资源 / 提示 / 完成 / 引发 / 采样 / 根源 | |
| 🆕 协议 2026-07-28 | 线路模式 + JSON-RPC 路由 + SSE 长轮询 + MRTR + OTel 跟踪母体 — 100% |
| 🔌 自定义解析器 | 实现 AbstractDesParser / AbstractParamParser,插入链条 |
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
api2mcp4j
Turn your existing Spring Boot REST controllers into MCP (Model Context Protocol) tools — no rewrites, no @Tool everywhere.
io.github.theeterna
server2mcp-starter-webmvc
1.2.0
English · 中文 · Docs · Integration Matrix
Why api2mcp4j?
Most MCP integrations force you to:
- Add
@Tool/@McpToolto every method - Duplicate business logic into a parallel “MCP” code path
- Maintain separate tool descriptions
api2mcp4j scans your existing @RestController beans and exposes their methods as MCP tools — zero changes to business code. Like MyBatis-Plus enhances MyBatis, api2mcp4j enhances Spring AI MCP.
// Your existing controller — unchanged
@RestController
public class OrderController {
@GetMapping("/orders/{id}")
public Order getOrder(@PathVariable Long id) { ... }
}
// Becomes an MCP tool: OrderController_getOrder
// With auto-generated description from Swagger / Javadoc / Spring MVC / Jackson / Spring AI
✨ Key Features
| 🎯 Non-intrusive | interface scope auto-registers all controllers; no @Tool annotation needed |
| 🔍 5-parser chain | Swagger v3 / Swagger v2 / Javadoc / Spring MVC / Jackson / Spring AI — best description wins |
| 🛠️ Full MCP coverage | Tools / Resources / Prompts / Completions / Elicitation / Sampling / Roots |
| 🆕 Protocol 2026-07-28 | Wire schema + JSON-RPC routing + SSE long-poll + MRTR + OTel traceparent — 100% |
| 🔌 Custom parsers | Implement AbstractDesParser / AbstractParamParser, plug into the chain |
| 🧪 TDD discipline | JUnit5, double commit [RED] then [GREEN], 600 tests all green |
| 🚀 Quick start | mvn spring-boot:run → MCP endpoint ready |
🚀 Quick Start (≈ 3 minutes)
1. Clone & build
git clone https://github.com/TheEterna/api2mcp4j.git
安装
This server does not publish a one-line install command.
Open the repository installation guide 新手?先看 mcpskill.org 教程 →