MetaEngine
eu.metaengine由 metaengine.eu 发布v1.5.0更新于 Oct 24, 2026
Code generation from JSON recipes, linked type graphs, and API schemas across 11 languages.
概览
MetaEngine 可根据 JSON 配方、类型图或 API 架构,用 11 种语言生成源代码文件,并写入本地项目。
- 可以做什么
- 从紧凑 JSON 配方、完整原生类型图或本地规格文件生成代码,写入指定输出目录,支持试运行和跳过已有文件。从 OpenAPI 文档、GraphQL SDL、Protocol Buffers 定义和 SQL DDL 生成类型化客户端。为助手加载生成规则和语言说明。支持 TypeScript、Python、Go、C#、Java、Kotlin、Groovy、Scala、Swift、PHP 和 Rust 模型,以及 Angular、React、Spring、Ktor、Reqwest 等客户端。
- 适用场景
- 适合让助手依据紧凑、可版本控制的规格,跨多种语言搭建模型、服务、适配器或类型化 API 客户端,尤其在结构重复、可用模板或字段映射减少样板代码时。
- 运行要求
- 需要 Node.js 18 或更高版本,以及支持 stdio 的 MCP 客户端。无需账号或 API 密钥。可选环境变量 METAENGINE_API_URL 可覆盖默认的托管 API 地址。需要能访问托管 MetaEngine API 的网络,试运行也不例外。
安装
在 SourceWeft 中
- 打开 控制台中的 MetaEngine,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
MetaEngine MCP Server
Generate related source files from a type graph, a compact JSON recipe, or an API schema through your MCP client.
MetaEngine combines structured classes, interfaces, enums, collections, and generics with target-language code supplied in customCode. Explicit references connect that code to the same type graph, so the generator can resolve names and imports across the batch. Use it for models, services, adapters, or other structures you describe; the format does not prescribe an application architecture.
Install
Node.js 18 or later is required. Add the server to your MCP client's configuration:
For Claude Code:
The hosted service requires no API key or account. MCP clients include Claude Code, Claude Desktop, Cursor, Cline, and others with stdio support.
Start with a recipe
Call generate_from_recipe with these arguments:
The local MCP server expands the recipe into the existing generation payload, sends that payload to the MetaEngine API, and writes the returned files. Add named templates and parameter rows when structures repeat. Existing customCode, templateRefs, imports, decorators, inheritance, and generic definitions remain available.
A version-controlled recipe can be invoked with {"recipeFilePath":"specs/models.recipe.json"}. Reading a file avoids resending its contents in the tool call. Files still need to be authored or maintained.
Recipe grammar and examples · Generation guide · Language examples
Tools
Type and model generation supports TypeScript, Python, Go, C#, Java, Kotlin, Groovy, Scala, Swift, PHP, and Rust. Client generation targets Angular, React, TypeScript Fetch, Go net/http, Java Spring, Python httpx, C# HttpClient, Kotlin Ktor, Rust Reqwest, and Swift URLSession.
generate_code, load_spec_from_file, and generate_from_recipe share generation and file-writing behavior:
outputPathchooses the local output directory; the default is the MCP server's working directory.skipExistingdefaults totrue. Set it tofalseto overwrite generated files.dryRun: truereturns generated file contents without writing them. Generation still calls the hosted API.- Related type references resolve within one batch. Include the complete graph in that call.
- The hosted limit is 250 counted types per generation request. The exact count is described in the recipe guide.
For Node16/NodeNext TypeScript ESM, use typeScriptOptions: {"relativeImportExtension":"js"}. Other TypeScript output retains extensionless relative imports by default.
Where recipes help
Field maps remove repeated property metadata. Templates describe repeated structure once and bind explicit parameter values. Local JSON inputs can supply those values from a file you already maintain. The adapter executes no JavaScript from a recipe.
Savings depend on the amount of repetition, the chosen model and tokenizer, and the surrounding agent workflow. Custom business logic still needs to be written. A recorded development fixture compares a 59-interface recipe with its expanded payload; it measures JSON bytes, not model tokens or usage-limit guarantees.
The compact format keeps one readable path for common declarations and the existing native fields for advanced code. Native type expressions and customCode remain specific to their target language. Review and compile generated code in your project, including its dependencies and compiler settings.
Privacy and execution
The local MCP server runs over stdio and performs recipe expansion, declared local file reads, and generated-file writes. The hosted MetaEngine API performs ephemeral processing of the expanded generation payload and returns source files.
The server does not automatically scan or upload existing project source files. Source or customCode content explicitly included in a generation request is part of that request and is sent to the hosted MetaEngine API. Values read from recipe inputs are included only when the recipe uses them in the expanded payload.
Submitted generation content and generated file contents are not persisted or logged; anonymous operational metadata is retained. See the Privacy Policy and Terms for the processing and retention details.
Recorded agent workflows
A single MCP call can produce many files, reducing required tool operations. Model responses are a separate measure: in the recorded TypeScript runs Opus often issued one Write per response, while Sonnet usually batched the Writes. The corrected benchmark findings separate those counts and retain output-token totals and pass rates.
For reproducible measurements across languages, models, and spec shapes, see benchmark/ — a self-contained harness with the prompts, judging tools, and 15 canonical result folders. Numbers there are illustrations from one author's runs at N=5 per cell; reproduce in your own environment to see what holds for you.
Links
License
MIT
About this repository
This repository contains public documentation, examples, benchmarks, and issue tracking for MetaEngine MCP Server. The compiled npm package is available at @metaengine/mcp-server. The server implementation is maintained in a private repository.
来源:README.md,提交 140f94e
工具
0版本历史
1- v1.5.0最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分