mcp-server-excel
Automate real Microsoft Excel with AI via MCP Server or CLI — Power Query, DAX, VBA, PivotTables, charts, and 326 operations.
Install / Use
claude mcp add sbroenne -- npx -y github:sbroenne/mcp-server-excelIf the server publishes to npm under a different name, use that package instead — check the repo README.
MCP Server
Model Context Protocol server
Quality Score
Category
AutomationSupported Platforms
Skill content
View source on GitHubExcelMcp - MCP Server for Microsoft Excel
Automate Excel with AI — A Model Context Protocol (MCP) server for comprehensive Excel automation through conversational AI.
MCP Server for Excel enables AI assistants (GitHub Copilot, Claude, ChatGPT) to automate Excel through natural language commands. Automate Power Query, DAX measures, VBA macros, PivotTables, Charts, formatting, and data transformations (26 tools with 234 operations).
⚡ Powered by the real Excel engine — ExcelMcp drives the actual Excel application through its official COM API, so it does what file-parser tools can't: run live operations (refresh Power Query, recalculate, refresh PivotTables and the Data Model, evaluate DAX, run VBA and Python =PY()) and edit your existing workbooks with every formula, PivotTable, chart, macro and format left intact.
💡 Interactive Development - See results instantly in Excel. Create a query, run it, inspect the output, refine and repeat. Excel becomes your AI-powered workspace for rapid development and testing.
🧪 LLM-Tested Quality - Tool behavior validated with real LLM workflows using pytest-skill-engineering. We test that LLMs correctly understand and use our tools.
Technical Requirements:
- ⚠️ Windows Only - COM interop is Windows-specific
- ⚠️ Excel Required - Microsoft Excel 2016 or later must be installed
- ⚠️ Desktop Environment - Controls actual Excel process (not for server-side processing)
[!TIP] Also building PowerPoint decks? Check out PowerPoint MCP Server — the sister project, built the same way.
🎯 What You Can Do
26 specialized tools with 234 operations:
- 🔄 Power Query (1 tool, 12 ops) - Atomic workflows, M code management, load destinations
- 📊 Data Model/DAX (2 tools, 19 ops) - Measures, relationships, model structure
- 🎨 Excel Tables (2 tools, 27 ops) - Lifecycle, filtering, sorting, structured references
- 📈 PivotTables (3 tools, 30 ops) - Creation, fields, aggregations, calculated members/fields
- 📉 Charts (2 tools, 29 ops) - Create, configure, series, formatting, data labels, trendlines
- 📝 VBA (1 tool, 6 ops) - Modules, execution, version control
- 📋 Ranges (4 tools, 46 ops) - Values, formulas, formatting, validation, protection
- 📄 Worksheets (2 tools, 16 ops) - Lifecycle, colors, visibility, cross-workbook moves
- 🔌 Connections (1 tool, 9 ops) - OLEDB/ODBC management and refresh
- 🏷️ Named Ranges (1 tool, 6 ops) - Parameters and configuration
- 📁 Files (1 tool, 6 ops) - Session management, workbook creation, IRM/AIP-protected file support
- 🧮 Calculation Mode (1 tool, 3 ops) - Get/set calculation mode and trigger recalculation
- 🎚️ Slicers (1 tool, 8 ops) - Interactive filtering for PivotTables and Tables
- 🎨 Conditional Formatting (1 tool, 4 ops) - Add, clear, and inspect rules
- 📸 Screenshot (1 tool, 2 ops) - Capture ranges/sheets as PNG for LLM visual verification
- 🪧 Window Management (1 tool, 9 ops) - Show/hide Excel, arrange, position, status bar feedback
📚 Complete Feature Reference → - Detailed documentation of all 234 operations
💬 Example Prompts
Create & Populate Data:
- "Create a new Excel file called SalesTracker.xlsx with a table for Date, Product, Quantity, Unit Price, and Total with sample data"
- "Put this data in A1:C4 - Name, Age, City / Alice, 30, Seattle / Bob, 25, Portland"
- "Add a formula column that calculates Quantity times Unit Price"
Analysis & Visualization:
- "Create a PivotTable from this data showing total sales by Product, then add a bar chart"
- "Use Power Query to import products.csv, load it to the Data Model, and create a measure for Total Revenue"
- "Create a slicer for the Region field so I can filter the PivotTable interactively"
- "Create a relationship between the Orders and Products tables using ProductID"
Formatting & Styling:
- "Format the Price column as currency and highlight values over $500 in green"
- "Convert this range to an Excel Table with a blue style and add a totals row"
- "Make the headers bold with a dark background and auto-fit column widths"
- "Apply the same section-header styling to A1:G1, A12:G12, and A24:G24 in one step"
Formatting split: number display formats use the range tool, while visual styling and auto-fit use range_format.
Automation:
- "Export all Power Query M code to files for version control"
- "Run the UpdatePrices macro"
- "Show me Excel while you work" - watch changes in real-time
🪟 Agent Mode — Watch AI Work in Excel:
- "Show me Excel side-by-side while you build this dashboard" - real-time visibility
- "Let me watch while you create the chart" - AI asks your preference, then shows Excel
- Status bar shows live progress: "ExcelMcp: Building PivotTable from Sales data..."
👥 Who Should Use This?
Perfect for:
- ✅ Data analysts automating repetitive Excel workflows
- ✅ Developers building Excel-based data solutions
- ✅ Business users managing complex Excel workbooks
- ✅ Teams maintaining Power Query/VBA/DAX code in Git
Not suitable for:
- ❌ Server-side data processing (use libraries like ClosedXML, EPPlus instead)
- ❌ Linux/macOS users (Windows + Excel installation required)
- ❌ High-volume batch operations (consider Excel-free alternatives)
🚀 Quick Start
| Platform | Installation |
|----------|-------------|
| VS Code | Install Extension (one-click, recommended) |
| Claude Desktop | Download .mcpb from latest release |
| Any MCP Client | Download mcp-excel.exe from latest release and add to PATH |
| Details | 📖 MCP Server Installation Guide |
⚠️ Important: Close all Excel files before using. The server requires exclusive access to workbooks during automation.
🔧 CLI vs MCP Server
This package provides both CLI and MCP Server interfaces. Choose based on your use case:
| Interface | Best For | Why |
|-----------|----------|-----|
| CLI (excelcli) | Coding agents (Copilot, Cursor, Windsurf) + Scripting | 64% fewer tokens - single tool, no large schemas. Auto-generated from Core code, ensuring 1:1 feature parity. Bundled with excel-cli skill. |
| MCP Server | Conversational AI (Claude Desktop, VS Code Chat) | Rich tool discovery, persistent connection. Better for interactive, exploratory workflows. |
Installation:
- CLI via Copilot plugin (Recommended for Copilot CLI): Install the
excel-cliplugin for skill guidance, then installexcelcliseparately - CLI Standalone: Download ZIP from releases or install via NuGet — see CLI Installation Guide
- Skill only: Install the
excel-cliskill separately when your agent already hasexcelcliavailable on PATH - MCP Server: Download from releases or install VS Code Extension — see MCP Server Installation Guide
⚡ CLI Commands: Generated automatically from Core service definitions using Roslyn source generators. All CLI commands maintain exact 1:1 parity with MCP tools through shared code generation. See code generation docs for details.
📦 GitHub Copilot Plugins
ExcelMcp is available as two GitHub Copilot CLI plugins in the Copilot plugin marketplace:
# Register the plugin marketplace (one-time)
copilot plugin marketplace add sbroenne/mcp-server-excel-plugins
# Install one or both plugins
copilot plugin install excel-mcp@mcp-server-excel-plugins # For conversational AI
copilot plugin install excel-cli@mcp-server-excel-plugins # For scripting / coding agents
excel-mcp— MCP server for conversational workflowsexcel-cli— Skill for coding agents (installexcelcliseparately if you want the CLI tool)
Note: After each release, there may be a short delay before plugins appear in the marketplace. You may need to wait a few moments for updates to sync.
<details> <summary>📊 Benchmark Results (same task, same model)</summary>| Metric | CLI | MCP Server | Winner | |--------|-----|------------|--------| | Tokens | ~59K | ~163K | 🏆 CLI (64% fewer) |
Key insight: MCP sends 26 tool schemas to the LLM on each request (~100K+ tokens).
</details>Manual Installation:
# Primary: Download standalone executables from latest release (no .NET runtime required)
# https://github.com/sbroenne/mcp-server-excel/releases/latest
# - ExcelMcp-MCP-Server-{version}-windows.zip → extract mcp-excel.exe
# - ExcelMcp-CLI-{version}-windows.zip → extract excelcli.exe (optional, for scripting)
# Secondary: Install via .NET tool (requires .NET 10 runtime)
dotnet tool install --global Sbroenne.ExcelMcp.McpServer
dotnet tool install --global Sbroenne.ExcelMcp.CLI
# After installing either way, auto-configure all your coding agents:
npx add-mcp "mcp-excel" --name excel-mcp
⚠️ Step 2 requires Node.js for
npx. Install withwinget install OpenJS.NodeJS.LTSif needed.
# Optional: Install agent skills for better AI guidance
npx skills add sbroenne/mcp-server-excel --skill excel-cli # Coding agents
npx skills add sbroenne/mcp-server-excel --skill excel-mcp # Conversational AI
💡 Skills provide AI guidance - The CLI skill is highly recommended (agents don't work perfectly with CLI without it). The MCP skill is recommended - it adds workflow best practices and reduces token usage.
⚙️ How It Works - COM Automation & Unified Service Architecture
ExcelMcp uses Windows COM automation to control the actual Excel application (not just .xlsx files).
The MCP Server and CLI are two equal, first-class entry points. Each hosts its own ExcelMCP Service that manages Excel sessions — the MCP Server runs it in-process (direct calls, no pipe), while the CLI uses a background daemon over a named pipe so sessions persist across CLI invocations:
┌──────────────────────┐ ┌──────────────────────┐
│ MCP Server │ │ CLI (excelcli) │
│ (AI assistants) │ │ (coding agents) │
└──────────┬───────────┘ └──────────┬───────────┘
│ in-process │ named pipe →
│ (direct calls) │ b
Truncated for display — read the full file on GitHub.
Related Skills
Agent-Reach
84.4kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu — one CLI, zero API fees.
headroom
73.4kCompress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
ruflo
73.0k🌊 The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated
CowAgent
47.1kOpen-source super AI assistant & Agent Harness. Plans tasks, runs tools and skills, self-evolves with memory and knowledge. Multi-agent, multi-model, multi-channel. Lightweight, extensible, one-line install.
