Excel MCP Server

Excel MCP Server Icon

Excel MCP Server

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.

NuGet MCP Server Installs GitHub Downloads

🤔 What is This?

Stop manually clicking through Excel menus for repetitive tasks. Instead, describe what you want in plain English and let the coding agent and the MCP Server handle the task:

The AI assistant analyzes your request, generates the proper Excel automation commands, and executes them directly in your Excel application - no formulas or programming knowledge required.

🚀 Visual Studio Code Quick Start (1 Minute)

One-click setup with GitHub Copilot integration

Install from Marketplace

What is This Project?

ExcelMcp is a comprehensive Excel automation toolkit with two interfaces:

  1. MCP Server: Enables AI assistants (GitHub Copilot, Claude, ChatGPT) to automate Excel through natural language commands
  2. CLI Tool: Provides direct command-line control for scripting, RPA, and CI/CD workflows

Both share the same core functionality: automate Power Query, DAX measures, VBA macros, PivotTables, formatting, and data transformations. Choose MCP for AI-powered conversations or CLI for programmatic control.

🛡️ 100% Safe - Uses Excel’s Native COM API

Unlike third-party libraries that manipulate .xlsx files directly (risking file corruption), ExcelMcp uses Excel’s official COM API. This ensures:

đź’» For Developers: Think of Excel as an AI-powered REPL - write code (Power Query M, DAX, VBA), execute instantly, inspect results visually in the live workbook. No more blind editing of .xlsx files.

Key Features

156 Operations

11 specialized tools covering Power Query, DAX, VBA, PivotTables, ranges, conditional formatting, and more

100% Safe

Uses Excel's native COM API - zero corruption risk, full compatibility

Interactive Development

See changes in real-time - create, test, refine, and iterate instantly. Use Excel as a REPL.

Natural Language Control

Describe what you want, AI does the rest

Comprehensive Automation

155 operations covering Power Query, DAX, VBA, Tables, and more

Dual Interface

Choose MCP for AI assistants or CLI for scripts and RPA

Use Cases

Data Transformation & Analysis

👉 See examples of Power Query and DAX automation

Formatting & Styling (No Programming)

👉 See examples of formatting automation

Workflow Automation

Installation

VS Code Extension Recommended

One-click setup with GitHub Copilot integration

Install from Marketplace

MCP Server

For Claude, ChatGPT, and other MCP clients

dotnet tool install -g Sbroenne.ExcelMcp.McpServer

CLI Tool

For scripting, RPA, and CI/CD workflows

dotnet tool install -g Sbroenne.ExcelMcp.CLI

đź“– Complete Installation Guide

Documentation

Examples

AI Assistant Examples (MCP Server)

🔍 Optimize Power Query

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.

📊 Create PivotTable

You: "Create a PivotTable from SalesData showing top 10 products by region"

AI creates the PivotTable with proper field configuration in seconds.

🎨 Format Data

You: "Format revenue as currency, make headers bold blue, and add borders"

AI applies all formatting directly to your Excel file.

CLI Examples (Scripting & RPA)

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"

Why Choose This Project?

🤖 MCP Server (AI-Powered)

  • Natural Language Control: Describe tasks in plain English
  • Safe: Official COM API - zero corruption risk
  • Interactive: See changes in real-time in Excel
  • Comprehensive: 155 operations across 11 tools
  • Works with: GitHub Copilot, Claude, ChatGPT, and any MCP client

⚙️ CLI (Automation & Scripting)

  • RPA Ready: Perfect for robotic process automation workflows
  • CI/CD Integration: Automate Excel operations in build pipelines
  • Scripting: PowerShell, Bash, Python integration
  • Batch Processing: Process multiple workbooks programmatically
  • No AI Required: Direct command-line control for scripts
Both Share the Same Core Same 155 operations available via CLI and MCP. Consistent behavior across interfaces. Full .NET library available for custom integrations.

Keywords

Excel automation, MCP server, Model Context Protocol, GitHub Copilot, Claude AI, Power Query, M language, DAX, Power Pivot, VBA macros, Excel Tables, PivotTables, data analysis, spreadsheet automation, RPA, robotic process automation, COM automation, Windows automation, AI Excel assistant, natural language Excel, Excel API, Excel COM interop, Excel CLI, command line Excel, Excel scripting, Excel batch processing, CI/CD Excel, DevOps Excel, Excel PowerShell, Excel automation tool, .NET Excel library, Excel NuGet package