@metaengine/mcp-server
v1.4.1
Published
Model Context Protocol server for spec-first code generation: convert OpenAPI, GraphQL, Protobuf, and SQL specs into typed clients and models, or generate arbitrary type graphs with automatic imports, across 11 languages (TypeScript, Python, Go, C#, Java,
Maintainers
Keywords
Readme
MetaEngine MCP Server
Code generation, handed to your agent.
MetaEngine exposes its code-generation platform — spec converters for OpenAPI, GraphQL, Protobuf, and SQL, plus a batch type generator — as Model Context Protocol tools. Connect the server to Claude Code, Claude Desktop, Cursor, Cline, or any MCP-aware assistant, and "regenerate my billing client from the new OpenAPI spec" becomes a real, typed, ready-to-commit diff.
Install
Claude Code:
claude mcp add metaengine -- npx -y @metaengine/mcp-serverClaude Desktop, Cursor, Cline, or any other MCP client — add to the client's MCP config (claude_desktop_config.json, .cursor/mcp.json, …):
{
"mcpServers": {
"metaengine": {
"command": "npx",
"args": ["-y", "@metaengine/mcp-server"]
}
}
}No API key, no signup, free to use.
Tools
Seven tools. One call each. Plain text back.
| Tool | What it does |
| --- | --- |
| generate_openapi | Typed HTTP client from an OpenAPI 3.x document, passed inline or by URL — 10 frameworks |
| generate_graphql | Typed client from a GraphQL SDL schema, optionally with reusable named fragments — 10 frameworks |
| generate_protobuf | Typed client from Protocol Buffers (.proto) definitions — 10 frameworks |
| generate_sql | Typed model classes from SQL DDL (CREATE TABLE), parsed dialect-agnostically — 11 languages |
| generate_code | Arbitrary type graphs (classes, interfaces, enums, generics) from one structured spec, with imports and cross-references resolved — 11 languages |
| load_spec_from_file | Runs a generate_code spec from disk, so multi-file architectures stay version-controlled and context usage drops to a file path |
| metaengine_initialize | Primes the agent before its first generation: patterns, examples, and language-specific rules |
Every call is stateless and self-contained: pass the spec inline (or by file path), pick a framework or language, get a write summary back as text. dryRun returns the generated contents inline instead of writing — ready to diff. skipExisting (default) protects files you've already customized.
Spec-first development
Your specs are already the source of truth — the OpenAPI document, the GraphQL schema, the .proto files, the DDL. This server puts them to work inside the agent loop: when a spec changes, the agent regenerates the typed surface instead of hand-editing it.
- 4 source specs — OpenAPI 3.x, GraphQL SDL, Protocol Buffers, SQL DDL
- 10 client frameworks — Angular, React, TypeScript Fetch, Go net/http, Java Spring, Python httpx, C# HttpClient, Kotlin Ktor, Rust Reqwest, Swift URLSession
- 11 languages for type and model generation — TypeScript, Python, Go, C#, Java, Kotlin, Groovy, Scala, Swift, PHP, Rust — each emitted idiomatically (data classes in Kotlin, case classes in Scala, structs in Swift and Rust)
- Deterministic — generation is byte-reproducible at a fixed engine version, so agents can retry without drift
The converters surfaced through MCP are the same compiler pipeline that powers the MetaEngine Playground: a spec is parsed, normalized to MetaEngine's intermediate representation, and emitted through a language-specific target. Versions stay in lockstep across surfaces.
Measured behavior in agent loops
An open benchmark harness compares two Claude agents producing the same DDD codebase — one through this MCP server, one emitting files one by one with the built-in Write tool:
| Metric | MCP | Write loop |
| --- | --- | --- |
| Turns per run | 5.0 | 76.4 |
| cache_read tokens | 232k | 4.80M |
| Output tokens | 18.9k | 21.0k |
When the server writes every file in one call and returns a single summary, the agent's loop runs ~15× shorter and cache accumulation drops correspondingly. The mechanism is loop topology, not the model — it reproduced across a model swap and across spec shapes. Methodology, caveats, and raw results live in the harness repository.
For small tasks — a handful of files, exploratory code, one-off scripts — an agent's direct generation is simpler, and agents are told exactly that. The server earns its place when the work is spec-driven, polyglot, or structurally repetitive.
Privacy & design
- Local — runs on your machine over stdio, started via
npx; MIT licensed - Free — no API key, no account, unlimited requests
- Private — only generation specs (JSON describing what to create) are sent to the generation API; your existing code never leaves your machine, and specs are never saved or logged
Documentation
The AI guide is embedded in the tool description on first use — agents need no manual reading. After the first successful call, the description swaps to a lightweight directive to minimize context usage.
METAENGINE_AI_GUIDE.md— critical rules, patterns, language notes, and common mistakesEXAMPLES.md— real-world usage with input/output across all languages
Common questions
Do I need to learn the spec format? No. You talk to your assistant in natural language; it constructs the generation specs automatically.
How is this different from the agent writing code directly? Direct generation is faster for small tasks — and agents keep using it for those. This server is for spec conversion (OpenAPI/GraphQL/Protobuf/SQL → typed code) and structured multi-file generation where consistency and resolved imports matter.
Which assistants work? Any MCP client: Claude Code, Claude Desktop, Cursor, Cline, Continue, Zed, and others.
Links
License
MIT
