# xlsx-for-ai [![xlsx-for-ai MCP server](https://glama.ai/mcp/servers/senoff/xlsx-for-ai/badges/score.svg)](https://glama.ai/mcp/servers/senoff/xlsx-for-ai) *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. Cross-engine validation catches the corruption other readers silently mask. A hosted recalc engine computes served values in-house — no third-party formula engine in the serve path. ```bash npm install -g xlsx-for-ai ``` 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 and works offline; 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](#migration-from-15x) below. --- ## MCP configuration Add the server to your agent runtime under the name **`xfa`** (so "use xfa to read this" resolves). First invocation auto-registers an anonymous client UUID — no email, no signup, no friction. ### Claude Code The global install auto-registers the `xfa` MCP server in `~/.claude.json` — no extra step: ```bash npm install -g xlsx-for-ai ``` If your environment skips install scripts (`--ignore-scripts`, CI, or a sudo install), register it manually: ```bash claude mcp add xfa -- xlsx-for-ai-mcp ``` 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. ### Cursor Config file: `~/.cursor/mcp.json` ```json { "mcpServers": { "xfa": { "command": "xlsx-for-ai-mcp" } } } ``` Verify: open Cursor settings → MCP → confirm `xfa` shows 52 `xlsx_*` tools. ### Continue Config file: `~/.continue/config.json` ```json { "mcpServers": [ { "name": "xfa", "command": "xlsx-for-ai-mcp" } ] } ``` Verify: restart VS Code, open the Continue panel, and check the MCP server list. ### Codex CLI Pass `--mcp-server` on the command line, or add to your Codex config: ```json { "mcpServers": { "xfa": { "command": "xlsx-for-ai-mcp" } } } ``` Verify: run `codex --list-tools` and confirm 52 `xlsx_*` tools are listed. ### Zed Config file: `~/.config/zed/settings.json` ```json { "context_servers": { "xfa": { "command": { "path": "xlsx-for-ai-mcp" } } } } ``` Verify: open Zed's assistant panel — the xlsx tools should appear in the tool picker. ### Windsurf Config file: `~/.codeium/windsurf/mcp_config.json` ```json { "mcpServers": { "xfa": { "command": "xlsx-for-ai-mcp" } } } ``` Verify: open Windsurf → Cascade → settings, confirm `xfa` is listed as an active MCP server. ### Custom agents / API For custom MCP clients, the binary is `xlsx-for-ai-mcp` (stdio transport). Override the API base URL with the `XLSX_FOR_AI_API` env var for local dev against `http://localhost:3000`. ### Using the raw HTTP API The MCP client is the easy path, but every tool is also a plain HTTP endpoint you can call from any language — no SDK required. Registration is **anonymous and keyless**: `POST https://api.xlsx-for-ai.dev/api/v1/clients` (no auth) returns `{ client_id, api_key }`, then call any tool with `Authorization: Bearer `. The free tier is **10,000 calls/month, 10 MB per file** — no billing, no email, no signup. ```bash # Self-issue a key (no signup), then convert report.xlsx to Markdown. # Needs jq, and bash or zsh. The base64 body is passed to curl through a # process-substitution fd and the token through a --config heredoc on stdin, which # keeps both out of the argument list. -fsS --max-time makes curl fail loudly on an # HTTP error or a hang; the guard line stops on a failed key issuance. KEY=$(curl -fsS --max-time 30 -XPOST https://api.xlsx-for-ai.dev/api/v1/clients \ -H 'Content-Type: application/json' \ -d '{"client_version":"2.0.0","platform":"cli"}' | jq -r .api_key) [ -n "$KEY" ] && [ "$KEY" != null ] || { echo "key issuance failed"; exit 1; } curl -fsS --max-time 120 -XPOST https://api.xlsx-for-ai.dev/api/v1/tools/xlsx_convert \ --data-binary @<(base64 < report.xlsx | tr -d '\n' | jq -Rs '{file_b64: ., to: "md"}') \ -H 'Content-Type: application/json' \ --config - <