by TheEterna
Spring Boot Starter: Auto-convert existing REST APIs (@RestController) to MCP Server with zero/low-code. Expose controllers as MCP Tools instantly.
# Add to your Claude Code skills
git clone https://github.com/TheEterna/api2mcp4jLast scanned: 5/30/2026
{
"issues": [],
"status": "PASSED",
"scannedAt": "2026-05-30T17:02:04.806Z",
"npmAuditRan": true,
"pipAuditRan": true
}api2mcp4j is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by TheEterna. Spring Boot Starter: Auto-convert existing REST APIs (@RestController) to MCP Server with zero/low-code. Expose controllers as MCP Tools instantly. It has 110 GitHub stars.
Yes. api2mcp4j passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.
Clone the repository with "git clone https://github.com/TheEterna/api2mcp4j" and add it to your Claude Code skills directory (see the Installation section above).
api2mcp4j is primarily written in Java. It is open-source under TheEterna on GitHub, so you can review or fork the full source.
Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh api2mcp4j against similar tools.
No comments yet. Be the first to share your thoughts!
⚠️ Third-Party Software Notice
This skill is third-party open-source software developed and hosted independently on GitHub. SkillsLLM is an informational directory and does not control or maintain the underlying repository.
Any security checks, ratings, or warnings displayed by SkillsLLM are automated and limited in scope. They do not constitute a security certification or guarantee that the software is safe, error-free, or free from malicious code, vulnerabilities, compromised dependencies, or prompt-injection risks.
Review the source code, permissions, dependencies, and configuration before installing or running any third-party skill. Use is at your own risk. To the maximum extent permitted by applicable law, SkillsLLM is not liable for losses arising from third-party software.
Turn your existing Spring Boot REST controllers into MCP (Model Context Protocol) tools — no rewrites, no @Tool everywhere.
<dependency>
<groupId>com.ai.plug</groupId>
<artifactId>server2mcp-starter-webmvc</artifactId>
<version>1.1.4-SNAPSHOT</version>
</dependency>
English · 中文 · Docs · Integration Matrix
Most MCP integrations force you to:
@Tool / @McpTool to every methodapi2mcp4j 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: orders_get_order
// With auto-generated description from Swagger / Javadoc / Spring MVC / Jackson / Spring AI
| 🎯 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 |
git clone https://github.com/TheEterna/api2mcp4j.git
cd api2mcp4j
mvn clean install -DskipTests
<dependency>
<groupId>com.ai.plug</groupId>
<artifactId>server2mcp-starter-webmvc</artifactId>
<version>1.1.4-SNAPSHOT</version>
</dependency>
plugin:
mcp:
enabled: true
scope: interface # 'interface' = auto-register all controllers; 'custom' = @ToolScan only
parser:
des: SWAGGER3, JAVADOC, TOOL, JACKSON, SWAGGER2
param: MCPTOOL, JAVADOC, TOOL, SpringMVC, JACKSON, SWAGGER2, SWAGGER3
mvn spring-boot:run
Your MCP server is live on http://localhost:8080/mcp/jsonrpc (and HTTP fallbacks on /mcp/discover, /mcp/tasks, /mcp/sse).
api2mcp4j is the first Java MCP framework to ship full 2026-07-28 support, even though Java MCP SDK 2.0 only implements the 2025-11-25 wire. We bypassed SDK limitations with a custom JSON-RPC router, SSE controller, and wire schema — all without breaking SDK upgrade compatibility (controllers stay as fallbacks when SDK ≥ 3.0.0 lands).
| RPC | JSON-RPC endpoint | SSE long-poll | Source |
|---|---|---|---|
server/discover |
✅ POST /mcp/jsonrpc |
— | DiscoverEndpoint |
tasks/create |
✅ | — | TaskStore |
tasks/get / list / cancel |
✅ | — | TasksEndpoint |
tasks/augmented-prompt |
✅ | — | AugmentedPromptEndpoint |
subscriptions/listen |
✅ (poll) | ✅ GET /mcp/sse + Last-Event-ID + 15s heartbeat |
SseNotificationsController |
input_required/respond (MRTR) |
✅ envelope | — | MrtrToolCallbackWrapper |
| 2026-07-28 field | Status | Where |
|---|---|---|
tools.listChanged / resources.listChanged / prompts.listChanged |
✅ SDK native | WireSchemaExporter.syncAll() |
tools.subscription / completions.listChanged (new in 2026-07-28) |
✅ Custom wire | WireServerCapabilities |
experimental.io.modelcontextprotocol/tasks (new) |
✅ Custom wire | Same |
_meta.resultType / ttlMs / cacheScope / cacheWrapperKey |
✅ Auto-injected via meta map | @McpTool(...) + McpCallToolResultConverter |
_meta.taskHandle / inputRequests / requestState |
✅ Auto-recognized | InputRequiredResult / TaskHandle return values |
_meta.traceparent / tracestate / baggage (W3C SEP-414) |
✅ Auto-minted in JSON-RPC | MetaUtils |
| MRTR state machine (cross-round merge + 8-round guard) | ✅ | MrtrDriver |
outputSchema |
✅ SDK field | McpSchema.Tool.builder().outputSchema() |
| Capabilities health / diff / wire validation | ✅ | CapabilitiesHealth + SnapshotCompareTool + WireSchemaValidator |
The demo app boots with H2 in-memory DB (zero external dependencies) and validates every 2026-07-28 feature against a real HTTP/SSE wire:
cd server2mcp-test && mvn spring-boot:run # starts on :8888 (H2 in-memory)
# In another shell:
bash scripts/verify-protocol-2026-07-28.sh http://localhost:8888
== 0. liveness == ✓ actuator reachable
== 1. server/discover (JSON-RPC) == ✓×7 (jsonrpc=2.0, preferredVersion=2026-07-28,
tools.listChanged, tools.subscription,
completions.listChanged, experimental.tasks,
_meta.traceparent)
== 2. tasks/* (JSON-RPC) == ✓×5 (create, get, list, cancel full lifecycle)
== 3. tasks/augmented-prompt == ✓×1
== 4. subscriptions/listen == ✓×3 (HTTP poll + text/event-stream + connected)
== 5. input_required/respond == ✓×2 (accepted + state echo)
== 6. HTTP legacy endpoints == ✓×2 (/mcp/discover + /mcp/notifications)
== summary == passed: 21 / failed: 0
ALL ASSERTIONS PASSED — protocol 2026-07-28 wire verified
| Layer | Count | Status |
|---|---|---|
Unit tests (server2mcp-core) |
575 | ✅ all green |
Integration tests (server2mcp-starter-webmvc) |
22 | ✅ all green |
Demo tests (server2mcp-test) |
3 | ✅ all green |
| End-to-end curl verification | 21/21 | ✅ |
| Total | 600+ tests, 21/21 e2e | ✅ |
Test philosophy: TDD double-commit — [RED] test first, then [GREEN] implementation. See docs/specs/TEST_SPEC.md.
┌─────────────────────────────────────────────────────────────┐
│ Spring Boot Application │
│ │
│ ┌─── Your existing code (unchanged) ───┐ │
│ │ @RestController │ │
│ │ @Service │ │
│ │ @Component │ │
│ └────────────────┬─────────────────────┘ │
│ │ │
│ ┌────────────────▼─────────────────────┐ │
│ │ api2mcp4j framework │ │
│ │ │ │
│ │ Scanner ──→ Parser chain ──→ Provider │
│ │ │ │ │ │
│ │ Spring MVC 5 parsers SyncMcpToolMethodCallback │
│ │ discovery (Swagger2/3, (template method) │
│ │ Javadoc, │
│ │ Jackson, │
│ │ Spring AI) │
│ │ │ │
│ │ ── 2026-07-28 layer (new) ── │
│ │ • JsonRpcRouter + JsonRpcRoutes │
│ │ • WireServerCapabilities + JsonExporter │
│ │ • SseNotificationsController │
│ │ • MrtrDriver + MrtrSessionStore │
│ │ • MrtrToolCallbackWrapper │
│ │ • MetaUtils (W3C traceparent mint) │
│ └────────────────┬─────────────────────┘ │
│ │