MetaEngine — Claude Code MCP server: generate code from JSON recipes
Turns a compact JSON recipe, a type graph or an API schema into a batch of linked source files in one of 11 languages. Handy when there are many models and clients to write.
claude mcp add --env METAENGINE_API_URL=<METAENGINE_API_URL> --transport stdio metaengine -- npx -y @metaengine/mcp-serverWhat MetaEngine does
The server takes a recipe of classes, properties, templates and cross-type references, expands it into the full payload and ships that to the MetaEngine API. The files that come back get written to disk. References resolve inside a single call, so the whole graph has to arrive at once. Keep a recipe in version control and point at it with recipeFilePath rather than pasting its contents into every call.
OpenAPI, GraphQL SDL, Protocol Buffers and SQL DDL each get their own tool and yield models or a typed client. generate_code accepts the complete native type graph and lets you attach code in the target language. Writing is controlled by outputPath, skipExisting (on unless you turn it off) and dryRun, which hands back file contents instead of touching disk. The hosted side takes 250 counted types per request, so a large graph goes out in pieces.
Node.js 18 or newer is required. Recipe expansion runs locally and executes no JavaScript, yet the expanded payload leaves for MetaEngine's servers, including any code you put into the request. Nothing from your project is scanned on its own. Compile and review the output in your own build either way.
What it helps with
- produce a batch of linked models from one JSON recipe
- get a typed client out of an OpenAPI document
- turn SQL DDL into model types without retyping them
- describe a repeated structure once as a template with parameters
- write output into chosen folders without clobbering existing files
Example prompts for the agent
- Run
generate_from_recipeonspecs/models.recipe.jsonand write the files tosrc/models - Generate a typed client from this OpenAPI document
- Build model types from this SQL schema, do a
dryRunfirst
How to install MetaEngine
Platform CLI
claude mcp add --env METAENGINE_API_URL=<METAENGINE_API_URL> --transport stdio metaengine -- npx -y @metaengine/mcp-serverReplace <…> with your own values
Platform CLI
codex mcp add metaengine --env METAENGINE_API_URL=<METAENGINE_API_URL> -- npx -y @metaengine/mcp-serverReplace <…> with your own values
Config file
{
"mcpServers": {
"metaengine": {
"command": "npx",
"args": [
"-y",
"@metaengine/mcp-server"
],
"env": {
"METAENGINE_API_URL": "<METAENGINE_API_URL>"
}
}
}
}Replace <…> with your own values
Config file
{
"servers": {
"metaengine": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@metaengine/mcp-server"
],
"env": {
"METAENGINE_API_URL": "<METAENGINE_API_URL>"
}
}
}
}Replace <…> with your own values
Platform CLI
gemini mcp add -e METAENGINE_API_URL=<METAENGINE_API_URL> metaengine npx -y @metaengine/mcp-serverReplace <…> with your own values
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about MetaEngine
How do I install MetaEngine in Claude Code?
Run claude mcp add metaengine -- npx -y @metaengine/[email protected]. Node.js 18 or newer is needed. To point at your own API address, use the variant with --env METAENGINE_API_URL=<METAENGINE_API_URL> and the stdio transport.
What does MetaEngine do?
It expands a compact JSON recipe, type graph or API schema into source files for the language you pick and writes them into the project. Supported targets include TypeScript, Python, Go, C#, Java, Kotlin, Groovy, Scala, Swift, PHP and Rust.
Does it need an API key?
No account or key is required from the hosted service. The expanded payload is still processed by MetaEngine's servers, so keep that in mind when a request carries your own code.