# MCP Server for Excel

Connects AI assistants to Microsoft Excel via the COM API to manage workbooks, formulas, and queries. Useful when you need real recalculations and Power Query refreshes.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 834
- Author: sbroenne
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/sbroenne/mcp-server-excel
- Updated: 2026-10-24
- HTML: https://affpapa.org/en/nevibecode/mcp/mcp-server-for-excel

## What it does

This server connects directly to the desktop Excel application using the native COM API instead of treating workbooks as static XML files. It preserves formatting, formulas, and existing macros while giving agents access to 63 MCP tools with 424 operations across 33 capability areas.

You can trigger Power Query refreshes, calculate DAX measures, run `=PY()` Python blocks, or generate PivotTables and charts. The workbook updates visually on screen. You can review edits immediately.

Without Windows and an interactive desktop session, the server will not function. It requires Excel 2016 or newer and does not support macOS, Linux, or headless batch environments. You must close target workbooks before executing operations because the automation needs exclusive file access.

## Requirements
- Needs: Node.js (commands run via npx)

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add mcp-server-excel -- npx -y @sbroenne/mcp-server-excel
```

### Codex

**Platform CLI**
```bash
codex mcp add mcp-server-for-excel -- npx -y @sbroenne/mcp-server-excel
```

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "mcp-server-for-excel": {
            "command": "npx",
            "args": [
                "-y",
                "@sbroenne/mcp-server-excel"
            ]
        }
    }
}
```

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "mcp-server-for-excel": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "@sbroenne/mcp-server-excel"
            ]
        }
    }
}
```

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add mcp-server-for-excel npx -y @sbroenne/mcp-server-excel
```

## When to use it
- refresh Power Query connections and load datasets into the Data Model
- generate PivotTables and link them to dynamic charts and slicers
- calculate optimal target values using the Goal Seek feature
- execute VBA procedures and evaluate Python formulas directly in Excel

## Example prompts
- Import products.csv using Power Query and load the table to the Data Model
- Create a PivotTable showing total revenue per region and add a column chart
- Run Goal Seek to determine what unit price produces 100000 in profit

## Similar
- [Excel MCP Server](https://affpapa.org/en/nevibecode/mcp/excel-mcp-server.md) — MCP server · ★ 4259
- [Power BI Authoring MCP Server (Local)](https://affpapa.org/en/nevibecode/mcp/power-bi-authoring-mcp-server-local.md) — MCP server · ★ 1247
- [anymd](https://affpapa.org/en/nevibecode/mcp/anymd.md) — MCP server · ★ 1051
- [Docling MCP](https://affpapa.org/en/nevibecode/mcp/docling-mcp.md) — MCP server · ★ 777
- [OpenTakeoff](https://affpapa.org/en/nevibecode/mcp/opentakeoff.md) — MCP server · ★ 667
- [canvas-mcp](https://affpapa.org/en/nevibecode/mcp/canvas-mcp.md) — MCP server · ★ 307

From the same set: [sbroenne/mcp-server-excel](https://affpapa.org/en/nevibecode/by/sbroenne/mcp-server-excel.md) — 2 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
