AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
MCP verified Apache-2.0 Self-run

Api2mcp4j

mcp-theeterna-api2mcp4j · by TheEterna

Spring Boot Starter: Auto-convert existing REST APIs (@RestController) to MCP Server with zero/low-code. Expose controllers as MCP Tools instantly.

No reviews yet
0 installs
18 views
0.0% view→install

Install

$ agentstack add mcp-theeterna-api2mcp4j

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/mcp-theeterna-api2mcp4j)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
6mo ago

Declared compatibility

Claude CodeClaude DesktopCursorWindsurf

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Api2mcp4j? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

api2mcp4j

Zero-to-low code MCP integration for your Spring Boot REST APIs Turn your existing Spring Boot controllers into an MCP (Model Context Protocol) server in minutes — no @Tool annotations everywhere, no rewriting business logic.

[](https://github.com/TheEterna/api2mcp4j) [](https://github.com/TheEterna/api2mcp4j/blob/master/LICENSE) [](https://www.java.com) [](https://spring.io/projects/spring-boot)

✨ Why api2mcp4j?

Most MCP integrations require you to:

  • Add @Tool / @McpTool annotations to every method
  • Duplicate or heavily refactor code
  • Maintain separate tool descriptions

api2mcp4j changes that.

It automatically scans your existing @RestController / @Service beans and exposes them as MCP tools with minimal configuration — leveraging parsers from:

  • Swagger/OpenAPI (v2 & v3)
  • Javadoc
  • Spring MVC metadata
  • Jackson
  • Spring AI native descriptions
  • Custom @Tool / @McpTool (optional)

Result: Your current REST APIs become AI-callable tools almost for free.

🔥 Key Features

  • Non-intrusive — No need to change business code (like MyBatis-Plus enhances MyBatis)
  • Auto-discovery — Scans controllers/services and registers methods as MCP tools
  • Multi-parser support — Smartly combines descriptions & parameter info from Swagger, Javadoc, etc.
  • Custom annotations@ToolScan, @ResourceScan, @PromptScan for fine-grained control
  • Isolated MCP tool system — Uses McpTool annotation (independent of Spring AI @Tool)
  • Full MCP SDK compatibility — Supports latest MCP Java SDK features (callbacks, resources, prompts)
  • Easy debugging — Works great with Cursor, Continue, or any MCP client

Quick Start (≈ 5 minutes)

1. Add dependency

> Note: Project not yet in Maven Central — build from source for now.

# Clone & build
git clone https://github.com/TheEterna/api2mcp4j.git
cd api2mcp4j/server2mcp-starter-webmvc
mvn clean install

    com.ai.plug
    server2mcp-starter-webmvc
    1.1.4-SNAPSHOT 

2. Enable in application.yml

plugin:
  mcp:
    enabled: true
    # Recommended: use multiple parsers for best description quality
    parser:
      params: SWAGGER3, SWAGGER2, SpringMVC, JACKSON, TOOL  # JAVADOC needs extra setup
      des:    SWAGGER3, SWAGGER2, JAVADOC, TOOL, JACKSON
    # 'interface' = auto-register all controller methods (skip @Deprecated)
    # 'custom'   = only register via @ToolScan / manual
    scope: interface

3. (Optional) Javadoc parser setup

To enable Javadoc parsing in production (bytecode doesn't contain comments):


    org.apache.maven.plugins
    maven-resources-plugin
    
        
            copy-java-sources
            prepare-package
            copy-resources
            
                ${project.build.outputDirectory}
                
                    
                        src/main/java
                        **/*.java
                    
                
            
        
    

4. Start your app → Test

Your MCP endpoint is ready (default /mcp or configured via spring.ai.mcp.* properties).

Use any MCP client (Cursor, custom agent, etc.) to call your original REST methods as tools.

Comparison with Alternatives

| Feature | api2mcp4j | Spring AI MCP Official | Manual @Tool everywhere | |-----------------------------|--------------------|------------------------|--------------------------| | Code changes required | Minimal (config only) | Medium–High | High | | Auto from existing REST | Yes (controllers) | No | No | | Parser combinators | Yes (Swagger+Javadoc+…) | Limited | Manual | | Non-intrusive | ★★★★★ | ★★★ | ★☆ | | Custom scan annotations | Yes | Partial | No | | Best for existing projects | Yes | New MCP-first apps | Small prototypes |

Best Use Cases

  • Expose internal management system APIs to AI agents quickly
  • Build multi-agent systems by turning microservices into MCP tools
  • Prototype AI features on top of production REST services
  • Avoid duplicating logic between REST and MCP endpoints

Documentation & Roadmap

Contributing

Issues, PRs, and stars are very welcome! The project is young — your feedback can shape its future.

License

[Apache License 2.0](LICENSE)


作者的话 这是一个我投入大量心血的个人项目,希望能真正帮助到更多 Spring Boot 开发者快速拥抱 MCP/AI Agent 时代。感谢每一位 star 和使用它的人!

- 语言更流畅、专业、吸引人

你可以直接发给作者,建议他 review 后合并(或作为 PR)。如果需要,我可以再调整语气、加 GIF/demo 图位置提示,或写中文版。

## Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [TheEterna](https://github.com/TheEterna)
- **Source:** [TheEterna/api2mcp4j](https://github.com/TheEterna/api2mcp4j)
- **License:** Apache-2.0
- **Homepage:** https://theeterna.github.io/server2mcp-docs/

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.