Automate Excel with AI via GitHub Copilot, Claude, and other MCP clients β including Power Query, DAX, VBA, PowerPivot, and Tables.
Automate Excel with AI - A Model Context Protocol (MCP) server for comprehensive Excel automation through conversational AI.
VS Code / GitHub Copilot
Install ExtensionClaude Desktop
One-Click InstallCursor, Windsurf, etc.
Installation GuideMCP Server for Excel enables AI assistants (GitHub Copilot, Claude, ChatGPT) to automate Excel through natural language commands, including Power Query & M, PowerPivot & DAX, VBA macros, PivotTables, Charts, formatting & much more β no Excel programming knowledge required.
It works with any MCP-compatible AI assistant like GitHub Copilot, Claude Desktop, Cursor, Windsurf, etc.
π‘οΈ 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 - Watch Excel update in real-time as AI works. Say βShow me Excel while you workβ and see every change live - create a query, watch it populate, refine and repeat. Excel becomes your AI-powered workspace for rapid development and testing.
Create, edit, and optimize M code. Import from files, databases, APIs. Refresh queries and manage load destinations.
Build Data Models, create DAX measures, manage table relationships. Full Power Pivot automation.
Create PivotTables from ranges, tables, or Data Model. Build charts and PivotCharts with full formatting control.
Read/write data, formulas, formatting. Filter, sort, validate. Manage Excel Tables with structured references.
View, import, update, and execute VBA code. Export modules for version control.
Manage sheets, named ranges, data connections. Copy/move sheets between workbooks.
Tool behavior validated with real AI agents using agent-benchmark. We test that LLMs correctly understand and use our tools.
See all 22 tools and 211 operations β
Ask your AI assistant to automate Excel tasks using natural language:
You: "Create a new Excel file with a table for tracking sales - include Date, Product, Quantity, Unit Price, and Total with sample data and formulas."
AI creates the workbook, adds headers, enters sample data, and builds formulas automatically.
You: "Create a PivotTable showing total sales by Product, then add a bar chart to visualize the results."
AI creates the PivotTable with proper field configuration and adds a linked chart.
You: "Use Power Query to import products.csv, load it to the Data Model, and create measures for Total Revenue and Average Rating."
AI imports the data, adds it to Power Pivot, and creates DAX measures ready for analysis.
You: "Create a slicer for the Region field so I can filter the PivotTable interactively."
AI adds a slicer connected to your PivotTable for point-and-click filtering.
You: "Format the Price column as currency, highlight values over $500 in green, and convert this to an Excel Table."
AI applies number formats, conditional formatting, and structured table styling.
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. Better for cost-sensitive, high-throughput automation. |
| MCP Server | Conversational AI (Claude Desktop, VS Code Chat) | Rich tool discovery, persistent connection. Better for interactive, exploratory workflows. |
For coding agents, scripting, RPA workflows, and CI/CD pipelines β automate Excel with or without AI:
dotnet tool install -g Sbroenne.ExcelMcp.CLI
# Session-based workflow (keeps Excel open between commands)
excelcli -q session create report.xlsx # Returns session ID
excelcli -q range set-values --session 1 --sheet Sheet1 --range A1 --values '[["Hello","World"]]'
excelcli -q session close --session 1 --save
Background Daemon: A system tray icon appears when the CLI is running. Right-click to view active sessions, close files, or stop the daemon.
π CLI Documentation β Full command reference and examples
π Complete Feature Reference β All 22 tools and 211 operations
π₯ Installation Guide β Setup for VS Code, Claude Desktop, other MCP clients, and CLI
π€ Agent Skills β Cross-platform AI guidance for Copilot, Claude Code, Cursor, Windsurf
π Changelog β Release notes and version history
Skills are auto-installed by the VS Code extension. For other platforms:
npx add-skill sbroenne/mcp-server-excel
π More details β
Other projects by the author: