
datoon
io.github.andrii-su由 GitHub 帳號 andrii-su 發布v1.9.1更新於 Oct 24, 2026
Smart structured-data to TOON gateway: converts to TOON only when it saves LLM tokens.
概覽
將 JSON、CSV、YAML 等結構化資料轉成 TOON 格式供 LLM 提示使用,但只在確實節省 token 時才轉換。
- 可以做什麼
- datoon 是一個本機 MCP 伺服器,在結構化資料進入提示之前,先轉成緊湊的表格文字格式 TOON。它提供三個工具:convert_json 進行帶政策閘控的完整 JSON 轉換,convert_text 處理 CSV、YAML、XML 或 JSONL 文字,analyze_json 只做結構分析。決策層會檢查資料是否為列數足夠的統一物件陣列,以及預估 token 節省是否超過門檻;不符合時就回傳原始資料。每次結果都附上包含決策、原因與 token 估算的報告。
- 適用情境
- 當提示中帶有大量統一表格資料(例如 CSV 匯出、JSONL 事件記錄或 API 回應),且希望在不冒轉換反而變差風險的前提下減少 payload token 時使用。也適合需要在流程中為每次格式決策留下明確可記錄原因的情境。
- 執行需求
- 以本機程序執行,通常透過 uvx 從 PyPI 套件 datoon 加上 mcp 附加元件啟動。需要 Python 3.12 或更新版本。TOON 轉換本身需要 PATH 中有 Node.js 與 npx;分析與格式讀取不需 Node.js。選用附加元件可支援 YAML、Excel、Parquet/ORC/Avro、Apple Numbers 以及以 tiktoken 為基礎的 token 計算。未宣告任何帳號、API 金鑰或環境變數。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 datoon,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
datoon
smart structured-data→TOON gateway — converts only when it actually saves tokens
[Tests] [Pre-commit] [Release] [PyPI] [Python] [License: MIT]
Before/After • Install • What You Get • How It Works • Benchmarks • Full install guide
Raw structured data is often verbose in LLM prompts. TOON can save tokens — but blind conversion can also make payloads worse. datoon adds a decision layer: convert when structure and savings justify it, skip when they don't, and always explain why.
Supports JSON, CSV, JSONL, YAML, XML, Parquet, Avro, ORC, Excel, and Apple Numbers — auto-detected from file extension.
Before / After
Same data. Right format. Always explained.
[!IMPORTANT] datoon saves payload tokens — the structured data portion of your prompt. Token savings depend on payload shape: uniform tabular data converts well; deeply nested or non-uniform structures are skipped. Every decision includes a reason so pipelines can log, debug, and trust the outcome.
Install
Requires Python 3.12+. TOON conversion requires Node.js with npx in PATH — analysis and format reading work without it.
For Claude Code plugin, Codex, and MCP config → INSTALL.md.
What You Get
Supported input formats
How It Works
- Detect format — from
--formatflag, file extension, or default to JSON for stdin - Read + normalize — parse source into list of row dicts; serialize to compact JSON
- Analyze structure — uniform object arrays? acceptable depth? minimum rows?
- Gate early — non-candidates skip before any CLI call; no Node.js overhead
- Convert + estimate — TOON CLI runs, token savings calculated
- Gate savings — below threshold → return JSON; above → return TOON with report
Every path returns a ConversionReport with decision, reason, and token estimates. Pipelines never get silent surprises.
Quick Start
JSON (stdin):
CSV (auto-detected from extension):
JSONL:
YAML (requires datoon[yaml]):
Parquet (requires datoon[columnar]):
Explicit format override:
Force conversion (bypass gating — for experiments):
Python API
JSON conversion:
Any format via read_tabular:
Structure-only analysis (no Node.js required):
MCP Server
datoon ships an MCP server with three tools:
Claude Desktop / Cursor / Windsurf config:
Run locally:
Listed on the MCP Registry, Smithery, and Glama. See MARKETPLACES.md.
Claude Code Plugin
Install directly from GitHub:
Trigger in-session:
CLI Reference
Format is auto-detected from file extension. Use --format to override or when reading from stdin.
Benchmarks
Why auto mode outperforms forced conversion
Auto mode avoids low-benefit and high-risk payloads (orders-nested, mixed-non-uniform) while matching forced TOON's average token count on suitable ones. Every decision comes with a reasoned report.
Forced conversion succeeded for 5/5 payloads.
Format conversion benchmark
Token savings when converting from common structured formats (CSV, JSONL, XML, YAML). Baseline is the JSON representation of the same data — what an LLM would receive without datoon.
Forced conversion succeeded for 4/4 payloads.
Agent skill evaluation
Artifact-based subagent comparison — identical analysis tasks, two modes:
with_skill: agent received thedatoonskill and followed the conversion workflow.without_skill: agent used JSON directly, no TOON ordatoon.
3 payload sizes × 3 iterations = 18 total agent runs. Both modes: 100% correct answers.
Full report and raw outputs: benchmarks/agent_skill_eval/. Savings are payload-token estimates, not full end-to-end model-token usage.
Development
Contributor workflow: CONTRIBUTING.md. Maintainer/agent notes: CLAUDE.md.
Setup:
Tests:
Skill sync + plugin metadata:
Links
- INSTALL.md — full install matrix, all targets, per-agent detail
- CONTRIBUTING.md — contributor workflow
- CLAUDE.md — maintainer guide for agents
- CHANGELOG.md — release history
- SECURITY.md — vulnerability reporting
- Live docs —
docs/ - Issues — bugs, features, questions
License
MIT
來源:README.md,提交 1579e24
工具
0版本歷史
1- v1.9.1最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分