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.
One-click setup with GitHub Copilot integration
MCP 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.
See all 12 tools and 180 operations β
Ask your AI assistant to automate Excel tasks using natural language:
You: "This Power Query is taking 5 minutes to refresh. Can you optimize it?"
AI analyzes your M code, identifies inefficiencies, and applies best practices automatically.
You: "Create a PivotTable from the Data Model showing top 10 products by region with a DAX measure for profit margin"
AI creates the PivotTable, adds fields, and builds the DAX measure in seconds.
You: "Create a column chart from SalesData and add a trend line"
AI builds the chart with proper formatting and data series configuration.
You: "Write a VBA macro that exports all sheets to PDF"
AI creates, imports, and can execute VBA code directly in your workbook.
You: "Convert this range to an Excel Table, format revenue as currency, and add conditional formatting for values over 10000"
AI applies structured tables, number formats, and conditional rules.
For scripting, RPA workflows, and CI/CD pipelines β automate Excel without AI:
dotnet tool install -g Sbroenne.ExcelMcp.CLI
# Refresh Power Query
excel-cli pq refresh sales.xlsx --query SalesData
# Export VBA for version control
excel-cli vba export macro-workbook.xlsm --module Module1 --output src/vba/
# Read range values
excel-cli range get-values report.xlsx --sheet Sheet1 --range A1:D10
The CLI provides 172 operations across 13 command groups, sharing the same Core engine as the MCP Server.
π Complete Feature Reference β All 12 tools and 180 operations
π₯ Installation Guide β Setup for VS Code, Claude Desktop, other MCP clients, and CLI
π Changelog β Release notes and version history
Other projects by the author: