这是一个用于PowerPoint操作的Model Context Protocol (MCP)插件,允许AI助手通过编程方式创建和操作PowerPoint演示文稿。
# 克隆仓库
git clone https://github.com/islem-zaraa/mcp-powerpoint.git
# 导航到项目目录
cd mcp-powerpoint
# 安装依赖
npm install
# 链接到本地开发环境
npm link
此插件可以直接作为命令行工具使用:
# 创建一个新的演示文稿
mcp-powerpoint create --outputPath="presentation.pptx" --title="我的演示文稿"
# 向现有演示文稿添加幻灯片
mcp-powerpoint add-slide --file="presentation.pptx" --title="新幻灯片" --content="这是幻灯片的内容"
# 获取演示文稿中的幻灯片
mcp-powerpoint get-slides --file="presentation.pptx"
# 将演示文稿导出为PDF
m
mcp-powerpoint export-pdf --file="presentation.pptx" --outputPath="presentation.pdf"
# 读取演示文稿的元数据
mcp-powerpoint read --file="presentation.pptx"
此插件可以集成到兼容MCP的AI助手系统中:
const mcpPowerPointPlugin = require('mcp-powerpoint/src/mcp-plugin');
// 将插件注册到您的MCP系统
mcpSystem.registerPlugin(mcpPowerPointPlugin);
// 现在AI可以通过MCP协议使用PowerPoint功能
// 示例函数调用:
// - mcp_powerpoint_create_presentation
// - mcp_powerpoint_add_slide
// - mcp_powerpoint_get_slides
// - mcp_powerpoint_export_to_pdf
// - mcp_powerpoint_read_presentation
创建一个新的PowerPoint演示文稿。
参数:
outputPath:保存PowerPoint文件的路径(必须以.pptx结尾)title:(可选)演示文稿的标题向现有的PowerPoint演示文稿添加幻灯片。
参数:
file:PowerPoint文件的路径title:(可选)幻灯片的标题content:(可选)幻灯片的内容从PowerPoint演示文稿获取幻灯片。
参数:
file:PowerPoint文件的路径将PowerPoint演示文稿导出为PDF。
参数:
file:PowerPoint文件的路径outputPath:保存PDF文件的路径(必须以.pdf结尾)读取PowerPoint演示文稿的元数据和结构。
参数:
file:PowerPoint文件的路径MIT
欢迎贡献!请随意提交Pull Request。 ### 主题