SheetMCP
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
SheetMCP
The Excel / CSV MCP server that actually works. Read formulas and values, run SQL across a whole folder of spreadsheets, clean messy data, write safely without breaking formatting (with undo), audit formulas, and build formatted reports with charts in one call. Pure Python, runs on macOS / Linux / Windows, no Excel, no API keys, no cloud.
pip install ./packages/core ./packages/server # from a clone of this repo
sheetmcp install ~/Documents/spreadsheets # adds SheetMCP to Claude Desktop / Cursor / Windsurf ...
sheetmcp doctor # checks that everything worksThen ask your AI: "Take a quick look at my spreadsheets and tell me what's there."
Why SheetMCP?
Common complaint about Excel MCPs | SheetMCP |
"It only reads values, not formulas" |
|
"Formulas show empty because the file was made by a script" | Built-in evaluator (140+ Excel functions incl. dynamic arrays, LET, financial, |
"Can't work across many CSV/xlsx files" |
|
"Only works on Windows (COM)" | Pure Python: openpyxl + DuckDB, works everywhere |
"60 tools, the model gets confused" | 24 focused tools with plain-language descriptions; |
"Setup is JSON-file fiddling" |
|
"My data is messy" |
|
"The AI broke my file" | Every write is backed up; |
"Can't open old .xls / LibreOffice files" |
|
"Writes broke my formatting / formulas" | Only cell values change, formatting/charts/tables preserved, auto-backup, |
"Inserting a row broke all formulas" |
|
"Huge output blew up the context" | Row limits, paging ( |
"Cryptic errors" | Every error says what went wrong and how to fix it (with did-you-mean) |
"Needs an API key / account" | None. Local files only, sandboxed to folders you choose |
Related MCP server: Excel MCP Server
1-minute quickstart
SheetMCP is not on PyPI yet, so install it from this repository (or the release zip):
git clone https://github.com/cryptodeta/sheetmcp && cd sheetmcp
pip install ./packages/core ./packages/server # add ./packages/cli for the `sheetcli` tool
# optional: legacy .xls support
pip install xlrd(With uv: uv sync and prefix commands with uv run.)
Easiest: sheetmcp install
sheetmcp install ~/Documents/spreadsheets # every AI app found on this computer
sheetmcp install . --client cursor --client vscode # pick apps (claude-desktop, cursor, vscode, windsurf, claude-code, all)
sheetmcp install ~/data --read-only # no write tools
sheetmcp install ~/data --dry-run # show what would change
sheetmcp install ~/data --print # just print the JSON snippet
sheetmcp uninstall # remove it again
sheetmcp doctor # versions, sandbox self-test, folders, configured appsinstall merges into existing config files (other servers are kept, the old file is backed up), uses the
current Python interpreter, and works on Windows, macOS and Linux. VS Code and Claude Code configs are written
to the project folder (.vscode/mcp.json, .mcp.json). Restart / reload the app afterwards.
Try it without an AI app:
sheetcli --root ./examples/data look
sheetcli --root ./examples/data query "SELECT Region, sum(Revenue) FROM sales GROUP BY 1" --mdManual configuration
The snippets below use uvx sheetmcp, which works once the package is published or installed as a uv tool
(uv tool install ./packages/server). With a plain pip install, use "command": "sheetmcp" (or the full
path of your Python with "args": ["-m", "sheetmcp", "<folder>"]). The default folder is the current
directory when none is given.
Claude Desktop
~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"sheets": {
"command": "uvx",
"args": ["sheetmcp", "/Users/you/Documents/spreadsheets"]
}
}
}Cursor
~/.cursor/mcp.json (global) or .cursor/mcp.json (project):
{
"mcpServers": {
"sheets": {
"command": "uvx",
"args": ["sheetmcp", "${workspaceFolder}"]
}
}
}VS Code (Copilot agent mode)
.vscode/mcp.json:
{
"servers": {
"sheets": {
"type": "stdio",
"command": "uvx",
"args": ["sheetmcp", "${workspaceFolder}"]
}
}
}Windsurf
~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"sheets": {
"command": "uvx",
"args": ["sheetmcp", "/path/to/spreadsheets"]
}
}
}Claude Code
claude mcp add sheets -- uvx sheetmcp "$PWD"Generic HTTP (any client that supports Streamable HTTP)
uvx sheetmcp /data --transport http --host 127.0.0.1 --port 8000
# endpoint: http://127.0.0.1:8000/mcp{ "mcpServers": { "sheets": { "url": "http://127.0.0.1:8000/mcp" } } }Docker
docker build -t sheetmcp .
docker run --rm -i -v "$PWD/data:/data" sheetmcp # stdio
docker run --rm -p 8000:8000 -v "$PWD/data:/data" sheetmcp --transport http --host 0.0.0.0More snippets (read-only mode, multiple folders, env vars) in examples/configs/.
Tools (24)
Start here
Tool | What it does |
| One call: a folder's files with sheets, row counts, columns and SQL table names, or one file's column stats, quality score, issues, formula errors, preview and suggested next steps |
| Allowed folders, read-only mode, limits, tips |
| Find xlsx/xlsm/xls/ods/html/csv/tsv/parquet/json files (with sheet names) |
| Sheets, sizes, tables, named ranges, merged cells, formula counts, charts, inferred column types, preview |
Read & write
Tool | What it does |
| Values and formulas side by side, auto-computes uncached formulas, paging, JSON or markdown |
| Write values/formulas (2D block, single cells, append rows), fill a formula down a column ( |
| Create workbook; add / rename (updates references) / delete / copy / move / hide sheets |
| Insert/delete rows/columns with formulas, named ranges, tables, merged cells, conditional formats, validations and filters updated |
| Excel Tables (create/delete, usable as |
| List backups, |
| Run up to 100 operations in one call |
Analyse & transform
Tool | What it does |
| DuckDB SQL across many files at once: joins, aggregates, window functions, CTEs; no |
| Filter / select / rename / sort / distinct / dedupe without writing SQL |
| Group-by summaries and pivot tables |
| Append (aligns columns by name) or join several files/sheets |
| Cleaning pipeline: trim, case, find/replace (regex), split, merge, fill down, fill blanks, to_number, to_date (mixed formats), drop empty rows, dedupe, drop/keep/rename columns, filter, sort, computed columns; preview, save, or clean a sheet in place |
| xlsx / xls / ods / html ⇄ csv ⇄ tsv ⇄ parquet ⇄ json ⇄ jsonl → markdown; all sheets at once; Excel- and Google-Sheets-friendly CSV |
| Column stats + data-quality issues (duplicates, numbers-as-text, whitespace, outliers, inconsistent category spellings, anomalies with row numbers, empty/constant columns) |
|
|
| Find text/regex in every cell (and formula) of every file in a folder |
| Compare files/sheets cell-by-cell (incl. formulas) or row-level by key columns |
Format & report
Tool | What it does |
| Fonts, fills, number formats (incl. ৳ BDT, $, €), borders, widths/autofit, freeze panes, merge, filters, conditional formatting, dropdown validation |
| Native Excel charts: column, bar, line, pie, scatter, area |
| One call: Summary sheet (grouped metrics, live-formula totals row, styled header, number format, chart) + filterable Data sheet |
Plus resources (sheet://files, sheet://describe/{path}, sheet://preview/{path}/{sheet}, one per file)
and prompts (analyze_spreadsheet, clean_data, audit_formulas, compare_files, build_report).
Full reference: docs/tools.md.
SQL across files
Files in the root folder are tables automatically:
-- sales.xlsx (first sheet) ⨝ customers.csv ⨝ targets.parquet
SELECT c.Country, s.Region, sum(s.Revenue) AS revenue, any_value(t.Target) AS target
FROM sales s
JOIN customers c ON c.Customer = s.Customer
JOIN targets t USING (Region)
GROUP BY ALL ORDER BY revenue DESCbook.xlsx→book(first sheet),book__<sheet>for other sheets (lower-case, non-alphanumerics →_).Any path:
SELECT * FROM 'reports/2024/q1.xlsx#Summary'.Explicit aliases:
tables={"s": "data/sales.xlsx#2024"}.Don't know the names? Call
querywith no SQL, orquick_look, to list every table and its columns..xls,.odsand HTML files work too:budget.ods→budget/budget__<sheet>, each HTML<table>is a sheet.Only
SELECTis allowed; DuckDB file access is locked to your folders.
Cleaning data
{"source": "raw/customers.csv",
"operations": [{"op": "trim"}, {"op": "dedupe"},
{"op": "to_number", "columns": ["CreditLimit"]},
{"op": "to_date", "columns": ["Joined"], "dayfirst": true},
{"op": "fill_down", "columns": ["Region"]}],
"output": "clean/customers.xlsx"}Without output you get a preview. Passing the same .xlsx as output cleans that sheet in place (styles,
tables and other sheets are kept, and a backup is made).
Formulas
The evaluator computes formulas that have no cached value (files written by scripts) with 140+ functions:
math/stats, lookup (XLOOKUP, INDEX/MATCH...), text (TEXTBEFORE/AFTER, TEXTSPLIT...), dates (EOMONTH,
NETWORKDAYS, WORKDAY, DATEDIF...), financial (PMT, FV, PV, NPER, RATE, NPV, IRR), logic (LET, SWITCH, IFS),
dynamic arrays (FILTER, UNIQUE, SORT, SORTBY, SEQUENCE, VSTACK, HSTACK, TAKE, DROP, CHOOSECOLS...), array
math like SUM(B2:B9*C2:C9), and structured references (Sales[Qty], [@Price], Sales[#Totals]).
Configuration
CLI flag | Env var | Default | Meaning |
|
| current dir | Folders the server may touch (sandbox) |
|
| off | Hide/disable all write tools |
|
| backups on | Copy files to |
| 10 | Backups kept per file | |
|
| 100 | Default rows per response |
| 500 | Long text truncated in responses | |
|
|
|
|
|
| 127.0.0.1 / 8000 | HTTP bind address |
|
| WARNING | Logs go to stderr |
Safety
Sandbox: every path is resolved (symlinks too) and must live inside an allowed root. DuckDB runs with
enable_external_access=false+allowed_directories+ locked configuration, so SQL cannot read other files, install extensions or reach the network.Read-only mode hides every write tool.
Dry run on every write tool shows exactly which cells would change.
Automatic backups (
.sheetmcp_backups/<name>.<timestamp>.xlsx) and atomic saves (write temp → rename), so a crash never leaves a half-written file.backups(action="undo")reverts the latest change.
Python library & CLI
from sheetmcp_core import Sheets, Config
s = Sheets(Config(roots=["./data"]))
s.read_range("sales.xlsx", "Summary", "A1:C6") # values + formulas
s.query("SELECT * FROM sales WHERE Units > 30", output="big_orders.xlsx")
s.formulas("model.xlsx", "errors")
s.quick_look(".") # overview of the folder
s.clean("raw.csv", [{"op": "trim"}, {"op": "dedupe"}], output="clean.xlsx")
s.build_report("sales.xlsx", "report.xlsx", group_by=["Region"], metrics=["Revenue:sum", "count"])
s.backups("sales.xlsx", "undo")sheetcli ls data/
sheetcli describe data/sales.xlsx
sheetcli formulas data/sales.xlsx errors
sheetcli diff v1.xlsx v2.xlsx
sheetcli look data/
sheetcli clean data/raw.csv trim dedupe to_number:Amount -o data/clean.xlsx
sheetcli report data/sales.xlsx report.xlsx -g Region -m Revenue:sum -m count
sheetcli backups data/sales.xlsx --undoPerformance (laptop-class VM, Python 3.13)
Operation | Time |
GROUP BY over a 500k-row CSV (9 MB) | ~0.1–0.5 s |
First SQL over a 100k-row xlsx (converted once, cached by mtime) | ~2.5 s |
Repeat SQL over the same xlsx | ~0.5 s |
Profile 500k-row CSV | ~1 s |
CSV → Parquet (500k rows) | ~0.2 s |
xlsx files above 8 MB are streamed (openpyxl read-only mode); appending rows to a CSV streams without
rewriting the file. Core dependencies: openpyxl + duckdb only (xlrd optional for .xls).
Repository layout
packages/core sheetmcp-core: the engine (no MCP dependency)
packages/server sheetmcp: MCP server (stdio + streamable HTTP), tools/resources/prompts
packages/cli sheetmcp-cli: `sheetcli` terminal tool
examples/ sample data generator, client configs, Python usage
docs/ tool reference, architecture
tests/ pytest suite (fixtures generated on the fly)Development
uv sync # create .venv with all workspace packages + dev tools
uv run pytest # 200 tests
uv run ruff check . && uv run ruff format --check .
uv run sheetmcp examples/data # run the server
npx @modelcontextprotocol/inspector uv run sheetmcp examples/data # inspect interactivelySee CONTRIBUTING.md. License: MIT.
Known limitations
Not published to PyPI yet: install from this repository (see Quickstart).
uvx sheetmcpworks only afteruv tool install ./packages/serveror a future PyPI release..xls,.odsand HTML are read-only inputs (convert to.xlsxto edit)..xlsneeds the optionalxlrdpackage (pip install xlrd, or thexlsextra). Password-protected files can't be opened.openpyxl preserves most content but drops some exotic objects on save (shapes, form controls, some chart styling, slicers, external-data connections). Pivot tables are kept but not refreshed.
The formula evaluator covers 140+ functions; others (e.g. LAMBDA/MAP, cube and web functions) return
#NAME?and are reported. Excel's own cached values are always preferred when present. External workbook links are not evaluated.Cleaning a sheet in place replaces formula cells inside the cleaned table with their values (reported in the response; undo with
backups).sheetmcp installwrites configs that point at the Python interpreter it runs from; re-run it if you move or recreate that environment.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Open, inspect, filter, edit and convert xlsx and csv files from your AI chat. Processing is local.
Open, inspect, filter, edit and convert xlsx and csv files from your AI chat. Processing is local.
AI access to Quadratic spreadsheets: open files, run Python/SQL, query connected databases.
The all-in-one data stack for agents. Upload files, run SQL, evolve tables, and render charts.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to read, write, and manipulate Excel files through comprehensive spreadsheet operations. Supports file management, data querying, worksheet operations, formula calculations, and includes security features like path validation and automatic backups.2MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to create, read, and manipulate Excel files without requiring Microsoft Excel installation. Supports comprehensive spreadsheet operations including formulas, formatting, charts, pivot tables, and data validation.MIT
- AlicenseBqualityBmaintenanceEnables LLMs to work with Excel and CSV files through structured tools for workbook operations, formatting, charts, ETL, analysis, and more.695MIT
- AlicenseAqualityDmaintenanceEnables AI assistants to read and write local Excel and CSV files, supporting editing, styling, and image insertion.15MIT