AI-Powered Excel Automation
Control Microsoft Excel with Natural Language through AI assistants like GitHub Copilot and Claude. One-click install for Visual Studio Code.
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 - no Excel programming knowledge required.
π‘οΈ 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.
Optional CLI Tool: For advanced users who prefer command-line scripting, ExcelMcp includes a CLI interface for RPA workflows, CI/CD pipelines, and batch automation. Both interfaces share the same 173 operations.
One-click setup with GitHub Copilot integration
12 specialized tools with 173 operations covering Power Query, DAX, Charts, VBA, PivotTables, ranges, conditional formatting, and more
Uses Excel's native COM API - zero corruption risk, full compatibility
See changes in real-time - create, test, refine, and iterate instantly. Use Excel as a REPL.
π‘ Tip: Say "Show me Excel while you work" to watch changes live!
Describe what you want, AI does the rest
173 operations covering Power Query, DAX, Charts, VBA, Tables, and more
Choose MCP for AI assistants or CLI for scripts and RPA
π Complete Installation Guide
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 SalesData showing top 10 products by region"
AI creates the PivotTable with proper field configuration in seconds.
You: "Format revenue as currency, make headers bold blue, and add borders"
AI applies all formatting directly to your Excel file.
Automate Power Query Refresh
# Refresh all queries in a workbook (CI/CD pipeline)
excel-mcp pq-refresh --file "sales-report.xlsx" --query "SalesData"
Batch Update Worksheets
# Process multiple workbooks in PowerShell
Get-ChildItem *.xlsx | ForEach-Object {
excel-mcp sheet-create --file $_.Name --name "Summary"
excel-mcp range-set-values --file $_.Name --sheet "Summary" --range "A1" --values "[[\"Generated: $(Get-Date)\"]]"
}
Export VBA for Version Control
# Export all VBA modules to Git repository
excel-mcp vba-export --file "macro-workbook.xlsm" --module "Module1" --output "src/vba/Module1.bas"
12 specialized tools with 173 operations:
| Action | Description |
|---|---|
list |
List all Power Query queries in workbook |
view |
View M code for a specific query |
create |
Create new Power Query from M code |
update |
Update existing queryβs M code |
delete |
Delete a Power Query |
refresh |
Refresh a specific query to reload data |
refresh-all |
Refresh all queries in workbook |
get-load-config |
Get load destination settings for a query |
load-to |
Load query data to worksheet, data model, or both |
| Action | Description |
|---|---|
list-tables |
List all tables in Data Model |
read-table |
Read data from a Data Model table |
list-columns |
List all columns in a table |
list-measures |
List all DAX measures in a table |
read |
Read details of a specific measure |
create-measure |
Create new DAX measure |
update-measure |
Update existing DAX measure formula or format |
delete-measure |
Delete a DAX measure |
list-relationships |
List all table relationships |
read-relationship |
Read details of a specific relationship |
create-relationship |
Create relationship between tables |
update-relationship |
Update relationship properties |
delete-relationship |
Delete a relationship |
read-info |
Get Data Model metadata and statistics |
refresh |
Refresh entire Data Model |
| Action | Description |
|---|---|
list |
List all Excel Tables in workbook |
read |
Read table data and properties |
create |
Create new Excel Table from range |
rename |
Rename an Excel Table |
delete |
Delete an Excel Table |
resize |
Resize table range |
set-style |
Apply table style (TableStyleMedium2, etc.) |
toggle-totals |
Show/hide totals row |
set-column-total |
Set aggregation function for column total |
append |
Append rows to table |
get-data |
Return table data (optionally respecting active filters) |
add-to-datamodel |
Add table to Power Pivot Data Model |
apply-filter |
Apply filter criteria to column |
apply-filter-values |
Filter by specific values |
clear-filters |
Clear all filters |
get-filters |
Get current filter settings |
add-column |
Add new column to table |
remove-column |
Remove column from table |
rename-column |
Rename table column |
get-structured-reference |
Get structured reference formula |
sort |
Sort table by column |
sort-multi |
Sort by multiple columns |
get-column-number-format |
Get number format for column |
set-column-number-format |
Set number format for column |
| Action | Description |
|---|---|
list |
List all PivotTables in workbook |
read |
Read PivotTable configuration |
create-from-range |
Create PivotTable from range |
create-from-table |
Create PivotTable from Excel Table |
create-from-datamodel |
Create PivotTable from Data Model |
delete |
Delete a PivotTable |
refresh |
Refresh PivotTable data |
list-fields |
List all available fields |
add-row-field |
Add field to Rows area |
add-column-field |
Add field to Columns area |
add-value-field |
Add field to Values area with aggregation |
add-filter-field |
Add field to Filters area |
remove-field |
Remove field from PivotTable |
set-field-function |
Set aggregation function (Sum, Count, Average, etc.) |
set-field-name |
Set custom field display name |
set-field-format |
Set number format for value field |
set-field-filter |
Apply filter to a field |
sort-field |
Sort field values |
get-data |
Extract PivotTable data as values |
set-grand-totals |
Configure grand totals display |
set-column-grand-totals |
Show/hide column grand totals |
set-row-grand-totals |
Show/hide row grand totals |
get-grand-totals |
Get grand totals configuration |
set-subtotals |
Configure subtotals for fields |
get-subtotals |
Get subtotals configuration |
| Action | Description |
|---|---|
list |
List all charts in the workbook |
read |
Read chart metadata and data source information |
create-from-range |
Create chart from a worksheet range |
create-from-pivottable |
Create PivotChart from a PivotTable |
delete |
Delete a chart |
move |
Move and resize chart on the sheet |
set-source-range |
Update chart source range |
add-series |
Add a new data series to the chart |
remove-series |
Remove a data series by index |
set-chart-type |
Change chart type (Column, Line, Pie, etc.) |
set-title |
Set chart title text |
set-axis-title |
Set title for primary or secondary axes |
show-legend |
Show/hide legend and set legend position |
set-style |
Apply built-in chart style (1-48) |
| Action | Description |
|---|---|
get-values |
Read cell values from range |
set-values |
Write values to range |
get-formulas |
Read formulas from range |
set-formulas |
Write formulas to range |
get-number-formats |
Get number formats for range |
set-number-format |
Set number format (currency, percentage, date, etc.) |
set-number-formats |
Set multiple number formats at once |
clear-all |
Clear values, formulas, and formatting |
clear-contents |
Clear values and formulas only |
clear-formats |
Clear formatting only |
copy |
Copy range (all attributes) |
copy-values |
Copy values only |
copy-formulas |
Copy formulas only |
insert-cells |
Insert cells with shift direction |
delete-cells |
Delete cells with shift direction |
insert-rows |
Insert rows |
delete-rows |
Delete rows |
insert-columns |
Insert columns |
delete-columns |
Delete columns |
find |
Find cells matching criteria |
replace |
Find and replace in range |
sort |
Sort range by columns |
get-used-range |
Get actual used range in worksheet |
get-current-region |
Get contiguous range around cell |
get-info |
Get range metadata (address, size, etc.) |
add-hyperlink |
Add hyperlink to cell |
remove-hyperlink |
Remove hyperlink from cell |
list-hyperlinks |
List all hyperlinks in range |
get-hyperlink |
Get hyperlink details |
get-style |
Get cell style name |
set-style |
Apply built-in Excel style |
format-range |
Apply visual formatting (font, fill, border, alignment) |
validate-range |
Add data validation rules (dropdowns, number/date/text rules) |
get-validation |
Get validation settings |
remove-validation |
Remove data validation |
autofit-columns |
Auto-fit column widths |
autofit-rows |
Auto-fit row heights |
merge-cells |
Merge cells in range |
unmerge-cells |
Unmerge cells |
get-merge-info |
Get merge status and areas |
set-cell-lock |
Lock/unlock cells for protection |
get-cell-lock |
Get cell lock status |
| Action | Description |
|---|---|
add-rule |
Add conditional formatting rule (cell value or expression-based) |
clear-rules |
Clear conditional formatting from range |
| Action | Description |
|---|---|
list |
List all VBA modules in workbook |
view |
View VBA module code |
import |
Import VBA code from file |
delete |
Delete VBA module |
run |
Execute VBA macro |
update |
Update existing VBA module code |
| Action | Description |
|---|---|
list |
List all data connections |
view |
View connection details and settings |
create |
Create new data connection (OLEDB, ODBC, Text, Web) |
test |
Test connection validity |
refresh |
Refresh connection to reload data |
delete |
Delete a connection |
load-to |
Load connection data to worksheet |
get-properties |
Get connection properties |
set-properties |
Update connection properties |
| Action | Description |
|---|---|
list |
List all worksheets in workbook |
create |
Create new worksheet |
rename |
Rename worksheet |
copy |
Copy worksheet within same workbook |
delete |
Delete worksheet |
move |
Move worksheet to different position |
copy-to-file |
Copy worksheet to different file (atomic, no session needed) |
move-to-file |
Move worksheet to different file (atomic, no session needed) |
set-tab-color |
Set worksheet tab color (RGB) |
get-tab-color |
Get current tab color |
clear-tab-color |
Remove tab color |
hide |
Hide worksheet from UI (visible in VBA) |
very-hide |
Hide from UI and VBA |
show |
Make worksheet visible |
get-visibility |
Get current visibility state |
set-visibility |
Set visibility state |
| Action | Description |
|---|---|
list |
List all named ranges |
read |
Read named range value |
write |
Write value to named range |
create |
Create new named range |
update |
Update named range reference |
delete |
Delete named range |
| Action | Description |
|---|---|
open |
Open workbook session |
close |
Close workbook session without saving |
create-empty |
Create new empty workbook (.xlsx or .xlsm) |
close-workbook |
Close workbook and optionally save changes |
test |
Test if workbook can be opened |