Get the FREE Ultimate OpenClaw Setup Guide →

mcp -excel

Excel MCP Server & CLI - 23 tools, 214 operations for AI-powered Excel automation via COM API

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio sbroenne-mcp-server-excel npx -y mcp-excel \
  --env EXCEL_DEMO_MODE="set to 1 to enable demo/test mode, 0 to disable" \
  --env EXCEL_INSTALL_PATH="Path to Microsoft Excel installation (e.g., C:\Program Files\Microsoft Office\root\Office16)"

How to use

ExcelMcp is an MCP Server that enables AI assistants such as GitHub Copilot, Claude, and ChatGPT to automate Microsoft Excel via natural language commands. It exposes 25 specialized tool families (Power Query, Data Model/DAX, Excel Tables, PivotTables, Charts, VBA, Ranges, Worksheets, Connections, Named Ranges, Files, Calculation Mode, Slicers, Conditional Formatting, Screenshot, and Window Management) with hundreds of operations, all interfacing through the MCP protocol. Users interact with the server through prompts that map to concrete Excel actions, such as importing data with Power Query, creating PivotTables and charts, formatting ranges, running VBA macros, or managing workbook structure and protections. The server emphasizes safety by leveraging Excel’s native COM API, avoiding direct file manipulation, and provides interactive development workflows to observe results in real time as you issue prompts.

To use the server, install the MCP client tooling (e.g., via npx add-mcp for the Excel MCP package) and start the server using the provided command. Then, in your MCP-enabled agent or IDE integration, craft prompts that select the desired tool and operation (e.g., Create a PivotTable showing total sales by Product, then add a bar chart; or Import data with Power Query and load it to the Data Model). The server coordinates with Excel to execute the requested actions and returns results, statuses, and any outputs or visual artifacts back to your agent for further refinement.

How to install

Prerequisites:

  • Windows with Microsoft Excel installed (Excel 2016 or newer)
  • Node.js (recommended) and npm installed for running the MCP server via npx
  • Administrative privileges may be required for certain Excel automation scenarios

Install steps:

  1. Install Node.js and npm from https://nodejs.org if you don’t already have them.

  2. Open a terminal or PowerShell with normal user permissions.

  3. Install the MCP Excel server via npx (first-run may download dependencies):

    npx -y mcp-excel

  4. If you prefer explicit install via the MCP package registry, you can add the MCP package to your environment (example):

    npx add-mcp "mcp-excel" --name excel-mcp

  5. Ensure Excel is closed before starting automation to guarantee exclusive access per the server’s guidance.

  6. Start the MCP server (use whatever startup command your environment requires; the package typically exposes a runnable entry point through the MCP framework).

Note: The README describes a Node-based MCP entry via npx with the package name mcp-excel. If you are using a different installer or a dotnet/CLI path, follow the corresponding package’s official installation steps for the Excel MCP server.

Additional notes

Tips and considerations:

  • Windows-only, due to COM-based Excel automation. Ensure you have a compatible Excel installation and a desktop session.
  • The server relies on Excel’s native COM API for safe, controlled automation; it is not suited for headless server-side Excel processing.
  • If you run into Excel interop issues, verify that Excel is not started in a conflicting state (close all Excel processes or run with isolated sessions).
  • The environment variables section can be customized to point to your Excel installation or to toggle demo/test modes during development.
  • When using ML prompts, start with simple tasks (e.g., Create a new workbook and add a table) to validate the connection before moving to more complex operations like Power Query pipelines or DAX measures.
  • Refer to the Complete Feature Reference for precise operation names and parameters for each of the 225 operations.

Related MCP Servers

Sponsor this space

Reach thousands of developers