sheet-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.
sheet-mcp — The Hard Way
Build an MCP server that lets an AI agent read and edit Excel files without damaging them.
You start from the zip inside an .xlsx and end with a server that refuses to save over a file it
would mutilate.
At the end you will have built a small version of sheet-mcp yourself, and you will understand the things most spreadsheet tutorials skip: what a formula cell really stores, what a library silently drops when it saves, and how to design edit tools an agent can use safely.
Why This Exists
Most "edit a spreadsheet with Python" examples are ws["A1"] = 5; wb.save(...). Run that on a real
workbook and you can lose the charts, the pivot tables, the macros, the cached results of every
formula, and never get an error. Hand that power to an AI agent unsupervised and the question
stops being "how do I write a cell" and becomes:
how do I know what a save will destroy before I do it?
how do I show a formula's value when nothing ever calculated it?
how do I make an edit the agent can preview, and the user can trust?
how do I open a file from the internet without being hurt by it?
Related MCP server: KitchenSink4XL
Who This Is For
Developers who have built a "hello world" MCP server and want a real one
Anyone who has been bitten by openpyxl silently dropping something
People who wonder what is actually inside an
.xlsx
Prerequisites: Python and a vague memory of Excel. No Excel installation is needed. Install the
dependencies with pip install -r requirements.txt.
Modules
# | Module | What You'll Build |
01 | A workbook written and read by hand with | |
02 | The three ways to open a workbook and their costs; dates, styles, merges | |
03 | Telling "empty" from "never calculated"; shared formulas; why a save drops every cached result; why not to write a calculator | |
04 | A part-name inventory, a refusal with | |
05 | Explicit coercion rules, dry run, guards for merged and array cells, atomic new-file writes, a before/after proof | |
06 | Tokenizer-based checks: R1C1 pattern outliers, hardcoded numbers, circular references | |
07 | A three-tool MCP server tested over real stdio, with sandbox and error handling |
Each module contains:
README.md: the concepts and design decisionsmain.py: a working, commented implementation that checks its own claims withassertbreak-it.md: challenges that break your own code, with hints
How To Use This Course
Option A: Build along. Read the modules in order, run each main.py, then do the break-it
challenges.
Option B: Reference. Each main.py stands alone; there are no imports between modules.
Option C: Use the finished tool. uvx sheet-mcp --dir /path/to/spreadsheets.
Every Module Is Verified
python verify.pyThis runs each main.py in a fresh process and fails if any assertion fails. CI does it on Linux
and Windows on every push and weekly, so the code in this course cannot silently stop working when
openpyxl or the MCP SDK change.
Architecture Overview
AI agent (Claude Code, Claude Desktop, ...)
│ MCP over stdio: JSON-RPC tool calls ← Module 07
▼
┌────────────────────────────────────────────────────────┐
│ MCP server: tools, sandbox, errors that reach the agent │ ← Module 07
│ ├── edits: coercion, dry run, guards, atomic write │ ← Module 05
│ ├── checks: tokenizer, R1C1, cycles │ ← Module 06
│ ├── safety: part inventory, zip + XML limits │ ← Module 04
│ ├── values: formula text vs cached result │ ← Module 03
│ └── files: openpyxl over the zip of XML │ ← Module 01, 02
└────────────────────────────────────────────────────────┘License
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
The Excel engine for AI agents: read, check and edit Excel models over MCP.
Preventive human-approval write-gate for AI agents: writes commit only after a human approves.
Every spreadsheet is a table: Excel, CSV, Parquet and JSON as SQL tables for AI agents.
AI-native data layer: sheets, databases and apps for every agent, with exact answers and audit.
Related MCP Servers
- AlicenseBqualityDmaintenanceProvides secure, agentic Excel analysis and calculation capabilities, enabling users to inspect workbook structure, perform statistical computations, write formulas, and generate outputs through whitelisted MCP tools with audit trails and backups.15MIT
- AlicenseAqualityBmaintenanceEnables AI agents to perform comprehensive Excel workbook operations with verified, freshness-labeled values and structural edits that preserve formulas, tables, and references, optionally using a private Excel instance for real recalculation and export.71AGPL 3.0

SumOffice MCP serverofficial
AlicenseNot gradedqualityBmaintenanceEnables AI agents to open, read, propose, and apply edits to real Word and Excel files while preserving macros, Power Query, and file integrity.MIT- AlicenseNot gradedqualityBmaintenanceEnables AI coding agents to edit real .xlsx workbooks in place through spreadsheet-native tools like describe, find, read, write, and structural edits, recalculating formulas without Excel, LibreOffice, or Python. Every change comes back as a review link showing changed cells before and after, and nothing is written until the user accepts, while charts, pivots, and VBA data return byte-identical.10Apache 2.0