OfficeMCP
A server that allows AI models to automate Microsoft Office applications (Word, Excel, PowerPoint, etc.) through COM interface on Windows, enabling natural language control of Office functions.
README
<div align="center">
<!-- omit in toc -->
OfficeMCP v1.0.5
<strong>>The most seeable and free way to control Microsof applications by AI model.</strong>
</div>
OfficeMCP
OfficeMCP server is designed for AI to automate Microsoft Office Applications (Word, Excel, PowerPoint, Access, OneNote, Visio, Project, WPS.word, Wps.powerpoint, wps.excel etc.) by COM interface in Windows OS. Not working on Linux/MacOS.
Warns
Please keep it in mind, as OfficeMCP not limit the usage of python. epeciall there's a tool RunPython(...) to execute python codes created by Ai model. But it is also the most wonderfull parts of OfficeMCP. we can't guarantee that your AI model will not do something bad to your computer. we don't take any responsibility.
System Requirements
-
Windows system
-
python 3.1 or above installed
-
uv installed open an shell window and run command
pip install uv
How to install OfficeMCP
There are two ways or two modes to install OfficeMCP (They also can be used in the same time):
1. Use 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. Use OfficeMCP as sse server:
- One OfficeMCP server for multi mcp client mode
- You can change port and host as you like
- This is recommended way to use OfficeMCP server.
step 1:
Run one command in shell or power shell:
uvx officemcp sse
the Mcp server url will be: "http://127.0.0.1:8888/sse" or "http://127.0.0.1:8888/sse" the default work folder is D:@officemcp
or something like below
uvx officemcp sse --port 7777 --host 127.0.0.8 --folder D:\myfolder
"url" will be : "http://127.0.0.8:7777/sse"
step 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:8888/sse"
}
}
}
or
{
"servers": {
"OfficeMCP": {
"url": "http://{your_host}:{your_port}/sse"
}
}
}
Usage
On AI IDE, you can ask AI model to control Office Applications by OfficeMCP server:
-
You ask AI model to open a new Office Application. AI model will send a request to OfficeMCP server, and OfficeMCP server will open a new Office Application.
-
You ask AI model to do whatever you want to do in the current Office Application. AI model will analyze your request, and call OfficeMCP server's tool to accomplish your request.
Tools Reference
Tools:
-
AvailableApps(): check if Microsoft Office applications are installed on your computer.
-
RunningApps(): get a list of currently running Office applications.
-
IsAppAvailable(...): check if a specific Office application is installed.
-
Launch(...): launch a new Office application and set its visibility.
-
Visible(...): set the specified Office application's visibility to True or False.
-
Quit(...): quit the specified Office application.
-
Demonstrate(): run a demonstration of OfficeMCP automation features.
-
Speak(...): speak a string you passed in.
-
Beep(...): play a beep sound.
-
DefaultFolder(...): return the OfficeMCP root work folder default is ("D:\OfficeMCP")
-
IsFileExists(sub_path): check if a file exists in the OfficeMCP root folder.
-
DownloadImage(...): download an image from a given URL and save it to the specified path.
-
RunPython(codes,data): run python code in the OfficeMCP server context.
- This is the most powerful tool in OfficeMCP server. AI can use this tool to do anything supported by the server, including automating Office applications.
- There is an object "Officer" that can be used in the python code, e.g.
Officer.Excelholds the current Excel com Application, and more are Officer.Word, Officer.Powerpoint, Office.Visio, Officer.Access, Officer.OneNote, Officer.Visio, Officer.Project. Office.Kwps for WPS word, Office.Ket for WPS excell, Office.Kwpp for WPS powerpoint. - There is an object "output" as RunPython(...) return that can be used in the python code, to put your own return result in to output, like output="run python sccessed", then RunPython return "run python sccessed" to AI model.
- You can use Officer.Visio to create a new Visio document, and then use Officer.Visio.ActivePage to get the active page, and use Officer.Visio.ActivePage.DrawRectangle(...) to draw a rectangle on the page.
- You can use Officer.Excel to create a new Excel document, and then use Officer.Excel.ActiveSheet to get the active sheet, and use Officer.Excel.ActiveSheet.Cells(...) to get the cell, and use Officer.Excel.ActiveSheet.Cells(...).Value = "hello" to set the cell value.
- You use codes to control them by running the codes with RunPython tool.
-
More tools will be added in the future.
Development
git clone https://github.com/officemcp/officemcp
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。