json-shaper-lite
This MCP server turns plain-text records and tables into typed JSON using two read-only tools.
shape_text_to_json: converts pastedkey: valuenotes, CSV/TSV, or Markdown tables into JSON.shape_file_to_json: reads a local UTF-8 text file (.txt,.csv,.tsv,.md, up to 5 MB) and converts it to JSON.Supports
auto,kv,csv, andmarkdownformats.Returns
{"format": ..., "data": ...}with cleaned lower_snake_case keys and guessed numbers, booleans, and nulls.Both tools are read-only: they do not modify files or use the internet.
Not intended for already-JSON data, nested JSON, app logs, Excel/PDF/binary files, or US addresses.
Parses Markdown pipe tables (and other Markdown-formatted tabular content) into typed JSON records, using the first row as the header and converting values into numbers, booleans, and nulls.
json-shaper-lite
Free tool that turns key: value notes, CSV/TSV and Markdown tables into clean JSON.
Example
Input (menu.tsv from the tests folder):
Item Price In stock
Tea 2.50 yes
Cake 4 noOutput from an actual run of json-shaper-lite:
[
{
"item": "Tea",
"price": 2.5,
"in_stock": true
},
{
"item": "Cake",
"price": 4,
"in_stock": false
}
]Header names are cleaned, prices stay numbers, and yes/no become true/false. key: value notes and Markdown tables work the same way. This free tool makes flat JSON; it does not flatten nested JSON the other direction.
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.
Also searched as: ES: convertir CSV a JSON, notas a JSON / PT: converter CSV para JSON / DE: CSV in JSON umwandeln / FR: convertir un CSV en JSON / JA: CSVをJSONに変換
Related MCP server: docbot-mcp
Links
Website — product page with prices and options
Excel & CSV to JSON on Apify — a pay-per-use cloud tool for Excel and CSV files (not for
key: valuenotes or Markdown tables)Pro version on Gumroad — app logs and US address parsing
Install
pip install json-shaper-liteOr use pipx, which keeps it in its own space:
pipx install json-shaper-liteWant the newest code from GitHub instead?
pip install git+https://github.com/tidybytetools/json-shaper-liteOr 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-lite
json-shaper-lite export.csv
json-shaper-lite notes.md --format markdown
json-shaper-lite export.csv --json # {"ok": true, "format": "csv", "data": [...]}Output:
{"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:
from json_shaper_lite import shape
shape("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
007or 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.
Ragged rows. A CSV or Markdown row with more fields than the header is an error (exit 1). A short row keeps every header key and fills the missing ones with null.
No app logs or addresses. Those are in the paid version.
How it compares to other free tools
json-shaper-lite | csvkit | pandas | ||
Main job | messy text → JSON | nested JSON → flat (and back) | CSV → JSON | full data toolkit |
Install size | one file (pip adds | small | medium | large |
| yes | no | no | no |
Markdown tables | yes | no | no | no, not built in |
CSV/TSV | yes | no | yes | yes |
Guesses numbers and true/false | yes | no | yes | yes |
Nested JSON flatten/unflatten | no | yes | no | yes ( |
MCP server for AI apps | yes | no | no | no |
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 mcpClaude Desktop (claude_desktop_config.json) or Cursor (~/.cursor/mcp.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: valuelines, 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 mcpgives two read-only tools,shape_text_to_jsonandshape_file_to_json.Output: with
--json, one object:{"ok": true, "format": "csv", "data": [...]}. On errorokis 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) | ||
key: value notes, CSV/TSV, Markdown tables | yes | yes |
App logs (timestamp, level, message, key=value fields) | no | yes |
One-line US address splitter | no | yes |
| no | yes |
Tests
pip install "mcp>=1.10,<2"
python3 -m unittest discover testsThe MCP tests are skipped if mcp is not installed.
FAQ
What input does it take? key: value notes, CSV/TSV, or a Markdown table.
Do my files leave my computer? No. The tool runs on your computer and never uses the internet.
How is this different from the Pro version? Pro also parses app logs and one-line US addresses.
Does it work with AI apps? Yes. It includes a free MCP server. No API key.
License
MIT. See LICENSE.
Available Tools
2 toolsshape_file_to_jsonTurn a text file into JSONARead-onlyIdempotent
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": , "data": }, the same as shape_text_to_json.
Inputs: path (required), format.
shape_text_to_jsonTurn text into JSONARead-onlyIdempotent
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": , "data": }. 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.
Inputs: text (required), format.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 2 tools
The two tools are cleanly separated by input source: pasted text vs. a file on disk, and each description explicitly cross-references the other as the alternative. There is no realistic way to confuse them, and the shared format/output semantics reinforce rather than blur the boundary.
Both names follow the exact same shape_<source>_to_json pattern, differing only in the source noun (text vs. file). Verb, ordering and casing (snake_case) are perfectly consistent.
Two tools is on the thin side, but the server is explicitly scoped as 'lite' and the pair covers its stated purpose without filler. It sits at the borderline where the surface is minimal but not arbitrary.
Text and file inputs are both covered, with auto/kv/csv/markdown formats and a consistent output envelope, so common shaping workflows have no dead ends. Minor gaps exist (no reverse direction, no writing results back to a file, no JSON-to-table), but these are outside the declared narrow scope.
Maintenance
Related MCP Connectors
Remote MCP: JSON repair, JSON Schema validation, JSON to TypeScript, CSV to JSON and JSON to CSV.
Messy CSV, JSON, Excel, SPSS/Stata/SAS and PDF tables to typed Parquet; inspect, query, join.
Document conversion MCP server: PDF to Markdown, image OCR, spreadsheet parsing.
PDF, Word, PowerPoint and Excel to clean Markdown plus every table as JSON rows, OCR for scans.
Related MCP Servers
- AlicenseBqualityDmaintenanceLocal-first MCP server for Obsidian vaults with 66 tools for reading, writing, searching, and managing notes, tasks, graphs, and more. Works without Obsidian running and requires no plugins.66MIT
- AlicenseNot gradedqualityDmaintenanceBidirectional CSV ↔️ JSON ↔️ Markdown transformer exposed as an HTTP-based MCP server, enabling format conversion through natural language.MIT
- AlicenseNot gradedqualityBmaintenanceEnables converting Markdown and HTML tables into structured JSON records with automatic column type inference and format normalization. It also offers supporting web-agent primitives such as DOM semantic pruning, form field auto-mapping, and execution trajectory evaluation, all via a zero-dependency MCP server.7MIT
- FlicenseNot gradedqualityBmaintenanceEnables AI agents and MCP clients to convert ASCII/OCR text dumps, aligned spacing, and CSV/TSV data into clean GitHub Flavored Markdown tables and typed JSON deterministically.7-