Office MCP server

Enables AI to automate Microsoft Office applications (Word, Excel, PowerPoint, and more) through COM interfaces in Windows, providing tools for launching programs, manipulating documents, capturing screenshots, and managing files.
Back to servers
Provider
OfficeMCP
Release date
May 18, 2025
Language
Python
Stats
9 stars

OfficeMCP is a server implementation of the Model Context Protocol (MCP) that enables AI models to control Microsoft Office applications through a COM interface on Windows. This tool allows for automated interaction with applications like Word, Excel, PowerPoint, and others, creating a bridge between AI capabilities and office productivity software.

Installation Options

OfficeMCP can be installed and run in two different modes, which can be used independently or simultaneously.

Installing as a stdio Server

This setup creates a dedicated OfficeMCP server for a single MCP client:

  1. Ensure you have Python 3.1+ and the uv package manager installed:

    pip install uv
    
  2. Add the following configuration to your MCP.json file in VSCode or other AI IDE:

    {
        "mcpServers": {
            "OfficeMCP": {
                "type": "stdio",
                "command": "uvx",
                "args": [
                    "officemcp"
                ]
            }
        }
    }
    

Installing as an SSE Server (Recommended)

This setup allows multiple MCP clients to connect to a single OfficeMCP server:

  1. Start the server with the default configuration:

    uvx officemcp sse
    

    This will start the server at http://127.0.0.1:8888/sse with the default work folder at D:\@officemcp

  2. Alternatively, customize the server configuration:

    uvx officemcp sse --port 7777 --host 127.0.0.8 --folder D:\myfolder
    
  3. Add the server configuration to your MCP.json file:

    {
        "servers": {
            "OfficeMCP": {
                "url": "http://127.0.0.1:8888/sse"
            }
        }
    }
    

    Or with custom settings:

    {
        "servers": {
            "OfficeMCP": {
                "url": "http://{your_host}:{your_port}/sse"
            }
        }
    }
    

Using OfficeMCP

With OfficeMCP properly set up, you can ask your AI model to control Office applications:

  1. Request the AI to open a new Office application.
  2. Direct the AI to perform specific tasks within the application.

The AI model will analyze your requests and use OfficeMCP's tools to execute the appropriate actions.

Available Tools

Application Management

  • AvailableApps(): Lists all installed Microsoft Office applications
  • RunningApps(): Shows currently running Office applications
  • IsAppAvailable(...): Checks if a specific Office application is installed
  • Launch(...): Opens a new Office application with visibility control
  • Visible(...): Sets an application's visibility (True/False)
  • Quit(...): Closes a specified Office application

System Interaction

  • Speak(...): Uses text-to-speech to read a string aloud
  • Beep(...): Plays a beep sound
  • DefaultFolder(...): Returns the OfficeMCP root work folder
  • IsFileExists(sub_path): Checks if a file exists in the work folder
  • DownloadImage(...): Downloads an image from a URL to a specified path

Advanced Features

  • Demonstrate(): Runs a demonstration of OfficeMCP automation capabilities
  • RunPython(codes, data): Executes custom Python code in the server context
    • Provides access to the "Officer" object with properties like Officer.Excel, Officer.Word, etc.
    • Results can be returned through the "output" variable
    • Enables complex automation scenarios for Office applications

Usage Examples

The RunPython tool is particularly powerful, allowing for detailed control of applications:

  • For Excel operations:

    Officer.Excel.ActiveSheet.Cells(1, 1).Value = "Hello World"
    
  • For Visio drawing:

    Officer.Visio.ActivePage.DrawRectangle(1, 1, 2, 2)
    

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later