Command Palette

Search for a command to run...

Home / Servers

api2mcp4j

by TheEterna

api2mcp4j

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>

Java Spring Boot Spring AI MCP SDK MCP Protocol Tests End-to-End License

English · 中文 · Docs · Integration Matrix


Why api2mcp4j?

Most MCP integrations force you to:

  • Add @Tool / @McpTool to 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: orders_get_order
// With auto-generated description from Swagger / Javadoc / Spring MVC / Jackson / Spring AI

✨ Key Features

🎯 Non-intrusiveinterface scope auto-registers all controllers; no @Tool annotation needed
🔍 5-parser chainSwagger v3 / Swagger v2 / Javadoc / Spring MVC / Jackson / Spring AI — best description wins
🛠️ Full MCP coverageTools / Resources / Prompts / Completions / Elicitation / Sampling / Roots
🆕 Protocol 2026-07-28Wire schema + JSON-RPC routing + SSE long-poll + MRTR + OTel traceparent — 100%
🔌 Custom parsersImplement AbstractDesParser / AbstractParamParser, plug into the chain
🧪 TDD disciplineJUnit5, double commit [RED] then [GREEN], 600 tests all green
🚀 Quick startmvn spring-boot:run → MCP endpoint ready

🚀 Quick Start (≈ 3 minutes)

1. Clone & build

git clone https://github.com/TheEterna/api2mcp4j.git
cd api2mcp4j
mvn clean install -DskipTests

2. Add to your Spring Boot project

<dependency>
  <groupId>com.ai.plug</groupId>
  <artifactId>server2mcp-starter-webmvc</artifactId>
  <version>1.1.4-SNAPSHOT</version>
</dependency>

3. Configure

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

4. Start & test

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).


📡 MCP Protocol 2026-07-28 — 100% Compatible

Related servers

n8n

Updated today

by n8n-io

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

199,260

mcp-server-git

OfficialUpdated today

by modelcontextprotocol

A Model Context Protocol server providing tools to read, search, and manipulate Git repositories programmatically via LLMs

89,176

mcp-server-fetch

OfficialUpdated today

by modelcontextprotocol

A Model Context Protocol server providing tools to fetch and convert web content for usage by LLMs

89,176

@modelcontextprotocol/server-everything

OfficialUpdated today

by modelcontextprotocol

MCP server that exercises all the features of the MCP protocol

89,176