Excel MCP Server
An open-source Model Context Protocol (MCP) server that lets
Claude, Cursor, VS Code Copilot, Codex and other AI clients create, read and edit Excel files:
charts, PivotTables, formulas, tables and more. It is built on openpyxl, needs no Microsoft
Excel, and runs on Windows, macOS and Linux.
Install and try it at excelmcpserver.com, or see
Quick start below.
Features
Charts and PivotTables
- Create Excel charts with AI: column, bar, line, area, pie, doughnut, radar, scatter and
bubble, with combos, secondary axes, trendlines and error bars
- The Excel 2016 chart types: waterfall, histogram, Pareto, box and whisker, treemap, sunburst
and funnel
- Real PivotTables that Excel refreshes (grouping, calculated fields, "show values as",
layouts, filters), plus slicers and timelines for PivotTables and tables
- Sparklines (line, column, win/loss)
Formulas and dynamic arrays
- Formulas are calculated without Excel by a built-in engine (479 functions, checked
against more than 25,000 formulas recorded from real Excel), so
read_range returns values
for files that were never opened in Excel
- Dynamic arrays (
FILTER, SORT, UNIQUE, SEQUENCE, LET) are stored as Excel stores
them and spill into the cells next to them
- Find out why a number is wrong: trace precedents and dependents across sheets, names and
tables, and evaluate a formula step by step as Excel's Evaluate Formula does
- Goal Seek: change an input until a formula reaches the value you want
Data, tables and rules
- Read and write cells, dates and hyperlinks; tables with totals rows and calculated columns
- Conditional formatting (scales, data bars, icon sets, top/bottom, duplicates, text, dates),
data validation (dropdowns, limits, input messages)
- Sort, filter (with criteria), find and replace, remove duplicates, text to columns, fill
series, paste special
- Fonts, fills, borders, number formats, merged cells, frozen panes, grouping, print setup,
sheet protection, images, notes and defined names. Inserting or deleting rows and columns
updates every reference, as in Excel
Large files
- Reads stream the workbook and return pages, so memory stays flat on sheets with hundreds of
thousands of rows; every call is bounded by size and cell limits
- Edits of a sheet of 1 MB of XML or more parse only the rows they touch, so inserting or
deleting rows and columns, sorting, replacing, copying a sheet and creating a PivotTable
take seconds on a 200,000-row sheet instead of minutes
Macros (opt-in)
- Read the VBA code in
.xlsm files. Writing VBA is off unless you start the server with
--allow-vba-write, which also decides whether create_workbook and import_workbook may
make .xlsm/.xltm files; the server never runs macros
Safe by design
- Optional folder confinement, a formula safety check, read-only mode, localhost-only HTTP by
default, and atomic saves that never leave a half-written file
Works with .xlsx, .xlsm (macros are preserved), .xltx and .xltm files. Existing
threaded comments, shapes, form controls and other content the tools cannot edit are kept as
they are.
Quick start
You need uv. Every client runs the
server with uvx excel-mcp-server stdio; replace /path/to/workbooks with the folder the
server may use. excelmcpserver.com has the same steps with copy
buttons and one-click install links for Cursor and VS Code.
Claude Desktop (Chat): download
excel-mcp-server.mcpb
from the latest release and open it. Claude asks which folder the server may use.
Claude Code (the CLI, and the Code tab in Claude Desktop):
claude mcp add excel --scope user -- uvx excel-mcp-server stdio --allow-dir /path/to/workbooks
Cursor (~/.cursor/mcp.json), and most clients that use an mcpServers config:
{
"mcpServers": {
"excel": {
"command": "uvx",
"args": ["excel-mcp-server", "stdio", "--allow-dir", "/path/to/workbooks"]
}
}
}
VS Code with GitHub Copilot (.vscode/mcp.json, note the servers key):
{
"servers": {
"excel": {
"type": "stdio",
"command": "uvx",
"args": ["excel-mcp-server", "stdio", "--allow-dir", "${workspaceFolder}"]
}
}
}
OpenAI Codex (CLI, IDE extension and app):
codex mcp add excel -- uvx excel-mcp-server stdio --allow-dir /path/to/workbooks
Gemini CLI:
gemini mcp add -s user excel uvx excel-mcp-server stdio --allow-dir /path/to/workbooks
Devin Desktop:
devin mcp add -s user excel -- uvx excel-mcp-server stdio --allow-dir /path/to/workbooks
Claude Desktop, manual setup: open Settings, Developer, Edit Config, add the mcpServers
JSON above to claude_desktop_config.json, and restart Claude.
Desktop apps often cannot find uvx, because they do not see your shell's PATH (common
on macOS). Use its full path instead, which which uvx prints.
Choosing which files it can use
With --allow-dir DIR, the server only opens workbooks inside DIR (subfolders included)
and relative paths such as reports/q1.xlsx start there. Repeat the flag to allow several
folders, or set EXCEL_FILES_PATH (separate folders with : on macOS/Linux and ; on
Windows).
Without --allow-dir, any absolute path to an Excel file works. In every mode the server
only touches Excel files and never silently overwrites an existing workbook.
Remote use (Streamable HTTP)
uvx excel-mcp-server streamable-http --allow-dir /srv/workbooks
Clients connect to http://127.0.0.1:8017/mcp. Workbooks live in the --allow-dir folder
(default ./excel_files), and export_workbook / import_workbook move files between the
server and the client.
The server listens on localhost only. To accept other machines, set a token and a host:
EXCEL_MCP_AUTH_TOKEN=change-me uvx excel-mcp-server streamable-http --host 0.0.0.0
Clients then send Authorization: Bearer change-me. Put a TLS-terminating reverse proxy in
front of it for use across networks.
Docker
docker build -t excel-mcp-server .
docker run -p 8017:8017 -v "$PWD/workbooks:/data" -e EXCEL_MCP_AUTH_TOKEN=change-me excel-mcp-server
Configuration
| Flag |
Environment variable |
Default |
Meaning |
--allow-dir DIR |
EXCEL_FILES_PATH |
none (stdio), ./excel_files (HTTP) |
Folders workbooks must be in |
--read-only |
EXCEL_MCP_READ_ONLY=1 |
off |
Only offer tools that do not change files |
--allow-vba-write |
EXCEL_MCP_ALLOW_VBA_WRITE=1 |
off |
Add tools that write VBA macros (see warning below); ignored with --read-only |
--tools AREAS |
EXCEL_MCP_TOOLS |
all |
Only offer the core tools and these comma-separated areas, to save context (see Choosing tools) |
--max-file-mb N |
EXCEL_MCP_MAX_FILE_MB |
100 |
Largest workbook the server opens. Also sets the unpacked-size limit (10 times this) that every opened or uploaded workbook must stay under; parts compressed over 500:1 are refused |
--max-cells N |
EXCEL_MCP_MAX_CELLS |
100000 |
Most cells one call may read, write or format; reads are still returned in pages; also bounds text to 256 characters per cell on average |
--max-pivot-cells N |
EXCEL_MCP_MAX_PIVOT_CELLS |
3000000 |
Largest PivotTable source in cells (a 230,000-row, 13-column sheet); creating one from the biggest sources takes a minute and about 2 GB of memory |
--max-loaded-cells N |
EXCEL_MCP_MAX_LOADED_CELLS |
3000000 |
Most cells and rows of a workbook that may be loaded into memory at once, about 0.5 KB each (a 3,000,000 limit is about 1.5 GB). A workbook with more is refused by the tools that must load whole sheets; read_range and the other streaming reads, and edits of large sheets that parse only some rows, are not limited by the size of the sheet. It also limits, to 128 characters per cell, the formula text that shared formulas expand to |
--log-level LEVEL |
|
WARNING |
Logging on stderr |
--host HOST |
EXCEL_MCP_HOST |
127.0.0.1 |
HTTP listen address |
--port PORT |
EXCEL_MCP_PORT |
8017 |
HTTP port |
|
EXCEL_MCP_AUTH_TOKEN |
none |
Bearer token required on HTTP requests |
--allow-unauthenticated |
|
off |
Allow a non-local --host without a token |
Tools