MCP Server for Excel

Drives the real desktop Microsoft Excel on Windows through COM for workbooks, Power Query, DAX and VBA

By Stefan Broenner (individual) C# Local · stdio Data and analyticsProductivity

73 popularity score ★ 856 ↓ 4.3k/wk

Connect your client

Local (npm)

Add in one click

Opens the app, which asks before it adds the server.

Or add it by command or config

Claude CodeTerminal
claude mcp add for-excel -- npx -y @sbroenne/mcp-server-excel@latest
Claude Desktopclaude_desktop_config.json
{
  "mcpServers": {
    "for-excel": {
      "command": "npx",
      "args": [
        "-y",
        "@sbroenne/mcp-server-excel@latest"
      ]
    }
  }
}
Cursor~/.cursor/mcp.json
{
  "mcpServers": {
    "for-excel": {
      "command": "npx",
      "args": [
        "-y",
        "@sbroenne/mcp-server-excel@latest"
      ]
    }
  }
}
VS Code.vscode/mcp.json
{
  "servers": {
    "for-excel": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@sbroenne/mcp-server-excel@latest"
      ]
    }
  }
}
Codex~/.codex/config.toml
[mcp_servers.for-excel]
command = "npx"
args = ["-y", "@sbroenne/mcp-server-excel@latest"]
Gemini CLITerminal
gemini mcp add --scope user for-excel npx -- -y @sbroenne/mcp-server-excel@latest

Settings 3

EXCELMCP_TELEMETRY_MODE Optional: off stops usage telemetry, local sends it only to an OpenTelemetry receiver on this machine. Released packages send to Azure Application Insights when unset. Default azure.
OTEL_EXPORTER_OTLP_ENDPOINT Optional: Receiver address for local telemetry mode. Must be a loopback address (port 4318 by default with http/protobuf). Default http://localhost:4317.
OTEL_EXPORTER_OTLP_PROTOCOL Optional: grpc or http/protobuf, used in local telemetry mode. Default grpc.

What it does

MCP Server for Excel (also called ExcelMcp) works by automating the copy of Microsoft Excel installed on a Windows PC over COM. It does not parse .xlsx files itself. Since Excel does the work, a client can refresh Power Query, recalculate, evaluate DAX against the Data Model and run VBA or Python in Excel formulas, and the PivotTables, charts and formatting already in a workbook survive the edit.

The server registers 64 MCP tools in 33 feature areas, with 437 actions by the README's count. Most areas come in two halves. One tool makes changes (range, table, powerquery, pivottable and so on) and a generated companion with a _read suffix holds that area's read-only actions, such as file_read and worksheet_read. The newest tool is batch, added in 2.6.9. You hand it a list of commands in the excelcli batch format and it runs them in order inside one call. It keeps going after a failed entry unless stop_on_error is set, and nothing gets rolled back.

Everything runs inside workbook sessions. The file tool opens, creates or attaches to a workbook and hands back a workbook_session_id for the other tools. Since 2.6.0 you can keep working in a workbook that is already open in Excel: file_read discover finds it and attach connects to it, and the server no longer asks for exclusive access. Closing with save left false throws away unsaved edits, and there is no undo. Excel stays hidden unless show is set.

Two details from the code rather than the README. Opening a workbook switches its VBA macros off, and the enable-macros action turns them back on only when called with approved and allow_reopen both true, on a saved local workbook with no other workbooks open alongside it (ExcelFileTool.cs). Open also hands paths and URLs to Excel as given and lets Excel decide what it can open, even though the security policy still lists its own format and size checks. Release builds report usage telemetry to Azure unless EXCELMCP_TELEMETRY_MODE says otherwise.

What it needs

RuntimeNode.js 18+
Runs onWindows
Microsoft ExcelPaid planDesktop Excel 2016 or later (Microsoft 365, Professional Plus or standalone). Python in Excel needs a Microsoft 365 licence with that feature on.
Also
  • An interactive, signed-in Windows desktop session
  • MSOLAP (Analysis Services OLE DB provider) for DAX queries
  • Trust access to the VBA project object model enabled for the VBA tools

The npm package brings its own runtime, so no .NET install is needed, but npm must keep optional dependencies enabled: the matching Windows x64 or ARM64 package comes that way and a missing one is an error. MSOLAP for DAX queries comes with Power BI Desktop. VBA access is switched on in Excel's Trust Center.

Limits

  • Platform Windows only, with desktop Excel and an interactive desktop. Its makers say it is not meant for Linux, macOS or server-side batch work.
  • Limit Open passes paths and URLs to Excel unchanged, so Excel decides what opens and whether it is read-only. Answering sign-in or permission prompts needs show set true.
  • Size cap The security policy still names a 1 GB cap, .xlsx and .xlsm only, and no UNC paths or network drives, but the 2.6.0 changelog says those opening checks were removed.
  • Not covered Opening a workbook disables its macros. enable-macros needs approved and allow_reopen set true, a saved local file and no other open workbooks.
  • Not covered Create takes a Windows path to a folder that already exists and makes .xlsx or .xlsm files.
  • Limit close with save false discards unsaved edits with no undo. With AutoSave on, Excel may already have saved them.
  • Limit batch does not roll back. It carries on after a failed entry unless stop_on_error is true, and stops after a timeout or cancellation.
  • Limit EXCELMCP_TELEMETRY_MODE accepts only off, local or azure. Any other value makes startup fail (TelemetrySettings.cs).
  • Limit Only the latest release receives security fixes, according to the security policy.

Windows only; its makers say it is not meant for Linux, macOS or server-side batch work. Workbooks already open in Excel can be found with file_read discover and attached, so they no longer need closing first. The security policy names a 1 GB file size cap, .xlsx and .xlsm for local files, and no network paths, though since 2.6.0 the open action leaves those decisions to Excel. Calls within a session run one at a time. Writes try to restore the calculation mode but can fail to do so without reporting an error. Only the latest release receives security fixes.

Who it suits

Suits people on a Windows PC with desktop Excel who want an MCP client to build or change real workbooks, including Power Query, the Data Model with DAX, PivotTables and VBA, which tools that edit .xlsx files directly cannot run. It does not suit Linux, macOS, headless servers or containers, nor anyone without an Excel licence. Most tools can overwrite or delete workbook content, so work on copies when a workbook matters. It is a community project, not published by Microsoft.

Tools 36 of 64

4 only read, 7 change things, 25 can delete or overwrite. A ? marks an optional parameter.

file deletes
Open, create, attach to, save or close a workbook session, and approve editing, connections or macrosaction: enumfile_path?: stringworkbook_session_id?: stringsave?: booleanshow?: booleantimeout_seconds?: integeropen_workbook_id?: stringapproved?: booleanallow_remembered_trust?: booleanallow_reopen?: boolean
file_read
Find workbooks already open, list sessions, test whether a file can open, or show a session's opening noticesaction: enumfile_path?: stringtimeout_seconds?: integerworkbook_session_id?: string
workbook deletes
Workbook-level changes such as AutoSave and the Document Inspector
worksheet deletes
Create, rename, copy, move or delete worksheets
worksheet_read
List the sheets in a workbook
worksheet_style changes
Set sheet tab styling, visibility, protection, grouping and outlines
range deletes
Write values and formulas into cells and trace precedents or dependents
range_edit deletes
Insert, delete, clear, copy, sort and filter cells within ranges
range_format changes
Apply fonts, fills, borders, number formats, merges and validation to ranges
range_link deletes
Manage hyperlinks, threaded comments and cell protection
table deletes
Create and change Excel Tables, their filters and totals
table_column deletes
Add, rename, remove and format columns of an Excel Table
namedrange deletes
Create, update and delete named ranges
conditionalformat deletes
Add, change and remove conditional formatting rules
calculation_mode changes
Change calculation settings and precision, and trigger a recalculation
analysis deletes
Run Goal Seek and manage scenarios and data tables for what-if analysis
powerquery deletes
Create, edit, load and refresh Power Query (M) queries
powerquery_trace_read
List and summarise local Power Query trace files
querytable deletes
Import text, CSV or legacy web data through QueryTables and refresh them
connection deletes
Manage and refresh workbook data connections
datamodel deletes
Work with Data Model tables and DAX measures
datamodel_relationship deletes
Create and remove relationships between Data Model tables
pivottable deletes
Create, refresh and delete PivotTables
pivottable_field deletes
Place and configure PivotTable row, column, value and filter fields
pivottable_calc deletes
Add calculated fields and members and set PivotTable layout
slicer deletes
Add, set and remove slicers for PivotTables and Tables
chart deletes
Create, move, resize, delete and export embedded charts
chart_config changes
Set chart titles, axes, series, legends and styling
drawing deletes
Manage images, shapes, text boxes, form controls and sparklines on a sheet
xmlmap deletes
Add XML maps to a workbook and import or export XML data
vba deletes
Import, edit and run VBA modules and macros
pythoninexcel changes
Write Python in Excel =PY() formulas and read their results
settings changes
Change per-user Excel settings such as Power Query tracing and native query approval
window changes
Show, hide, arrange and zoom Excel windows, freeze panes and set view options
screenshot
Capture an image of what Excel shows for a sheet or range
batch deletes
Run a list of commands from the other tools in order within one call, with no rollback when one failsaction: enumcommands: arrayworkbook_session_id?: stringstop_on_error?: boolean

Similar servers