MCP server for accurate, structure-preserving read/write access to Excel (.xlsx) files
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
We haven't yet run this listing's install command through our automated sandbox check. This isn't a red flag β we're steadily working through the catalog.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
An MCP server for reading and writing Excel (.xlsx) files with high accuracy, while preserving the file's existing structure, styles, and formulas.
xlsx-tools-mcp exposes 20 Model Context Protocol (MCP) tools that give an LLM agent accurate, structure-preserving read and write access to Excel .xlsx files. It runs as a standard stdio MCP server: you install it and register it with an MCP client (Claude Code, OpenCode, etc.), and the client's agent can list sheets, read cell ranges, search values, aggregate data, write cells/formulas, manage sheets/rows/columns, apply styles, and force formula recalculation.
It is built around the principle that editing an existing workbook should not destroy what it doesn't touch.
errors_found β any Excel error values (#REF!, #DIV/0!, #N/A, β¦) produced by the recalculation.aggregate_sheet groups and aggregates on top of the normal read path, so merged cells and styling in the source range are preserved before flattening.<path>.lock file (filelock), so writes never interleave and corrupt the file.defusedxml package is an automatic dependency; openpyxl detects it and uses its hardened XML parser, so hostile xlsx XML can't expand into resource exhaustion.XLSX_MCP_FILES to preload one or more workbooks; tools can then be called with path omitted or with a short alias instead of a full filesystem path.Live via pypistats.org, non-mirror downloads. These count download events, not unique users or installs β one user can trigger many downloads (CI, reinstalls, Docker rebuilds, mirrors).
The io layer (io/) is deliberately decoupled from the MCP transport (server.py). Each MCP tool is a thin wrapper that resolves the target path, takes the per-file lock, and calls one io-layer function. This keeps the core logic independent of MCP, so it can be tested directly (see tests/).
After a write that touches cell values or formulas, the server runs soffice --headless --convert-to xlsx on the file so every formula gets a real computed value. This round-trip recomputes formulas but re-exports the whole workbook β it is a tradeoff, not a guarantee of bit-perfect preservation. Features that openpyxl would otherwise preserve may not survive identically: pivot tables, charts, data validation, some formats, and some defined names.
If you're working on a structurally complex workbook where that risk matters, you can pass recalculate=False on the value/formula-writing tools (write_cells, append_rows, insert_rows, delete_rows, insert_columns, delete_columns) to save with openpyxl only and skip the round-trip entirely.
message field.Install LibreOffice:
The server finds LibreOffice by checking soffice / libreoffice on PATH and the standard macOS install location (/Applications/LibreOffice.app/Contents/MacOS/soffice).
The server speaks stdio transport (standard MCP): after installation it waits for an MCP client to connect and call tools. You don't usually run it yourself; you register it with a client.
uvx (recommended β no clone)uvx fetches and runs the published package without polluting your project. This is the simplest way to power up an MCP client (see configuration snippets below).
pipThis installs the console entry point, so you can run the server directly:
The simplest registration for every client uses uvx xlsx-tools-mcp (no clone, always the published version).
Or via .mcp.json in your project:
In opencode.json (project) or ~/.config/opencode/opencode.json (global):
If you cloned the repo instead of installing from PyPI, point the client at your local checkout by swapping uvx xlsx-tools-mcp for the dynamic uv run form (use the absolute path to the clone):
Claude Code .mcp.json:
OpenCode:
Replace /absolute/path/to/xlsx-reader with the actual location of your clone.
XLSX_MCP_FILES)Set the XLSX_MCP_FILES environment variable in the MCP server config env section (not your interactive shell β the server is launched by the client) to preload workbooks at startup. Format: comma-separated alias=absolute/path entries, or bare absolute paths:
Bare paths get an alias defaulting to the filename:
With alias/filename as the alias:
path omitted entirely.path.list_configured_files() returns the alias β absolute-path mapping.Claude Code β .mcp.json with preloading:
OpenCode with preloading:
All 20 tools. Unless noted, path accepts a filesystem path, a preloaded alias/filename, or may be omitted when exactly one file is preloaded. create_workbook is the exception β its path is required because a new file is never preloaded.
Response shape (all write tools): every write tool returns
{"saved": bool, "recalculated": bool, "errors_found": list, "message": str}. When non-empty,errors_foundis a list of{"sheet": "...", "cell": "B2", "error": "#DIV/0!"}.
Factual signals from GitHub, npm, and our automated checks β not a rating.
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/xlsx-tools-mcp)<a href="https://allmcps.com/mcp/xlsx-tools-mcp"><img src="https://allmcps.com/api/badge/xlsx-tools-mcp?style=directory" alt="Xlsx Tools MCP on AllMCPs" /></a>