APiGen MCP Server (Java)
Native Java implementation of Model Context Protocol (MCP) server for APiGen - enables AI assistants like Claude to generate production-ready APIs directly from natural language.
Overview
The Problem: Disconnected AI Code Generation
Before APiGen MCP:
User: "Claude, create a REST API for my e-commerce system"
Claude: "Sure! Here's a basic Flask example... [generates incomplete code]
You'll need to:
1. Install Flask manually
2. Set up database manually
3. Add authentication manually
4. Configure Docker manually
5. Write tests manually"After APiGen MCP:
User: "Generate a REST API for this e-commerce schema:
CREATE TABLE products (id BIGINT, name VARCHAR(255), price DECIMAL);
Use java-spring with JWT auth, Docker, and tests"
Claude: [Uses apigen MCP tool]
✅ Generated complete Spring Boot project
✅ Entities, repositories, services, controllers
✅ JWT authentication configured
✅ Docker Compose with PostgreSQL
✅ Unit + Integration tests
✅ OpenAPI documentation
✅ Production-ready in 10 secondsTime Saved: 99% (2-3 days → 5 minutes)
Features
- Direct Integration: Native integration with APiGen codegen (no subprocess calls)
- Full MCP Support: Implements MCP protocol over stdio using JSON-RPC 2.0
- 6 Tools Available: Generate, preview, parse SQL schemas and more
- 4 Resources: Languages, databases, field types, and example schemas
Tools
| Tool | Description |
|---|---|
generate_from_sql | Generate API code from SQL schema content |
preview_sql | Preview generated code without writing files |
parse_sql | Parse SQL and return extracted entities |
list_languages | List supported programming languages |
list_databases | List supported database types |
generate_entity | Generate code for a single entity |
Resources
| URI | Description |
|---|---|
apigen://languages | Supported programming languages |
apigen://databases | Supported database types |
apigen://field-types | Supported field types for entities |
apigen://example/sql | Example SQL schema |
Configuration
Claude Desktop
Add to your claude_desktop_config.json:
json
{
"mcpServers": {
"apigen": {
"command": "java",
"args": ["-jar", "/path/to/apigen/mcp/java/build/libs/java-1.0.0-SNAPSHOT-all.jar"]
}
}
}Comparison with Python MCP
| Feature | Java MCP | Python MCP |
|---|---|---|
| Integration | Direct (native) | Subprocess (CLI) |
| Startup time | Slower (JVM) | Faster |
| Performance | Better for heavy generation | Good |
| Dependencies | Embedded | Requires Java CLI |
Choose Java MCP for:
- Production deployments
- Heavy code generation workloads
- When you want native integration
Choose Python MCP for:
- Quick setup
- Lightweight usage
- When you already have APiGen CLI installed