csvto-mcp
v0.1.2
Published
MCP server for local CSV, JSON and Excel conversion. Converts files on your own machine and never uploads them, and returns summaries instead of pulling whole files into the model's context.
Maintainers
Readme
csvto-mcp
An MCP server for converting CSV, JSON and Excel files — on the machine it runs on.
Point your assistant at a file path and it writes the converted file next to it. Nothing is uploaded anywhere, and the file's contents never pass through the model's context.
Why this exists
Two problems with asking an AI assistant to convert a spreadsheet:
- The file has to go somewhere. Pasting it into the chat sends your data to a model provider; using a web converter sends it to that service's servers. Spreadsheets are exports — customer lists, payroll, transactions — and often shouldn't leave the machine.
- Large files don't fit. A 50,000-row CSV pasted into a conversation is expensive, slow, and frequently just doesn't fit.
This server takes a path, does the work locally, and returns a short summary. A 200MB file costs the same number of tokens as a 2KB one.
Install
Claude Code:
claude mcp add csvto -- npx -y csvto-mcpOr in any MCP client's config:
{
"mcpServers": {
"csvto": { "command": "npx", "args": ["-y", "csvto-mcp"] }
}
}Requires Node 18+.
Tools
| Tool | Does |
| --- | --- |
| inspect_file | Columns, row count, detected types and parse warnings for a CSV, JSON or Excel file |
| read_rows | A slice of rows, with optional search and sorting — read part of a large file without loading all of it |
| csv_to_excel | CSV → .xlsx workbook |
| csv_to_json | CSV → JSON, as objects or arrays |
| csv_to_pdf | CSV → paginated PDF table, headers repeated on every page |
| csv_to_sql | CSV → CREATE TABLE plus batched INSERTs (ANSI/PostgreSQL or MySQL) |
| csv_to_xml | CSV → XML |
| csv_to_markdown | CSV → a Markdown table |
| json_to_csv | JSON → CSV |
| excel_to_csv | .xlsx → CSV |
Types are inferred per column, not per cell
This is the part that matters, and it's where most converters quietly corrupt data.
A column is converted to numbers only if every value in it survives the round trip exactly. If one value would change, the whole column stays text. So:
01234keeps its leading zero instead of becoming1234- A 16-digit account number stays itself instead of becoming
1.23457E+14 1250.50keeps its trailing zero instead of becoming1250.5- A column never ends up as a mix of numbers and strings
Verified: 01234 survives a CSV → xlsx → CSV round trip intact.
Other behaviour worth knowing:
- JSON → CSV takes the union of keys across all records, so fields that only appear in later records aren't dropped. Nested values are serialised back to JSON in the cell rather than discarded.
- CSV → SQL escapes single quotes (
O'Brien→'O''Brien') and infers a type per column, so an identifier column staysTEXT. - CSV → XML rewrites column names that aren't valid element names (
first name→first_name) rather than emitting a file no parser can read. - CSV → PDF is limited to the latin-1 character set. Characters outside it become question marks, and the tool tells you exactly which ones rather than letting you discover it later.
Example
> Inspect ~/exports/orders.csv, then convert it to Excel
inspect_file → orders.csv (csv): 48,210 rows, 9 columns.
Columns: order_id, customer, city, zip, amount, ...
csv_to_excel → Converted orders.csv -> ~/exports/orders.xlsx
48,210 rows, 9 columns.
Conversion ran locally. No file contents were uploaded anywhere.The same tools in a browser
Everything here also runs as a web tool at csvtosite.com, using the same conversion engine, also entirely client-side.
Licence
MIT
