WPS Skills | WPS Office 智能助手 | WPS Office AI Assistant
$git clone https://github.com/lc2panda/wps-skillsInstalls into the current project.
Install wps-skills by running `git clone https://github.com/lc2panda/wps-skills`, then use it for the current task and follow its documentation at https://github.com/lc2panda/wps-skills.
| 1 | # WPS Skills |
| 2 | |
| 3 | > 此项目的任何功能、架构更新,必须在结束后同步更新相关文档。这是我们契约的一部分。 |
| 4 | |
| 5 | AI编程助手通过自然语言操控WPS Office的MCP工具集。 |
| 6 | |
| 7 | ## 项目定位 |
| 8 | |
| 9 | 本项目是MCP Server + Skills框架,让AI助手(Claude Code/Cursor/Augment等)能操控WPS Office。 |
| 10 | - 231个MCP专业工具 + 12个内置工具 = 243个 |
| 11 | - 支持Excel(82工具) / Word(28工具) / PPT(112工具) / 通用(9工具) |
| 12 | - 支持macOS、Windows、Linux |
| 13 | |
| 14 | ## 前提条件 |
| 15 | |
| 16 | - 已安装 WPS Office(https://www.wps.cn/ 或 https://www.wps.com/) |
| 17 | - Node.js >= 18.0.0 |
| 18 | - Git |
| 19 | |
| 20 | ## 自动安装(AI执行) |
| 21 | |
| 22 | 以下步骤由AI助手自动执行。需要人类交互的步骤标注 ⚠️。 |
| 23 | |
| 24 | ### 步骤1: 克隆项目 |
| 25 | |
| 26 | ```bash |
| 27 | git clone https://github.com/lc2panda/wps-skills.git |
| 28 | cd wps-skills |
| 29 | ``` |
| 30 | |
| 31 | 如果项目已存在,跳过此步。 |
| 32 | |
| 33 | ### 步骤2: 安装依赖并编译 |
| 34 | |
| 35 | ```bash |
| 36 | cd wps-office-mcp |
| 37 | npm install |
| 38 | npm run build |
| 39 | cd .. |
| 40 | ``` |
| 41 | |
| 42 | ### 步骤3: 配置MCP Server |
| 43 | |
| 44 | 根据使用的AI工具,将以下配置写入对应文件。注意将路径替换为实际的项目绝对路径。 |
| 45 | |
| 46 | **Claude Code** — 写入 `~/.claude/settings.json`: |
| 47 | ```json |
| 48 | { |
| 49 | "mcpServers": { |
| 50 | "wps-office": { |
| 51 | "command": "node", |
| 52 | "args": ["/你的路径/wps-skills/wps-office-mcp/dist/index.js"] |
| 53 | } |
| 54 | } |
| 55 | } |
| 56 | ``` |
| 57 | |
| 58 | **Cursor** — 写入项目根目录 `.cursor/mcp.json`: |
| 59 | ```json |
| 60 | { |
| 61 | "mcpServers": { |
| 62 | "wps-office": { |
| 63 | "command": "node", |
| 64 | "args": ["/你的路径/wps-skills/wps-office-mcp/dist/index.js"] |
| 65 | } |
| 66 | } |
| 67 | } |
| 68 | ``` |
| 69 | |
| 70 | **OpenAI Codex CLI** — 写入 `~/.codex/config.toml`: |
| 71 | ```toml |
| 72 | [mcp_servers.wps-office] |
| 73 | command = "node" |
| 74 | args = ["/你的路径/wps-skills/wps-office-mcp/dist/index.js"] |
| 75 | ``` |
| 76 | 或命令行注册:`codex mcp add wps-office -- node /你的路径/wps-skills/wps-office-mcp/dist/index.js` |
| 77 | |
| 78 | **Augment / 其他MCP兼容IDE** — 参考各IDE的MCP Server配置文档,使用相同的command和args。本项目 MCP Server 为标准 stdio 实现(spec 2025-11-25),与所有 MCP 一等客户端(Claude Code / Cursor / Codex CLI / GitHub Copilot CLI / Windsurf 等)兼容。 |
| 79 | |
| 80 | ### 步骤4: 安装WPS加载项 |
| 81 | |
| 82 | ⚠️ 需要人工操作(AI无法直接操作WPS应用): |
| 83 | |
| 84 | ```bash |
| 85 | # macOS |
| 86 | bash scripts/auto-install-mac.sh |
| 87 | |
| 88 | # Windows (PowerShell) |
| 89 | powershell scripts/install.ps1 |
| 90 | |
| 91 | # Linux |
| 92 | bash scripts/install.sh |
| 93 | ``` |
| 94 | |
| 95 | ⚠️ 安装后必须重启WPS Office才能生效。 |
| 96 | |
| 97 | ### 步骤5: 安装Skills(仅Claude Code需要) |
| 98 | |
| 99 | ```bash |
| 100 | # 创建skills目录(如不存在) |
| 101 | mkdir -p ~/.claude/skills |
| 102 | |
| 103 | # 创建符号链接 |
| 104 | ln -sf "$(pwd)/skills/wps-excel" ~/.claude/skills/wps-excel |
| 105 | ln -sf "$(pwd)/skills/wps-word" ~/.claude/skills/wps-word |
| 106 | ln -sf "$(pwd)/skills/wps-ppt" ~/.claude/skills/wps-ppt |
| 107 | ln -sf "$(pwd)/skills/wps-office" ~/.claude/skills/wps-office |
| 108 | ``` |
| 109 | |
| 110 | ### 步骤6: 验证安装 |
| 111 | |
| 112 | ```bash |
| 113 | # 验证MCP Server可启动 |
| 114 | node wps-office-mcp/dist/index.js & |
| 115 | # 应看到 "MCP Server started successfully" 日志 |
| 116 | kill %1 2>/dev/null |
| 117 | ``` |
| 118 | |
| 119 | ## 架构 |
| 120 | |
| 121 | ``` |
| 122 | Skills层(SKILL.md自然语言指导) |
| 123 | ↓ Claude Code调用 |
| 124 | MCP Server层(239个工具) |
| 125 | ↓ wpsClient.executeMethod() |
| 126 | 执行层 |
| 127 | ├── macOS: wps-claude-assistant (227 action, HTTP轮询) |
| 128 | └── Windows: wps-com.ps1 (231 action, COM接口) |
| 129 | ``` |
| 130 | |
| 131 | ## 工具清单 |
| 132 | |
| 133 | | 应用 | 工具数 | 主要能力 | |
| 134 | |------|--------|---------| |
| 135 | | Excel | 82 | 公式/数据/图表/透视表/工作表/格式/工作簿/行列/批注保护/图片导出 | |
| 136 | | Word | 28 | 格式/内容/文档管理/页眉页脚/批注/模板填写/段落结构 | |
| 137 | | PPT | 112 | 幻灯片/形状/图片/表格/美化/动画/图表/3D/数据可视化/图片导出 | |
| 138 | | 通用 | 9 | 保存/连接检测/文本选取/格式转换 | |
| 139 | | 内置 | 12 | 连接检查/万能方法调用/数据缓存 | |
| 140 | |
| 141 | ## 故障排除 |
| 142 | |
| 143 | | 问题 | 解决方案 | |
| 144 | |------|---------| |
| 145 | | MCP连接失败 | 确认 `npm install && npm run build` 已执行,检查dist/index.js存在 | |
| 146 | | WPS未响应 | 重启WPS Office,确认加载项已安装 | |
| 147 | | "arguments error" | 重新运行安装脚本,重启WPS | |
| 148 | | Linux找不到插件 | 查看INSTALL.md中的Linux专用指南 | |
| 149 | | 工具调用返回null | 确认WPS中已打开对应类型的文档 | |
| 150 | |
| 151 | ## 许可证 |
| 152 | |
| 153 | MIT |