
Transform Rules MCP Server
io.github.vinhphatfsg由 GitHub 账号 vinhphatfsg 发布v0.1.5更新于 Oct 24, 2026
MCP server for CSV/JSON data transformation using YAML rules
概览
本地 MCP 服务器,让助手用声明式 YAML/JSON 规则把 CSV、JSON、YAML、TOML、XML、HTML、Markdown 和 Excel 数据转换为 JSON。
- 可以做什么
- 按规则文件或直接表达式转换数据,把 API 响应、CSV 与 Excel 导入整理成目标 JSON 结构。校验规则文件后再使用。根据规则生成 Rust、TypeScript、Python、Go、Java、Kotlin 和 Swift 的 DTO。概括输入数据的结构,便于据此编写规则。
- 适用场景
- 适合需要反复把供应商 API 响应、表格或标记文本整理成固定 JSON 结构,并希望把这种行为保存在可审查、可版本化的规则文件中而不是一次性脚本里的场景。也适合检查规则并据此生成类型模型。
- 运行要求
- 以本地进程通过 stdio 运行;清单列出面向 macOS(Apple Silicon 与 Intel)、Linux x86_64 和 Windows x86_64 的预构建 MCPB 包。未声明认证、环境变量或请求头。
安装
在 SourceWeft 中
- 打开 控制台中的 Transform Rules MCP Server,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
[Crates.io] [docs.rs] [License: MIT]
Rulemorph transforms data from external APIs, CSV, JSON, YAML, TOML, XML, HTML, Markdown, and Excel into predictable JSON using declarative YAML/JSON rules.
Instead of adding another custom script for every input source, you can keep transformation behavior in rule files. The same rules can be reused from the CLI, embedded in Rust, served through a local UI/API server, or exposed to AI assistants through MCP.
Try it in your browser: playground.rulemorph.com
What It Solves
Rulemorph moves growing transformation code into reviewable, versioned rules.
- Normalize vendor API responses into your internal schema
- Bring CSV / Excel imports into a JSON pipeline
- Extract values from HTML or XML and process them with the same rule model
- Review, replace, and version transformation behavior as YAML/JSON
- Reuse the same transformation from the CLI, a local API, or an AI assistant
It is not meant to replace application code for arbitrary execution, complex domain logic, or long-running workflow orchestration. For those cases, normal application code or a workflow engine is usually a better fit.
Quick Start
Transform a users array from an external API response into the JSON shape your application expects.
rules.yaml
input.json
Run
You can also pipe input to transform:
Output
Show output
For quick one-off transformations without a rule file, use direct mode.
Evaluate a single expression against JSON or ad-hoc CSV:
Show output
Use -F/--field when you want a small output object and field order matters:
Show output
Use --output-map when a compact nested target map is easier to read:
Show output
For multi-record direct input, add --ndjson to emit one JSON value per line:
Show output
Direct mode can also read CSV or Excel files. CSV headers are inferred from .csv
files; use -H/--headers for headerless CSV. For Excel, select the header row
and data range explicitly:
Show output
Which Package To Use
Installation
Prebuilt binaries for the CLI, server, and MCP server are available from GitHub Releases.
CLI
Build from source for development:
UI / API Server
For full startup steps, see the UI Server Guide.
MCP Server
rulemorph-mcp exposes Rulemorph capabilities to AI assistants through the Model Context Protocol.
transform: transform datavalidate_rules: validate rulesgenerate_dto: generate DTOsanalyze_input: summarize input structure
Claude Code setup:
Key Features
- Normalize CSV / JSON / YAML / TOML / XML / HTML / Markdown /
.xlsxExcel into JSON records - Build output fields with
mappings - Transform values with v2 pipe expressions: trim, case conversion, concatenation, numeric operations, lookups, and array operations
- Define rule-local custom OPs with
defsto reuse typed v2 pipes or mapping bodies - Use numeric helpers such as
sqrt,mod,pow,clamp, andrangefor bounded generated sequences - Control behavior with
record_when,when, andasserts - Use
steps,branch, andfinalizefor ordered execution and output-array processing - Generate inferred DTOs for Rust, TypeScript, Python, Go, Java, Kotlin, and Swift. Explicit
typewins; dynamic or unsafe shapes fall back to JSON-friendly types. - Inspect semantic traces for built-in and custom OP execution without changing transform output
- Run a local UI/API server or expose the same engine through MCP
Input parsers are designed to be conservative. HTML parsing does not execute JavaScript or fetch URLs, Markdown raw HTML is preserved only as source text, and Excel parsing does not execute macros or evaluate formulas. XML DTD/entities and JSON/YAML duplicate keys are rejected to avoid ambiguous or side-effectful input behavior.
Rule Structure
New rule files should use version: 2. version: 1 rule files are still accepted during migration, but validation and runtime entry points emit a deprecation warning. A later release will move version: 1 rule files behind an explicit legacy opt-in before removing that syntax.
For the full rule specification, see Transformation Rules Spec. The Japanese version is also available in Japanese.
DTO Generation
Supported languages: rust, typescript, python, go, java, kotlin, swift
DTO generation uses explicit mapping types first, then infers simple scalar, array, map, and nested object shapes from literals and v2 pipe expressions. If a shape is dynamic or too broad to infer safely, the generated DTO uses each language's JSON fallback type.
Library Usage
The html, excel, and markdown input parsers are enabled by default. Library users that only need
core CSV, JSON, YAML, TOML, and XML support can disable them to reduce optional parser dependencies:
Re-enable parsers explicitly with features such as ["html"], ["excel"], or ["markdown"].
If a disabled parser is selected by a rule, transformation fails with invalid_input (for Markdown: input format markdown is not enabled in this build).
Documentation
来源:README.md,提交 611bda1
工具
0版本历史
1- v0.1.5最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分