Excel MCP Server: Connect AI to Your Spreadsheets
A model can read, write and chart a workbook through MCP. Which server you want depends on where the file lives and what does the calculating — three different things answer to the same name.
An Excel MCP server gives a model tools for a workbook: list the sheets, read a range, write values and formulas, add a chart or a table. Connected to Claude, Cursor or VS Code, it lets the model answer from the file, not from what you pasted.
Behind the name are three routes, the same three Microsoft weighs up for automating Office: edit the file format, go through Microsoft Graph, or drive the desktop application. The route decides whether a formula gets a value, whether a pivot table is real and whether a macro can run.
What each route can actually do
A typical file-based server — the openpyxl one on PyPI as excel-mcp-server — has 25 tools covering sheets, data, formatting, formulas, charts, tables and pivot tables. The list reads much the same on every route; what it delivers does not.
| Capability | Edits the file | Microsoft 365 (Graph) | Desktop Excel |
|---|---|---|---|
| Cells, charts, tables | Yes | Yes | Yes |
| Formulas | Written, not calculated, unless the server has an engine | Calculated by Excel in the cloud | Calculated by Excel |
| Pivot tables | Usually a summary table, not a PivotTable | Refresh existing ones; no create | Real PivotTables |
| Macros (VBA) | Never run; an .xlsm can be broken by a save | Not among the documented objects | Can run, once allowed in the Trust Center |
| Needs | Any OS, no Excel | Work or school account; file in OneDrive for Business or SharePoint | Windows, Excel 2016 or later, a signed-in desktop |
File-based Excel MCP servers: no Excel required
File-based servers open the .xlsx with a library — openpyxl in Python, a Rust engine in some newer ones — edit the XML and save. No Excel is needed, so it runs anywhere, CI included, and Microsoft calls editing the file format the supported way for a service to change an Office file.
The catch is calculation: openpyxl “never evaluates formula”. Ask for a margin column and the server writes =C2/B2 with no value beside it, so pandas and previewers read empty cells until something that can calculate has opened and saved it. Agent Spreadsheet and LogiSheets carry engines of their own; KitchenSink4XL labels every value calculated, cached or missing.
Other openpyxl limits:
- Macros. An .xlsm saved without keep_vba=True will not open in Excel, and the excel-mcp-server code does not pass that flag.
- Shapes. openpyxl drops them from an existing file it saves.
- Formulas. A workbook opened with data_only=True and then saved has every formula replaced by its last value, for good.
- Pivot tables. openpyxl cannot create them, so a “create pivot table” tool does the sums in Python and writes an ordinary table.
Microsoft 365: the Graph Excel API
For a workbook in OneDrive for Business or SharePoint, Microsoft Graph works on the file in Excel’s own servers — the one route with real calculation and no desktop. Microsoft documents it for work and school files (“only the files stored in business platform are supported”) and for .xlsx, not .xls.
Ms 365 by Softeria maps each tool to one Graph endpoint, 23 of them for Excel: worksheets, ranges, formatting, charts and tables. Graph saves any change made outside a session straight to the file, and none of the 23 opens one, so every write lands at once.
# work or school account; the file tools find a workbook in your OneDrive
npx -y @softeria/ms-365-mcp-server --org-mode --preset excel,files --read-only
# which Graph permissions that asks for
npx -y @softeria/ms-365-mcp-server --org-mode --preset excel,files --read-only --list-permissionsLooking for Microsoft’s own? Its Agent 365 catalogue has Word and SharePoint servers, and no Excel one; its servers for SQL Server, Azure and Entra ID are in MCP servers for the Microsoft stack.
Desktop Excel on Windows: the whole application
The third route drives the Excel installed on a Windows PC through COM, so recalculation, Power Query, real PivotTables and VBA all work. MCP Server for Excel packs 326 operations into 31 tools. It needs Windows, Excel 2016 or later, an interactive desktop and exclusive access, so close your workbooks first.
Microsoft does not support automating Office from unattended software — a dialog box can hang it, and Office takes one request at a time — so this route is for someone at a desk, not for a server or a CI job.
Installing an Excel MCP server in Claude, Cursor and VS Code
Each installs like any local server: the client runs a command. In Claude Code it goes after --, and the entry lands in local scope unless you add -s user or -s project.
claude mcp add xlsx-audit -- npx -y xlsx-audit-mcp
claude mcp add xl -s user -- uvx kitchensink4xl
claude mcp add ms365 -- npx -y @softeria/ms-365-mcp-server --org-mode --enabled-tools "excel|^(list-drives|search-onedrive-files|list-folder-files|search-sharepoint-sites|list-sharepoint-site-drives)$"// Claude Desktop (claude_desktop_config.json) and Cursor (~/.cursor/mcp.json)
{
"mcpServers": {
"excel-mcp": { "command": "npx", "args": ["-y", "@sbroenne/mcp-server-excel"] }
}
}
// VS Code (.vscode/mcp.json): same entry, different key
{
"servers": {
"excel-mcp": { "type": "stdio", "command": "npx", "args": ["-y", "@sbroenne/mcp-server-excel"] }
}
}Claude Desktop reads its config only at launch. Cursor and VS Code ask before running MCP tools; on macOS and Linux, VS Code can also sandbox a server’s file and network access, and then auto-approves its calls. On Windows, a client that answers spawn npx ENOENT needs the cmd /c wrapper from MCP on Windows. The rest is in where every client keeps its config.
Safety: copies, macros and what the cells say
Nothing in the protocol makes a write reversible. The general list is in what to check before you install anything.
- Work on a copy. Anthropic gives that advice for its own Excel add-in. Some servers help: Sheetforge refuses to create over an existing file and makes verified snapshots; Excel Vision saves atomically.
- Cells are input to the model. A workbook from outside can carry hidden instructions, so keep tool confirmations on.
- VBA is its own decision. Office on Windows blocks macros in files from the internet by default, and MCP Server for Excel’s VBA tools need “Trust access to the VBA project object model” switched on by hand.
- Scope the Microsoft 365 token. --read-only and a preset shrink the tools; --allowed-scopes "Files.Read" also hides every tool that needs more, which matters because one read tool asks for Files.ReadWrite.
- Know where the file goes. xlsx-for-ai installs from npm and processes workbooks on its own API. And excel-mcp-server on PyPI and on npm are unrelated projects.
Prompts to start with
- “What feeds the Total on Summary, and what breaks if I change the growth rate?” A formula auditor.
- “Add margin, =C2/B2, for every row, then tell me which cells have no calculated value.” On a file server with no engine: all of them.
- “Create a PivotTable of revenue by region.” A real one only on desktop Excel.
- “Copy budget.xlsx, then set the discount rate to 8% in the copy.”
The servers worth installing
All live in our catalogue; more are a search for excel away.
- Desktop Excel: MCP Server for Excel — Power Query, DAX and VBA included.
- Microsoft 365: Ms 365, through Graph.
- Files, calculated: Agent Spreadsheet (dry run first; no native Windows build in 0.16) and LogiSheets (opens no sockets).
- Files, edited carefully: Sheetforge, Excel Vision (sees embedded images) and Spreadsheet (.csv and .ods too, SQL across sheets).
- Numbers you can back up: KitchenSink4XL; recalculation needs Windows with Excel.
- Audit and analysis: Xlsx Audit (precedents, circular references) and Excel Csv (statistics).
- Power Query and VBA: letin (snapshot and diff on every write) and XLIDE (VBA without Office).
- Not a server: the xlsx skill; server or skill says when it fits better.
When it does not work
| Symptom | Cause | Fix |
|---|---|---|
| Formula cells read back empty in pandas or a preview | Written by a file-based server, never calculated | An engine, a recalculation in Excel or LibreOffice, or Graph |
| The “pivot table” never refreshes | It is a summary the server computed | Build the PivotTable in desktop Excel |
| Excel will not open the .xlsm | Saved by openpyxl without keep_vba | Restore the copy; keep macro files on the desktop route |
| Graph cannot open the workbook | A personal OneDrive, or an .xls file | Save it as .xlsx in OneDrive for Business or SharePoint |
| “Workbook is locked” or “Cannot open file” on desktop Excel | The workbook is already open in Excel; COM needs exclusive access | Close every Excel window, then retry at a signed-in desktop |
| “Programmatic access to Visual Basic Project is not trusted” | VBA project access is off in the Trust Center | Turn on “Trust access to the VBA project object model” |
Pick the route before the server — where the workbook lives and what calculates it — and copy the file before the first write.