sheets-mcp
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.
Want Claude, Cursor or any MCP agent to answer questions about your spreadsheets without uploading them or risking edits? Start here. sheets-mcp loads local CSV and XLSX files into an in-memory SQLite database and gives the agent three read-only tools: list, describe, query.
sheets-mcp
Read-only SQL over local CSV and XLSX files for AI agents. One small MCP server, zero required dependencies.
Real output: a CSV (orders) joined with a sheet from an XLSX workbook (catalog_products). The prompt line is shortened; the full query is in Quick start.
Why
Agents are good at SQL and bad at reading 10,000 spreadsheet rows pasted into a chat. Pointing them at a real database means credentials and write access.
sheets-mcp sits in between: your files stay on your machine, get loaded into a throwaway in-memory database on start, and the agent can only run SELECT.
Related MCP server: csvql
Features
π Point at files or folders:
.csv,.tsv,.txt,.xlsx,.xlsm; each CSV becomes a table, each XLSX sheet becomesworkbook_sheetπ Read-only by construction: in-memory copy, SQLite authorizer allows only
SELECT/read/function actions, one statement per call, row cap and time limitπ§ Agent-friendly schema: snake_case column names (original names kept), inferred
INTEGER/REAL/TEXTtypes, leading-zero codes kept as textπ
describe_tablereturns nulls, distinct counts, min/max and sample rows, so the agent writes the right query first timeπ§Ύ Messy CSV tolerant: delimiter sniffing (
,;tab|), UTF-8 with BOM or cp1252, ragged rows, duplicate or empty headersπ₯οΈ CLI too:
tablesandquerycommands to see exactly what the agent seesπͺΆ No required dependencies (
openpyxlonly for XLSX); MCP stdio protocol implemented in ~100 lines
Quick start
pip install "sheets-mcp[xlsx] @ git+https://github.com/purkat0301-sys/sheets-mcp"
sheets-mcp tables ./my-data
sheets-mcp query ./my-data --sql "SELECT p.category, COUNT(*) AS orders, SUM(o.qty) AS units, ROUND(SUM(o.qty * o.unit_price), 2) AS revenue FROM orders o JOIN catalog_products p USING (sku) GROUP BY 1 ORDER BY revenue DESC"Then add it to your MCP client (Claude Desktop, Cursor, VS Code, ...), as in examples/mcp.json:
{ "mcpServers": { "sheets": { "command": "sheets-mcp", "args": ["/path/to/my-data"] } } }The server answers the standard MCP handshake. Checked with mcp-preflight in CI:
How it works
flowchart LR
F[CSV / XLSX files] -->|sniff, decode, infer types| DB[(in-memory SQLite)]
A[AI agent] -->|tools/call| S[sheets-mcp]
S --> T1[list_tables]
S --> T2[describe_table]
S --> T3[query]
T3 -->|authorizer: SELECT only<br/>row cap, timeout| DB
DB --> S --> ATool | Input | Returns |
| none | table names, source file / sheet, row counts, columns |
|
| column types, nulls, distinct, min, max, sample rows |
|
|
|
Anything other than a read is refused:
Compared with the inspiration
The idea comes from the reference SQLite MCP server (now archived), which works on a SQLite database file. sheets-mcp is a new implementation focused on spreadsheets and safety.
sheets-mcp | Reference SQLite server | |
Works directly on CSV / XLSX | β | β needs a |
Read queries | β
| β
|
Write / create table tools | β by design | β
|
Enforcement | SQLite authorizer + in-memory copy | see project |
Column stats in describe | β | see project |
Row cap and query timeout | β | see project |
Required runtime dependencies | none (openpyxl for XLSX) |
|
Maintained | β | archived |
FAQ
Does it change my files? No. Files are read once at start into memory; nothing is written back.
Do edits to the files show up? Restart the server (your MCP client usually has a restart button). Live reload is on the roadmap.
How big can files be? Everything is held in memory. Tens of MB load in seconds; for multi-GB data use a real database.
Dates? XLSX dates become ISO text (2026-09-01), so date(), strftime() and string comparison work.
Limitations
Type inference is per column and simple (integer, real, text); dates are stored as text.
Formulas in XLSX are read as their cached values (
data_only); a file never opened in Excel may have empty formula cells.Not on PyPI yet; install from GitHub.
Roadmap
See ROADMAP.md: file watching and reload, Parquet/JSON, --table renames, per-column date detection.
Related tools
By the same author: mcp-preflight (check MCP configs and probe servers) Β· csv-rescue (repair broken CSV exports) Β· pdf-tables-mcp (invoice PDFs to data for agents)
Contributing
Issues and pull requests are welcome. pip install -e '.[dev]' && pytest. Security-relevant changes (anything touching the authorizer) need a test in test_writes_and_tricks_are_rejected.
License
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
The all-in-one data stack for agents. Upload files, run SQL, evolve tables, and render charts.
Explore, query, and inspect SQLite databases with ease. List tables, preview results, and view detβ¦
AI access to Quadratic spreadsheets: open files, run Python/SQL, query connected databases.
Open, inspect, filter, edit and convert xlsx and csv files from your AI chat. Processing is local.
Related MCP Servers
- AlicenseAqualityDmaintenanceLets AI agents query local SQLite database files read-only using Node's built-in sqlite module, providing tools for listing tables, describing schemas, and running SQL queries.37 npmMIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to run SQL analytics directly on CSV files in place via MCP, avoiding imports and token-heavy data pasting. It provides read-only querying, schema inspection, and file listing while keeping data local.32MIT
- AlicenseAqualityBmaintenanceEnables AI agents to inspect database schemas and run strictly read-only SQL queries with guardrails against destructive statements, multi-statement chaining, and unbounded scans. Supports SQLite natively and PostgreSQL optionally.430 PyPIMIT
- AlicenseAqualityCmaintenanceEnables AI agents to explore and query SQLite databases through read-only, sandboxed tools for listing tables, describing schemas, fetching DDL, and running a single capped SELECT statement. Also supports plain-English questions that are converted to SQL and routed through the same sandbox.4MIT