Skip to content

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 seconds

Time 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

ToolDescription
generate_from_sqlGenerate API code from SQL schema content
preview_sqlPreview generated code without writing files
parse_sqlParse SQL and return extracted entities
list_languagesList supported programming languages
list_databasesList supported database types
generate_entityGenerate code for a single entity

Resources

URIDescription
apigen://languagesSupported programming languages
apigen://databasesSupported database types
apigen://field-typesSupported field types for entities
apigen://example/sqlExample 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

FeatureJava MCPPython MCP
IntegrationDirect (native)Subprocess (CLI)
Startup timeSlower (JVM)Faster
PerformanceBetter for heavy generationGood
DependenciesEmbeddedRequires 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

Released under the MIT License.