Skip to main content

Add your description here

Project description

OfficeMCP

OfficeMCP 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 OfficeMCP (They also can be used in the same time):

1. User OfficeMCP as stdio server:

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

2. User OfficeMCP as sse server:

  • One OfficeMCP 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 OfficeMCP sse

With "url": "http//127.0.0.1:8000/sse"

or

uvx OfficeMCP sse --port 8009

or

uvx OfficeMCP sse 8009

or

uvx OfficeMCP 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": {
        "OfficeMCP": {
            "url": "http//127.0.0.1:8009/sse"
        }
    }
}

Usage

OfficeMCP enables AI-driven Excel automation through natural language commands. Example chat-based workflow:

  1. Check Excel Availability
    @OfficeMCP IsAppAvailable {"app_name": "Excel"}

  2. Launch Excel
    @OfficeMCP Launch {"app_name": "Excel"}

  3. Make Excel Visible
    @OfficeMCP Visible {"app_name": "Excel", "visible": true}

  4. Create Workbook
    @OfficeMCP RunPython {"PythonCode": "this.Excel.Workbooks.Add()"}

  5. Add Sample Data

    @OfficeMCP RunPython {
      "PythonCode": "this.Excel.ActiveSheet.Range('A1').Value = 'AI Generated Report'"
    }```
    

Tools Reference

Core Tools:

  • AvailableApps(): Checks which Microsoft Office applications are installed

  • IsAppAvailable(app_name: str,visible: bool=true): Verifies if a specific Office application is installed

  • Launch(app_name: str): Starts an Office application instance

  • Visible(app_name: str, visible: bool): Controls application visibility

  • Quit(app_name: str): Terminates an Office application

  • RunPython(PythonCode: str): Executes Python scripts within Office applications

    • Access application via this.Excel, this.Word, etc.
  • Demonstrate(): Shows interactive demo of capabilities

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

    • This is most powerful tool in OfficeMCP server. AI can use this tool to do whatever you want to do in the Microsoft Applications.
    • There's an Global variable named class instance "this" in the python code, "this.Excel" hold the current Excel
  • More other tools will be added in the future.

Development

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

officemcp-1.0.2.tar.gz (21.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

officemcp-1.0.2-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file officemcp-1.0.2.tar.gz.

File metadata

  • Download URL: officemcp-1.0.2.tar.gz
  • Upload date:
  • Size: 21.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.16

File hashes

Hashes for officemcp-1.0.2.tar.gz
Algorithm Hash digest
SHA256 76fc51900d9b85d6b55ce1e8794470bb46a41ef1d79d7aa1d3dc43da74f50561
MD5 b426efa5d5a0a7481214a716280fe42e
BLAKE2b-256 c123c3c10314bf8ddd67f68be3df8de9c02e19b023a4d459386a64069322f988

See more details on using hashes here.

File details

Details for the file officemcp-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: officemcp-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.16

File hashes

Hashes for officemcp-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 73dd5be9cef668dc8fa3960e08a8baa9ad6c011b50660f2b31aace259b3a52b3
MD5 92cf989d1bd0dc281f2c9c1b68d5f84b
BLAKE2b-256 bfa80cd1fae089650b34002f0685ae0e42abaedbdd89a84194fe6737ce821429

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page