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

Special Features:

  • Supports Excel, Word, PowerPoint, Outlook, Visio, Access, and Project

  • Registry-based Office application detection

  • COM object management for Office interoperability

  • 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 OfficeMCP 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' workbook 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/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.1.tar.gz (21.3 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.1-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for officemcp-1.0.1.tar.gz
Algorithm Hash digest
SHA256 66dd9be8d0822397fd5711e1929e7dfe67479474b6eb644cad3ad2287beea5aa
MD5 57a91e3cfb97ea411a97dfafdc007e49
BLAKE2b-256 f508e21cb87b066bc5993e34acc5a04c7ccd4b99dadef78706d78082c68110d2

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for officemcp-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4ed80712fd7bd8bd1f094580edba171df177cb3986a4b6c1af08b3bb3c656a8b
MD5 30ef9c5c8e0b59f791dff08434c45926
BLAKE2b-256 9cc985b953349ab627f9630b79d519c67b7e3019935181b76c3d387fedd42d21

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