json-shaper-lite

io.github.tidybytetools由 GitHub 帳號 tidybytetools 發布v1.1.0更新於 Nov 5, 2026

Turn key: value notes, CSV/TSV and Markdown tables into typed JSON. Plain code, no AI, runs locally.

已驗證STDIO僅桌面開發者工具資料與分析

概覽

AI 產生的概覽

本機 MCP 伺服器,把貼上的文字或本機文字檔(key: value 筆記、CSV/TSV、Markdown 表格)轉成帶型別的 JSON。

可以做什麼
  • 把對話中的文字轉成帶型別的 JSON,格式可自動偵測或指定為 kv、csv、markdown
  • 讀取本機文字檔(.txt、.csv、.tsv、.md,最大 5 MB)並回傳同樣結構的帶型別 JSON
  • 回傳包含偵測格式與資料的統一結果物件,由確定性程式碼產生而非 AI 模型
適用情境
適合在對話中或本機文字檔裡已有純文字紀錄、表格,需要乾淨可信的帶型別 JSON 時使用。不適用於本身已是 JSON、巢狀資料、應用程式日誌,或 Excel、PDF 等二進位格式。
執行需求
以本機 stdio 程序透過 uvx 啟動(需要 uv);套件發佈於 PyPI,需要 Python 3.10 以上版本。未宣告任何驗證、環境變數或標頭,也不連上網際網路。
安裝前請注意
兩個工具都是唯讀:檔案只讀取不修改,資料不會傳送到網路。型別是推測結果,像 007 或郵遞區號這類值可能被轉成數字,需要事後手動修正;每次執行只處理一張表格。在終端機執行時會在 stderr 輸出一行付費版提示,可用 --quiet 關閉。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 json-shaper-lite,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

[Tidy Byte Tools]

json-shaper-lite

[License: MIT] [Python 3.10+] [MCP server]

Free tool that turns key: value notes, CSV/TSV and Markdown tables into clean JSON. Need app logs or US addresses parsed too? The paid version does that: json-shaper on Gumroad

Plain code, not AI, so the same text always gives the same JSON. Runs on your own computer. MIT license. Works with Python 3.10 and newer, on Windows, Mac and Linux.

Install

pip install json-shaper-lite

Or use pipx, which keeps it in its own space:

pipx install json-shaper-lite

Want the newest code from GitHub instead?

pip install git+https://github.com/tidybytetools/json-shaper-lite

Or just download json_shaper_lite.py and run it with python3. That one file uses only Python's standard library. (Installing with pip also adds the mcp package, which the MCP server needs.)

Use it

printf 'Name: Ada\nAge: 36\nActive: yes' | json-shaper-litejson-shaper-lite export.csvjson-shaper-lite notes.md --format markdownjson-shaper-lite export.csv --json      # {"ok": true, "format": "csv", "data": [...]}

Output:

json
{"name": "Ada", "age": 36, "active": true}

Numbers come out as numbers, yes/no and true/false as booleans, and empty or "null" as null. The format is detected for you, or you can set it with --format kv|csv|markdown.

From Python:

python
from json_shaper_lite import shapeshape("x,y\n1,2")  # {'format': 'csv', 'data': [{'x': 1, 'y': 2}]}

When you run it in a terminal it prints one short line about the paid version to stderr after the result. It never goes into your JSON output, it only shows when you are looking at a terminal, and --quiet turns it off.

Known limits

  • It makes flat JSON. It does not flatten or unflatten nested JSON. For that, use a tool like flatten-json.
  • Types are a best guess. A value like 007 or a zip code can turn into a number. Fix those by hand after.
  • One table per run. Two Markdown tables in one file get mixed together. Split them first.
  • No app logs or addresses. Those are in the paid version.

How it compares to other free tools

json-shaper-liteflatten-jsoncsvkit csvjsonpandas
Main jobmessy text → JSONnested JSON → flat (and back)CSV → JSONfull data toolkit
Install sizeone file (pip adds mcp for the MCP server)smallmediumlarge
key: value notesyesnonono
Markdown tablesyesnonono, not built in
CSV/TSVyesnoyesyes
Guesses numbers and true/falseyesnoyesyes
Nested JSON flatten/unflattennoyesnoyes (json_normalize)
MCP server for AI appsyesnonono

If your data is already JSON and just too nested, flatten-json is the better pick.

Use it from Claude Desktop or Cursor (MCP)

There is a small free MCP server built in. It gives your AI app two tools. Both only read. They never write or change files, and they never use the internet. It needs uv.

Run it by hand to check it starts (it waits quietly for an app to talk to it):

uvx json-shaper-lite mcp

Claude Desktop (claude_desktop_config.json) or Cursor (~/.cursor/mcp.json):

json
{  "mcpServers": {    "json-shaper-lite": {      "command": "uvx",      "args": ["json-shaper-lite", "mcp"]    }  }}

uvx --from json-shaper-lite json-shaper-lite-mcp starts the same server.

Tools:

  • shape_text_to_json(text, format="auto"): for text in the chat.
  • shape_file_to_json(path, format="auto"): for a text file on your computer (.txt, .csv, .tsv, .md, up to 5 MB).

Both return {"format": "csv", "data": [...]}. format can be auto, kv, csv or markdown.

For AI agents

  • Use when: you have plain text in key: value lines, CSV/TSV, or a Markdown table and need typed JSON.
  • Don't use when: the input is already JSON, it's app logs, or it's nested data. Use the paid version for logs.
  • Input: text on stdin or a file path. Optional --format kv|csv|markdown.
  • MCP: uvx json-shaper-lite mcp gives two read-only tools, shape_text_to_json and shape_file_to_json.
  • Output: with --json, one object: {"ok": true, "format": "csv", "data": [...]}. On error ok is false. Exit code 0 ok, 1 error.
  • Hint lines go to stderr only, and only in a terminal, so stdout is always clean JSON. See also llms.txt.

Lite vs paid

lite (free)json-shaper
key: value notes, CSV/TSV, Markdown tablesyesyes
App logs (timestamp, level, message, key=value fields)noyes
One-line US address splitternoyes
tool.json manifest for scripts and AI agentsnoyes

Tests

pip install "mcp>=1.10,<2"python3 -m unittest discover tests

The MCP tests are skipped if mcp is not installed.

License

MIT. See LICENSE.

來源:README.md,提交 4d49aa2

工具

2

shape_text_to_json

Turn text into JSON

Turn pasted text (key: value notes, CSV/TSV or a Markdown table) into typed JSON. Use this when you have plain-text records or a table in the conversation and need clean JSON you can trust, without guessing values yourself. It is plain code, not an AI model, so the same text always gives the same JSON and nothing is made up. Do not use it when the text is already JSON, is nested data, is app logs, or is a file on disk (use shape_file_to_json for files). format: "auto" (default) picks for you. Or force "kv" (key: value or key=value lines, a blank line starts a new record), "csv" (comma, semicolon, tab or | separated, first row is the header) or "markdown" (a | pipe | table, first row is the header). Returns {"format": <format used>, "data": <JSON>}. data is a list of records for CSV and tables. For key: value text it is one object, or a list when blank lines split it into several records. Keys become lower_snake_case. Numbers become numbers, yes/no and true/false become booleans, empty or "null" becomes null.

輸入參數text必填format

shape_file_to_json

Turn a text file into JSON

Read a local text file (key: value notes, .csv, .tsv or a Markdown table) and return typed JSON. Use this when the data is in a file on this computer, so you don't have to paste it. The file is only read, never changed. Do not use it for Excel (.xlsx), PDF or other binary files, for files that are already JSON, or for app logs. path: full path to a UTF-8 text file, up to 5 MB. format: "auto" (default) picks for you. Or force "kv" (key: value or key=value lines, a blank line starts a new record), "csv" (comma, semicolon, tab or | separated, first row is the header) or "markdown" (a | pipe | table, first row is the header). Returns {"format": <format used>, "data": <JSON>}, the same as shape_text_to_json.

輸入參數path必填format

版本歷史

1
  1. v1.1.0最新Nov 4, 2026

評分

已滿足適用檢查項的 90%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分
  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分