Excel MCP Server
Let Claude, Cursor, VS Code and other AI clients create and edit Excel files: charts, PivotTables, slicers, formulas and large sheets. Free, open source, and no Microsoft Excel required.
Install the Excel MCP server
Every client runs the same command, uvx excel-mcp-server stdio, which needs uv (the Claude Desktop bundle does not). Add --allow-dir to choose the one folder the server may read and write; replace /path/to/workbooks below with yours.
Download excel-mcp-server.mcpb
Open the downloaded file with Claude Desktop and click Install. Claude asks which folder the server may use. Nothing else to set up.
Or edit the config by hand
Settings, Developer, Edit Config opens claude_desktop_config.json. Add this, then restart Claude. If Claude cannot find uvx, use its full path (which uvx or where uvx).
{
"mcpServers": {
"excel": {
"command": "uvx",
"args": ["excel-mcp-server", "stdio", "--allow-dir", "/path/to/workbooks"]
}
}
}Run this once in a terminal. It works for the Claude Code CLI and the Code tab in Claude Desktop.
claude mcp add excel --scope user -- uvx excel-mcp-server stdio --allow-dir /path/to/workbooks--scope user makes it available in every project; leave it out to add it to the current project only.
The button limits the server to your ~/Documents folder; change the path in Cursor's MCP settings if your workbooks live elsewhere.
Or add it to ~/.cursor/mcp.json (or .cursor/mcp.json in a project)
{
"mcpServers": {
"excel": {
"command": "uvx",
"args": ["excel-mcp-server", "stdio", "--allow-dir", "/path/to/workbooks"]
}
}
}The button limits the server to your ~/Documents folder; edit the entry if your workbooks live elsewhere. For VS Code Insiders, use the config below.
Or add it to .vscode/mcp.json (VS Code uses the key servers)
{
"servers": {
"excel": {
"type": "stdio",
"command": "uvx",
"args": ["excel-mcp-server", "stdio", "--allow-dir", "${workspaceFolder}"]
}
}
}Then use the tools in Copilot Chat in agent mode.
Windsurf (now Devin Desktop), Cline, Zed and most other clients take an mcpServers block in their MCP settings file:
{
"mcpServers": {
"excel": {
"command": "uvx",
"args": ["excel-mcp-server", "stdio", "--allow-dir", "/path/to/workbooks"]
}
}
}Command line clients
codex mcp add excel -- uvx excel-mcp-server stdio --allow-dir /path/to/workbooks
gemini mcp add -s user excel uvx excel-mcp-server stdio --allow-dir /path/to/workbooks
devin mcp add -s user excel -- uvx excel-mcp-server stdio --allow-dir /path/to/workbooksFor a shared or remote setup, run the Streamable HTTP transport. Workbooks live in the --allow-dir folder (default ./excel_files), and export_workbook and import_workbook move files to and from the client.
uvx excel-mcp-server streamable-http --allow-dir /srv/workbooksClients connect to http://127.0.0.1:8017/mcp. It listens on localhost only. To accept other machines, set a token and a host, and put a TLS reverse proxy in front:
EXCEL_MCP_AUTH_TOKEN=change-me uvx excel-mcp-server streamable-http --host 0.0.0.0Docker
git clone https://github.com/haris-musa/excel-mcp-server
cd excel-mcp-server
docker build -t excel-mcp-server .
docker run -p 8017:8017 -v "$PWD/workbooks:/data" -e EXCEL_MCP_AUTH_TOKEN=change-me excel-mcp-serverClients then send Authorization: Bearer change-me.
Quick start: from install to your first Excel file
- Install the server in your client, as above, and restart the client if it asks.
- Check it is connected. Ask: "List the Excel files in my workbook folder." The assistant should call
list_workbooks. - Describe what you want in plain language. Some prompts to try:
- "Create sales.xlsx from this CSV text, make the header a table, and add a column chart of revenue by month."
- "Build a PivotTable from the Orders sheet: regions down the side, months across, sum of revenue, and add a slicer for product category."
- "Add a total row with formulas, then read the results back so I can check them."
- "Open report.xlsx, a sheet with 200,000 rows. How many rows have status Failed, and what is the date range?"
- "Clean up the Contacts sheet: remove duplicate emails, trim names, sort by last name and add a dropdown for the Country column."
- "Highlight overdue tasks in red, add sparklines for the weekly trend, and freeze the header row."
Features: what AI can do with your Excel files
Charts
Create Excel charts with AI: column, bar, line, area, pie, doughnut, radar, scatter and bubble, with combos, secondary axes, trendlines and error bars, plus waterfall, histogram, Pareto, box and whisker, treemap, sunburst and funnel.
PivotTables, slicers and timelines
Real PivotTables that Excel refreshes, with grouping, calculated fields, "show values as" and layouts, and slicers and timelines that filter them and tables.
Formulas without Excel
Formulas are calculated by a built-in engine (about 260 functions, checked against results recorded from Excel), so values can be read back without opening Excel. Dynamic arrays (FILTER, SORT, UNIQUE, SEQUENCE, LET) are supported.
Large files
Reads stream the workbook and return pages, so memory stays flat on sheets with hundreds of thousands of rows.
Tables, rules and data tools
Tables, conditional formatting, data validation, sparklines, sort, filters, find and replace, remove duplicates, text to columns and fill series.
Layout and formatting
Fonts, fills, borders, number formats, merged cells, frozen panes, grouping, print setup, sheet protection, images, hyperlinks, notes and defined names. Inserting or deleting rows and columns updates every reference, as in Excel.
VBA, opt-in
Read the macro code in .xlsm files. Writing VBA is off unless you start the server with --allow-vba-write. Macros are never run by the server.
Works anywhere
Built on openpyxl. No Microsoft Excel needed, so it runs on Windows, macOS and Linux, locally over stdio or remotely over Streamable HTTP.
Safe by design
Folder confinement, a formula safety check, a read-only mode, localhost-only HTTP by default, and atomic saves that never leave a half-written file.
Tool reference
The server offers these tools. Every parameter is documented in TOOLS.md.
- Workbooks
create_workbook,describe_workbook,set_workbook_settings,list_workbooks,export_workbook,import_workbook: create files, list sheets and settings, move files to and from remote servers.- Sheets
describe_sheet,create_sheet,rename_sheet,copy_sheet,delete_sheet,insert_rows_or_columns,delete_rows_or_columns: inspect a sheet and change its structure, with references updated.- Cells
read_range,write_range,clear_range,copy_range,sort_range,transform_range,find_cells,replace_cells: read in pages, write values and formulas, copy, sort, deduplicate, fill, search and replace.- Formatting
format_range,merge_cells,set_sheet_layout,add_conditional_format,add_data_validation: styles, widths, panes, filters, printing, protection, rules and dropdowns.- Objects
set_table,create_chart,delete_chart,create_pivot_table,delete_pivot_table,add_slicer,delete_slicer,insert_image,delete_image,add_sparklines,delete_sparklines: tables, charts, PivotTables, slicers, pictures and sparklines.- Names and notes
set_defined_name,delete_defined_name,set_note,delete_note.- Macros
read_vba; with--allow-vba-writealsowrite_vba_moduleanddelete_vba_module.
Configuration options
| Flag | Environment variable | Meaning |
|---|---|---|
--allow-dir DIR | EXCEL_FILES_PATH | Folders workbooks must be in (repeat the flag; separate several in the variable with :, or ; on Windows). HTTP defaults to ./excel_files. |
--read-only | EXCEL_MCP_READ_ONLY=1 | Only offer tools that do not change files. |
--allow-vba-write | EXCEL_MCP_ALLOW_VBA_WRITE=1 | Add the tools that write VBA macros. Off by default and ignored with --read-only. |
--max-file-mb N | Largest workbook to open, 100 by default. | |
--log-level LEVEL | Logging on stderr, WARNING by default. | |
--host, --port | EXCEL_MCP_HOST, EXCEL_MCP_PORT | HTTP listen address, 127.0.0.1:8017 by default. |
EXCEL_MCP_AUTH_TOKEN | Bearer token required on HTTP requests. | |
--allow-unauthenticated | Allow a non-local --host without a token. |
Security
The server only opens Excel files, and with --allow-dir only inside the folders you choose. Formulas are checked before they are written, and functions that reach the network or other programs are rejected. Macros are never run, and writing them is opt-in. Cell contents are treated as data, but an assistant can still be misled by text in a workbook, so use --read-only or a narrow folder with files you do not trust. Read the security policy for details and how to report a vulnerability.
Frequently asked questions
Does it need Microsoft Excel installed?
No. The server reads and writes the files itself with openpyxl, so it works on Windows, macOS and Linux without Excel. Excel (or any compatible app) is only needed when you want to open the results.
Which file types work?
.xlsx, .xlsm (macros are preserved), .xltx and .xltm. Legacy .xls and .csv files are not supported.
Where are my files saved?
Where you tell the assistant to put them. With --allow-dir DIR, relative paths such as reports/q1.xlsx start in that folder, and nothing outside it can be touched. Without it, any absolute path to an Excel file works. The server never silently overwrites an existing workbook.
How do I enable VBA writing?
Start the server with --allow-vba-write (or set EXCEL_MCP_ALLOW_VBA_WRITE=1), for example uvx excel-mcp-server stdio --allow-dir /path/to/workbooks --allow-vba-write. The VBA tools then appear and write to .xlsm and .xltm files. Macro code runs with your rights once you enable macros in Excel, so read it first and enable this only for workflows you trust.
Does it calculate formulas?
Yes, for reading. Excel calculates formulas when it opens a file, so the server uses a built-in calculator (about 260 functions) to return values for formulas that have no saved result. A formula it cannot reproduce exactly is returned empty and listed, never guessed.
How do I upgrade from 1.x?
Run with uvx excel-mcp-server@latest or update your install. Version 2.0 changes some tool and parameter names, so saved prompts that name old parameters may need updating. The upgrade table in the changelog maps every old name to its new one.