sheet2json-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@sheet2json-mcp Convert pcb_bom_rev_b.xlsx to JSON using the bom schema"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
sheet2json-mcp
An MCP server that lets an AI agent turn messy spreadsheets into clean, validated JSON, on rails.
A lot of engineering and operations data still lives in hand-maintained Excel and CSV files: bills of materials, sensor logs, order lists. Asking an LLM to "just convert it" works until it quietly guesses a value, drops a row or invents a column. This server keeps the AI useful but constrained: the agent decides which file and which schema; deterministic Python code does the conversion and reports every problem.
"Convert pcb_bom_rev_b.xlsx to JSON"
│
▼
AI agent ──(MCP)──► list_files → inspect_file → convert_file
│
fixed JSON Schemas ──────────┤
▼
valid records + row-level error report
(JSON file written only if every row is valid)The rails
Guard rail | Why |
Files can only be read from one data folder (path traversal is blocked) | The agent can't wander the file system |
Only predefined JSON Schemas can be targeted | Output shape is always the same; the agent can't invent fields |
Every rejected value is reported with row, field, value and reason | Nothing is dropped or "fixed" silently |
Ambiguous numbers such as | No silent 3.3 → 33 mistakes |
Duplicate keys (e.g. the same designator twice) are flagged | Catches copy-paste errors in BOMs |
Output is written only when all rows are valid | Partial data never reaches downstream systems |
Tool responses return a preview (20 records, 50 errors) | Keeps the agent's context small; full data goes to the file |
A skill file tells the agent the exact workflow and how to report | Consistent behaviour across conversations |
Related MCP server: dvq
What it handles
.xlsx,.xlsm(any sheet) and.csv(auto-detects,;tab|delimiters, UTF-8 or Windows-1252)Messy headers:
Part No.,MPNandpart_numberall map to the same field, using aliases defined in the schemaDanish formats: decimal comma (
72,5),dd-mm-yyyydates, Danish column names (Værdi,Enhed,Antal)Type conversion to integer, number, boolean, enum (case-insensitive, returned in canonical form), date and date-time
Tools
Tool | What it does |
| Lists the target schemas, their fields and which are required |
| Lists CSV/Excel files in the data folder |
| Shows sheets, headers, sample rows and which schema fits best |
| Converts and validates; optionally writes the JSON when there are no errors |
Included schemas
bom: PCB bill of materials (designators, part number, manufacturer, quantity, unit price…)sensor_readings: time-stamped temperature / pressure / flow / humidity readings, e.g. from a district heating substation
Adding a schema means dropping a *.schema.json file (standard JSON Schema 2020-12) into
the schema folder. Two extra keys are supported: x-aliases on a property (alternative
column names) and x-unique-key on the schema (fields that must be unique per row).
Example
examples/data/pcb_bom_rev_b.xlsx has inconsistent headers and three bad rows. Result of
convert_file(path="pcb_bom_rev_b.xlsx", schema="bom") (shortened):
{
"rows_read": 6, "valid_rows": 3, "invalid_rows": 3,
"column_mapping": { "designators": "Ref Des", "part_number": "Part No.", "quantity": "Qty", "...": "..." },
"unmapped_columns": ["Notes"],
"errors": [
{ "row": 5, "field": "quantity", "value": "one", "message": "'one' is not a number" },
{ "row": 6, "field": "part_number", "message": "'part_number' is a required property" },
{ "row": 7, "field": "designators", "message": "Duplicate of row 3 ({'designators': 'C1'})" }
],
"records_preview": [ { "designators": "R1, R2, R5", "part_number": "RC0603FR-0710KL", "quantity": 3, "unit_price_dkk": 0.12, "...": "..." } ]
}Install
Requires Python 3.10+.
git clone https://github.com/<tony-allex>/sheet2json-mcp.git
cd sheet2json-mcp
pip install -e ".[dev]"
pytest # 17 tests, including end-to-end tests through a real MCP clientUse with Claude Code
claude mcp add sheet2json \
--env SHEET2JSON_DATA_DIR=/path/to/your/spreadsheets \
--env SHEET2JSON_OUTPUT_DIR=/path/to/output \
-- sheet2json-mcpCopy skills/sheet2json/ into your skills folder (e.g. .claude/skills/) so the agent follows the workflow.
Use with Claude Desktop (or any MCP client)
{
"mcpServers": {
"sheet2json": {
"command": "sheet2json-mcp",
"env": {
"SHEET2JSON_DATA_DIR": "/path/to/your/spreadsheets",
"SHEET2JSON_OUTPUT_DIR": "/path/to/output"
}
}
}
}Environment variable | Default | Meaning |
|
| The only folder files can be read from |
|
| Where validated JSON is written |
| built-in | Folder with |
Try it on the examples by pointing SHEET2JSON_DATA_DIR at examples/data
(regenerate them with python examples/make_examples.py).
Project layout
src/sheet2json/core.py conversion logic (no MCP dependency, easy to test and reuse)
src/sheet2json/server.py MCP tools: a thin layer over core.py
src/sheet2json/schemas/ JSON Schemas (the "rails")
skills/sheet2json/SKILL.md instructions for the AI agent
tests/ unit tests + end-to-end MCP testsIdeas for next steps
A
write_to_databasetool (e.g. MongoDB or Azure Cosmos DB) behind the same validationDeploy over streamable HTTP in a container (Azure Container Apps) so a team can share one server
A schema for component data that checks part numbers against a supplier API
Available Tools
4 toolsconvert_fileA
Convert a spreadsheet into JSON records that match one of the predefined schemas.
Every row is either converted and validated, or listed in errors with its row
number and reason. Rows are never silently dropped or corrected.
Args: path: File path relative to the data folder. schema: Name of the target schema (see list_schemas). sheet: Excel sheet name. Defaults to the first sheet. decimal_separator: "." (1,234.5) or "," (1.234,5 - common in Danish files). write_output: Save the result as JSON in the output folder. Only allowed when there are no errors, so partial data never ends up downstream.
Inputs: path (required), schema (required), sheet, write_output, +1 more. Returns: object
inspect_fileARead-only
Show the sheets, column headers and first rows of a file, and which schemas fit it best.
Args: path: File path relative to the data folder, as returned by list_files. sheet: Excel sheet name. Defaults to the first sheet. Ignored for CSV. sample_rows: Number of example rows to return (1-20).
Inputs: path (required), sheet, sample_rows. Returns: object
list_filesARead-only
List the CSV and Excel files available in the data folder.
Inputs: no named parameters. Returns: object
list_schemasARead-only
List the target schemas data can be converted into, with their fields and which are required.
Inputs: no named parameters. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool maps to a distinct step in the workflow: listing schemas, listing files, inspecting a file, and converting. There is no overlap in purpose, and the natural pipeline order makes selection unambiguous.
All four tools follow a consistent snake_case verb_noun pattern (list_schemas, list_files, inspect_file, convert_file). The convention is predictable and easy to reason about.
Four tools is a tight, focused surface that matches the bounded spreadsheet-to-JSON scope. It sits at the minimal end, with arguably room for a small output-retrieval tool, but nothing feels padded.
The core discover-inspect-convert lifecycle is fully covered, including validation and error reporting. The main gap is that converted output written via write_output cannot be listed or read back with any provided tool, leaving a minor dead end.
Maintenance
Related MCP Connectors
Turn messy text into strict JSON schemas agents can trust (invoice, receipt, contact, resume).
Extract custom JSON schemas and Excel/CSV tables from PDFs, invoices, statements, and receipts.
Turn a JSON file or pasted JSON into an Excel workbook and a CSV, right in the chat.
Deterministic JSON repair, validate, example-gen, schema-coerce for agents. Zero LLM, sub-10ms.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables LLMs to automatically generate Excel files with custom structures, advanced formatting, multiple sheets, formulas, and charts from JSON schemas, with support for both local and remote deployment.1MIT
- AlicenseNot gradedqualityBmaintenanceExposes data validation as tools so an AI agent can check whether data is actually correct before using it, scoring CSV files with per-row problem details, catching impossible dates, inferring schemas, and generating readable reports.13 npmMIT
- AlicenseNot gradedqualityBmaintenanceEvery live trading feed is a table: today it serves your CSV, Parquet and JSON files to AI agents as SQL tables (Apache DataFusion), with joins across files, schema and column statistics.1Apache 2.0
- AlicenseAqualityBmaintenanceEnables AI agents to deterministically profile, clean, normalize, and validate tabular data, including locale-aware numbers, dates, text encoding, IDs, and CSV/XLSX/JSON inputs, while flagging ambiguous values instead of guessing.633 PyPIBusiness Source 1.1