
A directory listing describing a cancellation-letter and mailing-address service. The configured public GitHub repository returned 404 during source verification.

A Java framework that scans existing Spring Boot @RestController beans and exposes their methods as MCP tools, with auto-generated descriptions from Swagger, Javadoc, Spring MVC, Jackson, and Spring AI.
api2mcp4j — Spring Boot REST controllers as MCP tools is cataloged as an MCP server attributed to theeterna. A Java framework that scans existing Spring Boot @RestController beans and exposes their methods as MCP tools, with auto-generated descriptions from Swagger, Javadoc, Spring MVC, Jackson, and Spring AI. It is categorized under developer tools. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.
Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.
Catalog license label: Apache License 2.0. Check the source repository's current license and terms before using, modifying or distributing this software.
能力定义尚未审核。未核验的采集内容不会作为可信接口展示。
暂无可展示的已审核记录。这不表示上游不支持此能力。
暂无可展示的已审核记录。这不表示上游不支持此能力。
暂无可展示的已审核记录。这不表示上游不支持此能力。
Email delivery is not connected. This page does not collect email addresses or create subscriptions.
Browse the registry for current listings instead.
Reviews for api2mcp4j — Spring Boot REST controllers as MCP tools are not available yet
Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.
No. In 'interface' scope it auto-registers all controllers and no @Tool annotation is needed.
Yes. WebFlux applications use the WebFlux starter, which offers the same protocol surface over reactive transport.
It is not aimed at greenfield MCP-first projects, real-time streaming or SSE-only UIs, apps that don't already use Spring Boot, or tiny prototypes.
README.md · 6e917fda0b62 · 采集于 2026-11-13 09:30:16 UTC
保留上游原文,不做 AI 改写。为安全起见过滤脚本、表单和不安全链接。
当前显示最后一次成功采集的文档快照,请以来源页面为准。
Turn your existing Spring Boot REST controllers into MCP (Model Context Protocol) tools — no rewrites, no @Tool everywhere.
<dependency>
<groupId>io.github.theeterna</groupId>
<artifactId>server2mcp-starter-webmvc</artifactId>
<version>1.2.0</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: OrderController_getOrder
// 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>io.github.theeterna</groupId>
<artifactId>server2mcp-starter-webmvc</artifactId>
<version>1.2.0</version>
</dependency>
Reactive (Spring WebFlux) applications use the WebFlux starter instead — identical protocol surface, reactive transport:
<dependency>
<groupId>io.github.theeterna</groupId>
<artifactId>server2mcp-starter-webflux</artifactId>
<version>1.2.0</version>
</dependency>
plugin:
mcp:
enabled: true
scope: interface # 'interface' = auto-register all controllers; 'custom' = @ToolScan only
parser:
des: MCPTOOL, JAVADOC, TOOL, JACKSON, SWAGGER3, SWAGGER2
param: MCPTOOL, JAVADOC, TOOL, SpringMVC, JACKSON, SWAGGER2, SWAGGER3
strict: false # true = a misspelled parser name aborts startup (default: warn only)
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) │
│ └────────────────┬─────────────────────┘ │
│ │ │
│ ┌────────────────▼─────────────────────┐ │
│ │ Spring AI MCP SDK 2.0 │ │
│ │ (McpSyncServer / McpAsyncServer) │ │
│ └────────────────┬─────────────────────┘ │
└────────────────────┼────────────────────────────────────────┘
│ wire: JSON-RPC 2.0 + SSE
▼
┌────────────────────┐
│ MCP Clients │
│ • Claude Desktop │
│ • Cursor / Cline │
│ • Your BFF / Agent │
└────────────────────┘
api2mcp4j/
├── server2mcp-common # Constants & utilities
├── server2mcp-core # Core engine: annotations, scanners, callbacks, providers
│ ├── com.ai.plug.core.annotation.* # @McpTool, @McpResource, @McpPrompt, @McpArg
│ ├── com.ai.plug.core.parser.* # 5-parser chain (des + param)
│ ├── com.ai.plug.core.callback.* # Sync + Async template methods
│ ├── com.ai.plug.core.spec.* # 2026-07-28 wire layer
│ └── com.ai.plug.core.provider.* # Spring AI bridge
├── server2mcp-autoconfigure # Spring Boot auto-configuration
├── server2mcp-spring-boot-starters/
│ ├── server2mcp-starter-webmvc # ✅ Full endpoint wiring (JSON-RPC + SSE + HTTP)
│ └── server2mcp-starter-webflux # ✅ Reactive endpoint wiring — full protocol parity with WebMVC
└── server2mcp-test # ✅ Demo app + 21/21 e2e verification
| ✅ Use it for | ❌ Don't use it for |
|---|---|
| Exposing internal REST APIs to AI agents quickly | Greenfield MCP-first projects (use Spring AI MCP directly) |
| Wrapping legacy controllers as MCP tools | Real-time streaming / SSE-only UIs |
| Multi-agent systems sharing tool definitions | Apps that don't already use Spring Boot |
| Prototyping AI features on production services | Tiny prototypes (overhead not worth it) |
| Feature | api2mcp4j | Spring AI MCP Official | Manual @Tool everywhere |
|---|---|---|---|
| Code changes required | Minimal (config only) | Medium–High | High |
Auto-discover from @RestController | ✅ | ❌ | ❌ |
| 5-parser chain (Swagger + Javadoc + …) | ✅ | Limited | Manual |
| Non-intrusive | ★★★★★ | ★★★ | ★☆ |
| Protocol 2026-07-28 (RPC + wire) | ✅ 100% | 🟡 partial | ⚪ |
| MRTR multi-round | ✅ with decorator | ⚪ | ⚪ |
| SSE long-poll + Last-Event-ID | ✅ built-in | 🟡 via SDK | ❌ |
| W3C traceparent (SEP-414) | ✅ auto-minted | ❌ | ❌ |
| Best for existing projects | ✅ | New apps | Tiny demos |
Issues, PRs, and ⭐ are very welcome.
This is a young project — your feedback shapes its future.
Before submitting a PR, please read:
docs/logs/@McpTool(tenant = "..."))scripts/trigger-phase3.sh)Built with care by Han · Apache 2.0 · 100% protocol 2026-07-28 compatible
Claim this server with your GitHub account to request manual ownership verification.
Link to the catalog listing for api2mcp4j — Spring Boot REST controllers as MCP tools from your README. This badge does not certify ownership, compatibility or security.
[](https://awesome-mcp.com/servers/server2mcp)Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.
来源、范围和时段分别列出;不相加,不代表安装人数、活跃用户或安全审核。
尚无已审核的包 / 镜像标识,暂不展示下载统计。
Alternative and complementary servers in the same category

A directory listing describing a cancellation-letter and mailing-address service. The configured public GitHub repository returned 404 during source verification.

A hosted MCP service for browsing and searching through Singapore mobile-network proxies.

A directory listing describing a Markdown-to-PDF service. The configured public GitHub repository returned 404 during source verification.