Token导航 LogoToken导航TokenDH.com
Pptx Xlsx MCP logo
地图位置stdio官方级别未说明来源级核验

Pptx Xlsx MCP

MCP Server

通过AI辅助与Microsoft Office应用程序交互的模型上下文协议服务器,支持PowerPoint和Excel的自动化操作。

工具数

0

提示词数

0

GitHub Stars

29

资源数

0
办公自动化PythonClaudeClaude DesktopClaude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

jenstangen1

提供方

jenstangen1

最后核验

2026/5/17 20:20

运行时

Python

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

python C:\path\to\your\env\Scripts\pywin32_postinstall.py -install

详细介绍

Microsoft Office MCP服务器

此存储库包含模型上下文协议(MCP)服务器,用于通过人工智能辅助与Microsoft Office应用程序进行交互。当前支持的应用程序:

  • PowerPoint:创建和操作演示文稿
  • Excel:与工作簿和电子表格交互

两台服务器都使用 pywin32 用于COM自动化,允许与正在运行的Office应用程序直接交互。

先决条件

  • Windows操作系统
  • 已安装Microsoft Office(PowerPoint和/或Excel)
  • Python 3.7+
  • pywin32 包裹

安装

  1. 克隆存储库:
git clone https://github.com/jenstangen1/mcp-pptx.git
cd mcp-pptx
  1. 使用安装依赖项 uv:
uv pip install pywin32
  1. 跑吧 pywin32 具有管理员权限的安装后脚本:
python C:\path\to\your\env\Scripts\pywin32_postinstall.py -install

与克劳德建立关系

要将这些MCP服务器与Claude集成,请将以下配置添加到您的Claude Desktop应用程序设置中:

{
    "mcpServers": {
        "powerpoint_mcp_win32": {
            "command": "uv",
            "args": [
                "run",
                "mcp_powerpoint_server_win32.py"
            ],
            "cwd": "C:\\path\\to\\your\\workspace"
        },
        "excel_mcp_win32": {
            "command": "uv",
            "args": [
                "run",
                "mcp_excel_server_win32.py"
            ],
            "cwd": "C:\\path\\to\\your\\workspace"
        }
    }
}

注:更换 C:\\path\\to\\your\\workspace 使用您的实际工作空间路径。

PowerPoint MCP服务器

PowerPoint服务器为人工智能模型提供了一个全面的API,以与PowerPoint演示文稿交互,支持高级格式、财务图表和数据集成。

特性

展示管理

  • 创建和修改PowerPoint演示文稿
  • 添加、删除和修改幻灯片
  • 从工作区保存和加载演示文稿
  • 模板管理系统

元素操作

  • 对幻灯片元素(文本、形状、图像、图表)进行细粒度控制
  • 先进的形状创建和造型
  • 元素定位和分组
  • 形状之间的连接线

金融一体化

  • 创建财务图表(折线图、条形图、柱状图、饼图、瀑布图等)
  • 生成比较表
  • 支持各种财务指标:

- 收入 - EBITDA - 利润 - 资产 - 股权 - 增长率 - 边距

  • 目前使用伪数据,计划为挪威公司数据集成Proff API
  • 可通过API定制来适应其他金融数据提供商

样式和格式

  • 富文本格式
  • 形状样式(填充、渐变、轮廓)
  • 图表定制
  • 背景颜色和效果

注意:您可能需要修改目录路径以匹配您的安装位置。

可用的MCP工具

展示管理

  • list_presentations:列出工作区中的所有PowerPoint文件
  • upload_presentation:将新演示文稿上载到工作区
  • save_presentation:保存当前演示文稿

滑动操作

  • add_slide:在演示文稿中添加新幻灯片
  • delete_slide:从演示文稿中删除幻灯片
  • get_slide_count:获取演示文稿中的幻灯片总数
  • analyze_slide:分析幻灯片的内容
  • set_background_color:设置幻灯片的背景颜色

元素操作

  • add_text:向幻灯片添加文本
  • add_shape:向幻灯片添加形状
  • edit_element:编辑元素的属性
  • style_element:将样式应用于元素
  • connect_shapes:使用连接器连接两个形状
  • find_element:根据标准查找幻灯片上的元素

金融工具

  • get_company_financials:获取公司的财务数据(目前返回虚拟数据)
  • create_financial_chart:在幻灯片上创建财务图表
  • create_comparison_table:为公司创建比较表

注: 金融工具目前使用虚拟数据。未来的版本计划与Proff API集成,以自动获取挪威公司的数据。用户可以修改代码以连接到本地或首选的金融数据提供商。

模板操作

  • list_templates:列出所有可用模板
  • apply_template:将模板应用于演示文稿
  • create_slide_from_template:从模板创建新幻灯片
  • save_as_template:将幻灯片另存为模板

调试工具

  • debug_element_mappings:调试工具,用于检查幻灯片的元素映射

用法

与克劳德互动

在Claude Desktop应用程序中配置MCP服务器后,您可以通过自然语言命令与PowerPoint和Excel进行交互。以下是一些示例:

PowerPoint示例

You: Create a new slide with a title "Market Analysis" and add a bar chart showing revenue growth.

Claude: I'll help you create that slide with the title and chart. I'll:
1. Add a new slide
2. Add the title text
3. Create a revenue chart

[Claude will then use the MCP tools in sequence:
- add_slide
- add_text
- create_financial_chart]

You: Make the title bigger and change its color to blue.

Claude: I'll modify the title's formatting.
[Claude will use:
- find_element (to locate the title)
- edit_element (to update the formatting)]

You: Add a comparison table below the chart comparing three companies.

Claude: I'll add a comparison table below the existing chart.
[Claude will use:
- create_comparison_table]

Excel示例

You: Open the Q4 report and show me the revenue numbers from cells B2 to B5.

Claude: I'll help you retrieve those revenue figures.
[Claude will use:
- list_open_workbooks (to find the workbook)
- get_range_values (to read the specified cells)]

You: Calculate the sum of these numbers and put it in cell B6.

Claude: I'll calculate the sum and write it to B6.
[Claude will use:
- get_range_values (to get the numbers)
- set_cell_value (to write the sum)]

You: Create a new sheet called "Summary" and copy these values there.

Claude: I'll create a new sheet and copy the data.
[Claude will use:
- add_worksheet
- get_range_values (from source)
- set_range_values (to destination)]

运作原理

  1. 自然语言理解

- 克劳德解释你的请求,并将其分解为具体的行动 - 它从之前的交互中理解上下文 - 它可以处理复杂的多步骤操作

  1. 工具选择

- Claude会自动为每个任务选择合适的MCP工具 - 它可以将多个工具连接在一起进行复杂的操作 - 它处理错误情况并提供反馈

  1. 上下文管理

- Claude维护了以下内容的上下文: - 当前打开的文件 - 最近的行动 - 选定元素 - 用户偏好

  1. 错误处理

- 如果操作失败,Claude将: - 解释出了什么问题 - 建议替代方案 - 帮助解决常见问题

最佳实践

  1. 具体

- 相关时提及幻灯片编号 - 在Excel中指定精确的单元格范围 - 清楚地描述所需的格式

  1. 复杂操作

- 将复杂的请求分解为步骤 - 确认中间结果 - 根据需要要求调整

  1. 故障排除

- 确保PowerPoint/Excel正在运行 - 检查文件权限 - 验证COM自动化是否正常工作 - 如果需要,运行pywin32_postinstall.py

示例工作流

创建财务演示文稿

You: Create a new presentation about Q4 financial results.
Claude: I'll create a new presentation with a title slide.

You: Add revenue charts for the last 4 quarters.
Claude: I'll create a new slide with a chart showing quarterly revenue.

You: Now add a comparison with our competitors.
Claude: I'll add a comparison table with key metrics for you and competitors.

分析Excel数据

You: Show me all sheets in the Q4 analysis workbook.
Claude: I'll list all worksheets in that workbook.

You: Find the highest revenue value in column B.
Claude: I'll scan column B and find the maximum value.

You: Create a summary of the top 5 values.
Claude: I'll create a new sheet with the top 5 revenue figures.

目录结构

pptx-mcp/
├── mcp_powerpoint_server.py  # Main server implementation
├── requirements.txt          # Python dependencies
├── presentations/           # Workspace for presentations
│   └── templates/          # Template storage
└── README.md               # This file

依赖项

  • python-pptx:PowerPoint文件操作
  • 枕头:图像处理
  • numpy:数值运算
  • MCP SDK:模型上下文协议实现

贡献

欢迎投稿!请随时提交拉取请求。

许可证

此项目根据MIT许可证获得许可-有关详细信息,请参阅许可证文件。

Excel MCP服务器

Excel服务器提供了通过AI辅助与Excel工作簿、工作表和单元格数据交互的工具。

特性

工作簿管理

  • 连接到正在运行的Excel实例
  • 列出打开的工作簿
  • 以各种格式(.xlsx、.xlsm、.xlsb、.xls)保存工作簿

工作表操作

  • 在工作簿中列出工作表
  • 添加新工作表
  • 按名称或索引访问工作表

单元和靶场操作

  • 读取和写入单个单元格值
  • 获取和设置单元格范围的值
  • 处理各种数据类型(文本、数字、日期、货币)
  • 日期和货币值的自动类型转换

可用的MCP工具

工作簿管理

  • list_open_workbooks:列出当前打开的所有Excel工作簿
  • save_workbook:使用可选格式选择将工作簿保存到磁盘

工作表操作

  • list_worksheets:列出工作簿中的所有工作表
  • add_worksheet:向工作簿中添加新工作表
  • get_worksheet:按名称或索引获取工作表

单元和靶场操作

  • get_cell_value:读取单个单元格的值
  • set_cell_value:设置单个单元格的值
  • get_range_values:从一系列单元格中读取值
  • set_range_values:为一系列单元格设置值

备注

  • 这两台服务器都需要安装Windows及其各自的Microsoft Office应用程序
  • 服务器与 *跑步* 应用程序的实例
  • COM自动化需要正确的初始化;如果遇到与COM相关的错误,请运行安装后脚本
  • 为了更好地进行持续处理,请考虑使用 makepy 生成Office常量

目录标签

目录标签

办公自动化PythonClaude本地部署AI辅助PowerPoint操作Excel操作COM自动化

支持客户端

Claude DesktopClaude

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

运行时(runtime,运行环境)

Python

工具数量(toolCount,工具数)

0

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdionone部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP