Skip to content
Excel MCP Server icon

Excel MCP Server

Automate Excel with AI via GitHub Copilot, Claude and other MCP clients — including Power Query, DAX, VBA, PowerPivot and Tables.

VS Code Marketplace installs GitHub stars GitHub downloads NuGet MCP Server downloads NuGet CLI downloads

Home

A Model Context Protocol (MCP) server and CLI for comprehensive Excel automation through conversational AI. Excel MCP Server lets AI assistants — GitHub Copilot, Claude, ChatGPT and any MCP-compatible client — drive Microsoft Excel with natural language: Power Query & M, PowerPivot & DAX, VBA macros, PivotTables, charts, formatting and much more. 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 drives Excel's official COM API, ensuring complete safety and compatibility. Watch Excel update in real time as the AI works — just say "Show me Excel while you work."

Key features

  • Power Query & M code


    Create, edit and optimize M code. Import from files, databases and APIs. Refresh queries and manage load destinations.

  • Power Pivot & DAX


    Build Data Models, create DAX measures and manage table relationships. Full Power Pivot automation.

  • PivotTables & charts


    Create PivotTables from ranges, tables or the Data Model. Build charts and PivotCharts with full formatting control.

  • Tables & ranges


    Read/write data, formulas and formatting. Filter, sort and validate. Manage Excel Tables with structured references.

  • VBA macros


    View, import, update and execute VBA code. Export modules for version control.

  • Worksheets & connections


    Manage sheets, named ranges and data connections. Copy and move sheets between workbooks.

  • Agent mode


    Watch AI work in Excel in real time — side-by-side view, live status-bar feedback and smart window arrangement, like a pair programmer in a spreadsheet.

  • LLM-tested quality


    Tool behavior validated with real LLM workflows using pytest-skill-engineering. We test that LLMs correctly understand and use our tools.

  • Python in Excel


    Write and run =PY() formulas that execute in Excel's cloud Python engine — process worksheet data with pandas, NumPy and more, from your AI assistant.

See all 26 tools and 232 operations

What can you do with it?

Ask your AI assistant to automate Excel tasks using natural language:

📝 Create & populate data

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."

The AI creates the workbook, adds headers, enters sample data and builds formulas automatically.

📊 PivotTables & charts

You: "Create a PivotTable showing total sales by Product, then add a bar chart to visualize the results."

The AI creates the PivotTable with proper field configuration and adds a linked chart.

🔄 Power Query & Data Model

You: "Use Power Query to import products.csv, load it to the Data Model, and create measures for Total Revenue and Average Rating."

The AI imports the data, adds it to Power Pivot and creates DAX measures ready for analysis.

🎨 Formatting & tables

You: "Format the Price column as currency, highlight values over $500 in green, and convert this to an Excel Table."

The AI applies number formats, conditional styling, auto-fit and structured table styling.

CLI or MCP Server?

This package ships both a CLI and an MCP Server. They share the same core, so every operation behaves identically — pick the entry point that fits your workflow:

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 and a persistent connection. Better for interactive, exploratory workflows.

MCP Server docs CLI docs

How it works

Excel MCP Server uses Windows COM automation to control the actual Excel application — not just .xlsx files. The MCP Server and CLI are two equal, first-class entry points. Each hosts its own service: the MCP Server runs it in-process (direct calls, no pipe), while the CLI uses a background daemon over a named pipe so sessions persist across excelcli invocations.

┌──────────────────────┐        ┌──────────────────────┐
│  MCP Server          │        │  CLI (excelcli)      │
│  (AI assistants)     │        │  (coding agents)     │
└──────────┬───────────┘        └──────────┬───────────┘
           │ in-process                    │ named pipe →
           │ (direct calls)                │ background daemon
           ▼                               ▼
┌──────────────────────┐        ┌──────────────────────┐
│  ExcelMCP Service    │        │  ExcelMCP Service    │
│  (session mgmt)      │        │  (daemon; sessions   │
│                      │        │   persist across     │
│                      │        │   CLI invocations)   │
└──────────┬───────────┘        └──────────┬───────────┘
           ▼                               ▼
      Core Commands                   Core Commands
           ▼                               ▼
┌──────────────────────┐        ┌──────────────────────┐
│  Excel COM API       │        │  Excel COM API       │
│  (Excel.Application) │        │  (Excel.Application) │
└──────────────────────┘        └──────────────────────┘

Both entry points share the same Core Commands codebase, so every operation behaves identically. They run as separate processes, each with its own service and Excel instance, and do not share live sessions with each other.

Documentation

  • Feature reference

    All 26 tools and 232 operations, grouped by category.

  • Installation guide

    Setup for VS Code, Claude Desktop, other MCP clients and the CLI.

  • MCP Server

    Complete MCP tool reference and examples.

  • CLI

    Full CLI command reference and examples.

  • Agent skills

    Cross-platform AI guidance for 43+ agents.

  • Changelog

    Release notes and version history.

Other projects by the author: