MCP ExplorerExplorer

Excelmcp

@OfficeMCPon a month ago
1 GPL-3.0
FreeCommunity
AI Systems
An MCP server for AI to control Microsoft excel application.

Overview

What is Excelmcp

ExcelMCP is an MCP server designed for AI to automate the Microsoft Excel application on Windows OS. It does not support Linux or MacOS.

Use cases

Use cases for ExcelMCP include automating data entry, generating reports, performing complex calculations, and managing Excel files programmatically through AI models.

How to use

To use ExcelMCP, you can install it in two modes: as a stdio server for one MCP client or as an SSE server for multiple MCP clients. Configuration involves setting up the MCP.json file with the appropriate server settings and running commands in the shell or PowerShell.

Key features

Key features of ExcelMCP include the ability to check if Excel is installed, launch a new Excel application, control its visibility, and quit the application. It allows AI models to interact with Excel seamlessly.

Where to use

ExcelMCP is primarily used in environments where automation of Excel tasks is required, such as data analysis, reporting, and business intelligence within organizations that utilize Microsoft Excel.

Content

ExcelMCP

ExcelMCP server is designed for AI to Automate Microsoft Excel Application in Windows OS. Not working on Linux/MacOS.

Installation

There are two ways or two modes to install ExcelMCP (They also can be used in the same time):

1. User ExcelMCP as stdio server:

  • One ExcelMCP server for One MCP Client mode
  • Put following setting to MCP.json file for vscode or some proper place for other AI IDE:
{
  "servers": {
    "ExcelMCP": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "excelmcp"
      ]
    }
  }
}

2. User ExcelMCP as sse server:

  • One ExcelMCP server for multi MCP Client mode
  • You can change port and host as you like

step 1:

Run one command in shell or power shell:

uvx excelmcp sse

With “url”: “http//127.0.0.1:8000/sse”

or

uvx excelmcp sse --port 8009

or

uvx excelmcp sse 8009

or

uvx excelmcp sse --port 8009 --host 127.0.0.1

With “url”: “http//127.0.0.1:8009/sse”

setp 2:

Put following setting to MCP.json file for vscode or some proper place for other AI IDE:

{
  "servers": {
    "ExcelMCP": {
      "url": "http//127.0.0.1:8009/sse"
    }
  }
}

Usage

On AI IDE, you can ask AI modle to control Excel Application by ExcelMCP server:

  • You ask AI modle to open a new Excel Application.
    AI modle will send a request to ExcelMCP server, and ExcelMCP server will open a new Excel Application.

  • You ask AI modle to do whatever you want to do in the current Excel Application.
    AI modle will analye your request, and call ExcelMCP server’s tool to accomplish your request.

Tools Reference

Tools:

  • Installed(): chedk if Excel Application is installed on your computer.

  • Launch(…): launch a new Excel Application and set it’s visibility.

  • Visible(): set the current Excel Application’s visibility to True or False.

  • Quit(): quit the current Excel Application.

  • WorkBook(BookPath:=None): create a new Excel WorkBook if BootPath is None or empty and open or save an Excel WorkBook as the BookPath refer to.

  • There’re some other tools not mentioned here.

  • RunPython(…): run python code in the current Excel Application.

    • This is most powerful tool in ExcelMCP server. AI can use this tool to do whatever you want to do in the current Excel Application.
    • There’s an Global variable named class instance “The” in the python code, “The.Excel” hold the current Excel Application,
    • The openpyxl library is imported in the python code, so you can use openpyxl to manipulate excel files.
  • More other tools will be added in the future.

Development

git clone https://github.com/officemcp/excelmcp

Tools

No tools

Comments

Recommend MCP Servers

View All MCP Servers