MCP server + CLI giving AI agents 50 spreadsheet tools for .xlsx — live-recalc formulas (360+ Excel functions), repair broken references & external links, read/write, diff, and audit. Works in Claude Code, Cursor, Codex, and any MCP client.
xlsx-for-ai
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
*Short name: **xfa** — a real CLI command (xfa , xfa samples, xfa --version) and the prompt shorthand (e.g. "use xfa to read this file"). Same entrypoint as xlsx-for-ai; matches the internal xfa_* / XFA_* brand surface.*
**Verified values, preserved structure, up to 100MB**
The missing reliability layer for spreadsheet work in LLM agents. Read, write, diff, validate, and analyze .xlsx files end-to-end — with merged cells, formulas, named ranges, conditional formatting, pivots, and charts preserved.
xlsx-for-ai makes Claude reliable on real-world Excel files. Forty-plus tools cover the structural surface that pandas-style sandboxes drop on the floor: merged cells, named ranges, formulas with results, conditional formatting, pivots, slicers, charts, comments, data validations, hyperlinks, cross-sheet topology, external links, form controls, VBA macros, document properties, and protection settings. A soundness check (xlsx_validate) flags corruption other readers silently mask. A hosted recalc engine computes served values in-house — no third-party formula engine in the serve path.
**In Claude Code, one command:**
Then run /reload-plugins (or restart Claude Code), open /mcp, choose plugin:xlsx-for-ai:spreadsheets and sign in once. Needs Claude Code 2.1.292 or later (claude update if yours is older). More on the plugin is under Claude Code plugin below.
**In the Claude app (claude.ai):** find xlsx-for-ai in the connector directory at claude.ai/directory and click Connect.
**The npm package** (Claude Code, Cursor, Claude Desktop and others):
The global install puts the xlsx-for-ai-mcp binary on your PATH — that's what the canonical configs below point at. A pinned global install launches fast (it still needs an internet connection, because the files are read by the hosted service); upgrade with npm install -g xlsx-for-ai@latest when a new version ships.
> **Upgrading from 1.5.x?** This is a re-architecture, not a feature bump: the heavy local engine is gone from the npm package. All rendering happens server-side. The cursor-reads-xlsx alias still works. See Migration below.
---
MCP configuration
Add the server to your agent runtime under the name **xfa** (so "use xfa to read this" resolves). First run needs a one-time sign-in. In an editor or desktop app, your first request answers with a sign-in link and a short code: open the link, approve, then ask again. Or run xlsx-for-ai login in a terminal first (see First-run sign-in). Keys created by older versions keep working for now. When that changes, the sign-in link appears in the same place, so there is nothing to do ahead of time.
Claude Code
The global install auto-registers the xfa MCP server in ~/.claude.json — no extra step:
If your environment skips install scripts (--ignore-scripts, CI, or a sudo install), register it manually:
Verify: in a new Claude Code session, ask "what MCP tools do you have?" — 52 xlsx_* tools should appear, including xlsx_doctor (one-call health report — try it first on any unknown workbook).
Then run xfa samples (shorthand for xlsx-for-ai samples) to drop two demo workbooks in your working directory and get paste-ready prompts to try.
Claude Desktop
Claude Desktop reads files, but it cannot recalculate formulas, read a very large workbook exactly, or hand back a real .xlsx. The xfa server adds those. The install does not touch Claude Desktop, so add the server yourself. Install the package first (npm install -g xlsx-for-ai), then open the config file: