by sbroenne
Excel MCP Server & CLI - 23 tools, 214 operations for AI-powered Excel automation via COM API
# Add to your Claude Code skills
git clone https://github.com/sbroenne/mcp-server-excelAutomate 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 (25 tools with 230 operations).
๐ก๏ธ 100% Safe - Uses Excel's Native COM API - Zero risk of file corruption. Unlike third-party libraries that manipulate .xlsx files directly, this project uses Excel's official API ensuring complete safety and compatibility.
๐ก 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-aitest. We test that LLMs correctly understand and use our tools.
Technical Requirements:
25 specialized tools with 230 operations:
๐ Complete Feature Reference โ - Detailed documentation of all 230 operations
Create & Populate Data:
Analysis & Visualization:
Formatting & Styling:
Formatting split: number display formats use the range tool, while visual styling and auto-fit use range_format.
Automation:
๐ช Agent Mode โ Watch AI Work in Excel:
Perfect for:
Not suitable for:
| 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 | ๐ Installation Guide |
โ ๏ธ Important: Close all Excel files before using. The server requires exclusive access to workbooks during automation.
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) | 64% fewer tokens - single tool, no large schemas. Auto-generated from Core code, ensuring 1:1 feature parity. |
| MCP Server | Conversational AI (Claude Desktop, VS Code Chat) | Rich tool discovery, persistent connection. Better for interactive, exploratory workflows. |
โก CLI Commands: Generated automatically from Core service definitions using Roslyn source generators. All 22 command categories maintain exact 1:1 parity with MCP tools through shared code generation. See code generation docs for details.
| Metric | CLI | MCP Server | Winner | |--------|-----|------------|--------| | Tokens | ~59K | ~163K | ๐ CLI (64% fewer) |
Key insight: MCP sends 23 tool schemas to the LLM on each request (~100K+ tokens).
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.
ExcelMcp uses Windows COM automation to control the actual Excel application (not just .xlsx files).
Both the MCP Server and CLI communicate with a shared ExcelMCP Service that manages Excel sessions. This unified architecture enables:
โโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโ
โ MCP Server โ โ CLI (excelcli) โ
โ (AI assistants
No comments yet. Be the first to share your thoughts!