
Rulemorph MCP Server
io.github.vinhphatfsg由 GitHub 帳號 vinhphatfsg 發布v0.3.4更新於 Oct 25, 2026
MCP server for CSV/JSON data transformation using YAML rules
概覽
一個本機 MCP 伺服器,讓助理用宣告式 YAML 規則把 CSV、JSON、Excel 等資料轉換為 JSON,並驗證規則、產生 DTO。
- 可以做什麼
- 用 YAML/JSON 規則檔把 CSV、JSON、YAML、TOML、XML、HTML、Markdown 和 Excel 資料轉換為 JSON 記錄,支援對應、管線運算式、條件與斷言。
- 適用情境
- 當你希望助理把供應商 API 回應、CSV 或 Excel 匯入資料正規化為固定 JSON 結構,或檢查並重複使用轉換規則,而不是為每個來源寫一次性腳本時使用。
- 執行需求
- 以本機程序在桌面執行,需從對應平台(macOS、Linux 或 Windows)的安裝包安裝。未宣告驗證、環境變數或標頭。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Rulemorph 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.3.4最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分