Office文件处理服务器

一个基于Python和MCP协议的服务器,用于创建、读取、更新和删除Microsoft Office文件(Word、Excel、PowerPoint)。

  • by BrenesRM
  • Python
  • 本地部署
  • 更新于
在 GitHub 查看 BrenesRM/MCP-OFFICE

使用说明

📂 Office MCP 服务器

一 MCP(模型上下文协议)服务器 用于处理 Microsoft Office 文件:

  • Word(.docx) → 创建,读取,更新,删除
  • Excel(.xlsx) 创建、读取、更新、删除
  • PowerPoint(.pptx) 创建、读取、更新、删除

使用……构建 python, 紫外线以及MCP的 fastmcp。


⚡ 主机设置

首先,确保你已经 紫外线 已安装:
👉 UV安装指南


📦 安装

# Initialize project
uv init
uv venv

# Activate virtual environment
.venv\Scripts\activate   # on Windows
# source .venv/bin/activate   # on Linux/Mac

# Install MCP and required Office libraries
uv add mcp[cli]
uv add openpyxl python-pptx python-docx

mcp dev server.py   # Run in development mode
mcp install server.py   # Install into your MCP client

🗂 Documents Folder

All Office files are created in the local ./documents folder by default.

🛠 Available Tools

Word → create_docx, read_docx, update_docx, delete_docx

Excel → create_xlsx, read_xlsx, update_xlsx, delete_xlsx

PowerPoint → create_pptx, read_pptx, update_pptx, delete_pptx