WPS Office MCP
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@WPS Office MCP What is the current selection in the active WPS document?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
WPS Office MCP
面向 Windows 的 WPS Office Model Context Protocol(MCP)桥接器。它通过本机 PowerShell 与 WPS COM 自动化接口,让 Codex 或其他 stdio MCP 客户端检查 WPS Writer、Spreadsheets 和 Presentation 的活动对象与内容。
当前发行版:
1.0.0-hardened.1。默认compact配置仅发布 29 个明确选择的 读取/检查工具;不会默认开放编辑、保存、删除、导出或任意方法调用。
本仓库是可重新部署的源码包,不包含 WPS Office、账号、许可证、用户文档、真实路径、 访问令牌或日志。使用者需要自行安装并合法使用 WPS Office。
设计目标
以最小权限连接当前 Windows 用户会话中的 WPS Office。
默认只读:compact allowlist 覆盖连接、Writer、Spreadsheets 和 Presentation 检查。
移除通用
wps_execute_method分发器,避免绕过工具级边界。compact 工具附带 MCP 只读、非破坏、幂等和闭合世界提示。
日志目录可配置,请求参数默认脱敏,stdio stdout 默认保持纯净。
源码、锁文件、安装/启动脚本和 CI 均可从全新克隆重建。
Related MCP server: Sky Windows Remote Executor
调用链
Codex / MCP client
│ MCP over stdio
▼
WPS MCP server ── compact allowlist / schema validation / redacted logging
│
▼
PowerShell bridge (`scripts/wps-com.ps1`)
│ Windows COM
▼
WPS Writer (`Kwps`) / Spreadsheets (`Ket`) / Presentation (`Kwpp`)完整模块关系、配置档和信任边界见 架构说明。
运行要求
Windows 10/11;COM 模式不支持 Linux。
已安装且可由当前 Windows 用户启动的 WPS Office。
Node.js 18 或更高版本,附带 npm。
Codex 或其他支持 stdio MCP 的客户端。
PowerShell 5.1 或 PowerShell 7。
安装与启动
克隆仓库或解压 Release 后,在普通 PowerShell 中运行:
Set-ExecutionPolicy -Scope Process Bypass
.\scripts\setup.ps1该脚本执行锁文件安装、TypeScript 构建和公开包隐私检查。网络受限环境可以在依赖已缓存
时运行 npm ci --offline,但不得删除完整性校验或改用未锁定依赖。
手动调试 stdio 服务器:
.\scripts\start.ps1正常使用时由插件根目录的 .mcp.json 启动 dist/index.js。如果客户端不支持相对
cwd,请在该客户端的私有配置中填写自己的安装目录;不要提交该文件。
配置
.env.example 只列出可选变量与安全默认值,不含任何用户信息。服务本身读取进程环境;
可以在 MCP 客户端配置中设置这些变量,或在启动前由用户自己的脚本设置。
变量 | 默认值 | 说明 |
|
|
|
|
| 私有日志目录;已被 Git 忽略 |
|
| 保持 0,避免记录文档文本、路径或密码 |
|
| 保持 stdout 纯净,避免破坏 stdio MCP |
|
| 日志详细程度 |
|
| MCP 调试开关 |
默认 29 工具
领域 | 数量 | 内容 |
连接与通用 | 9 | 连通性、活动对象、应用信息、选区 |
Writer | 6 | 活动/已打开文档、正文、段落、查找、修订状态 |
Spreadsheets | 7 | 已打开工作簿、单元格/公式/信息、工作表、选区、区域读取 |
Presentation | 7 | 已打开演示、页数、页面信息/备注/文本框/标题、文本查找 |
实际 allowlist 以 .mcp.json 和
src/server/mcp-server.ts 中的 COMPACT_TOOL_NAMES 为准,两处均应保持 29 项且由 CI
校验。完整工具实现仍保留在源码中,只有显式设置 WPS_MCP_TOOL_PROFILE=full 才会注册
写入型目录。
授权与风险
WPS Office 是独立产品,本仓库不提供或绕过其软件许可。
COM 调用运行在当前 Windows 用户权限下,可访问该用户已打开的文档。
full配置能够改写、删除、保存、导出、保护或关闭文件,不属于默认安全配置。不应把文档密码放入
.env、日志、Issue、CI 或示例;需要密码的写工具只应在受控的 临时调用中接收。启用 full 前,应取得用户明确授权、确认目标文档并建立可恢复副本。
公开 Issue 和测试夹具不得包含真实文档、账号、路径、注释作者或业务数据。
安全报告和部署建议见 SECURITY.md。
开发与测试
npm ci
npm run build
npm run verify:publicnpm run verify:public 检查用户目录、私钥材料、明显的嵌入式凭据和误纳入的私有 .env。
真实 COM 冒烟测试必须在 Windows 与 WPS Office 上人工执行:先打开一个不含隐私的临时
文档,只测试 compact 工具,不应在 CI 中启动桌面 Office 或上传测试文档。
仓库结构
wps/
├─ .codex-plugin/plugin.json Codex 插件清单
├─ .mcp.json 可移植、29 工具 compact 配置
├─ .env.example 无私密值的环境变量模板
├─ skills/wps-office/ Codex 工作流与风险边界
├─ src/
│ ├─ server/ MCP 服务器、注册表与 profile 过滤
│ ├─ client/ WPS 客户端与 PowerShell 进程桥接
│ ├─ tools/ Writer / Excel / PPT / common 工具
│ ├─ types/ 协议和 WPS 类型
│ └─ utils/ 日志与错误处理
├─ scripts/
│ ├─ wps-com.ps1 Windows COM 实现
│ ├─ setup.ps1 / setup.cmd 锁定依赖与构建
│ ├─ start.ps1 / start.cmd 安全默认启动
│ └─ verify-public-package.mjs 隐私和发布边界检查
├─ docs/architecture.md 调用链和信任模型
├─ package.json / package-lock.json
└─ .github/workflows/ci.yml 构建、清单和隐私检查上游与版本
本发行版基于 lc2panda/wps-skills
提交 a82533662268b3245f93d8685bc45dffede048b6。保留原项目 MIT License 和作者归属,
并以 -hardened.1 标识本地安全配置差异。完整说明见 NOTICE.md、
HARDENING.md 和 CHANGELOG.md。
贡献
贡献前请阅读 CONTRIBUTING.md。任何新增工具必须说明它属于读取还是 写入能力、是否具有破坏性、应在哪个 profile 发布,以及如何避免记录敏感参数。
项目采用 MIT License。
Available Tools
29 toolswps_check_connectionBRead-onlyIdempotent
检查WPS Office连接状态
Inputs: no named parameters.
wps_common_get_app_infoARead-onlyIdempotent
获取WPS应用的基本信息。
使用场景:
"WPS是什么版本"
"查看WPS信息"
"获取应用状态"
特点:
返回WPS版本号、构建信息
返回当前打开的文档信息
返回运行平台信息
Inputs: no named parameters.
wps_common_get_selected_textARead-onlyIdempotent
获取当前文档中选中的文本内容。
使用场景:
"读取我选中的内容"
"获取当前选区的文字"
"看看我选了什么"
特点:
返回当前选区的纯文本内容
适用于Word、Excel、PPT
Inputs: no named parameters.
wps_common_pingARead-onlyIdempotent
检测WPS应用连接状态。
使用场景:
"WPS连上了吗"
"检查一下WPS是否在线"
"测试WPS连接"
特点:
快速检测WPS加载项是否可达
返回连接状态信息
Inputs: no named parameters.
wps_common_wire_checkARead-onlyIdempotent
检查与WPS加载项之间的通信线路状态。
使用场景:
"检查通信状态"
"诊断连接问题"
"通信线路是否正常"
特点:
比ping更详细的通信诊断
返回线路延迟、协议状态等信息
Inputs: no named parameters.
wps_excel_get_cell_infoARead-onlyIdempotent
获取单元格的详细信息(值、公式、格式等)。
Inputs: cell (required), sheet (required).
wps_excel_get_cell_valueCRead-onlyIdempotent
获取Excel指定单元格的值。
Inputs: col (required), row (required), sheet (required).
wps_excel_get_formulaBRead-onlyIdempotent
获取Excel指定单元格的公式。
Inputs: cell (required), sheet (required).
wps_excel_get_open_workbooksARead-onlyIdempotent
获取当前所有已打开的Excel工作簿列表。
Inputs: no named parameters.
wps_excel_get_selectionARead-onlyIdempotent
获取当前Excel中选中区域的信息,包括范围地址、行列数等。
Inputs: no named parameters.
wps_excel_get_sheet_listARead-onlyIdempotent
获取当前工作簿的所有工作表列表,包含名称、索引和是否为活动工作表。
Inputs: no named parameters.
wps_excel_read_rangeBRead-onlyIdempotent
读取Excel指定范围的单元格数据,返回二维数组格式的数据。
Inputs: range (required), sheet, include_header.
wps_get_active_documentBRead-onlyIdempotent
获取当前打开的WPS文字文档信息
Inputs: no named parameters.
wps_get_active_presentationBRead-onlyIdempotent
获取当前打开的WPS演示文稿信息
Inputs: no named parameters.
wps_get_active_workbookARead-onlyIdempotent
获取当前打开的WPS表格工作簿信息
Inputs: no named parameters.
wps_get_cell_valueBRead-onlyIdempotent
读取指定单元格的值
Inputs: col (required), row (required), sheet (required).
wps_ppt_find_ppt_textARead-onlyIdempotent
在演示文稿中搜索指定文本。
返回包含目标文本的幻灯片页码和形状信息。
使用场景:
"搜索PPT中的某段文字"
"查找包含关键词的幻灯片"
"找到所有提到xxx的位置"
Inputs: text (required).
wps_ppt_get_open_presentationsARead-onlyIdempotent
获取当前所有已打开的演示文稿列表。
使用场景:
"有哪些PPT打开着"
"列出所有演示文稿"
"查看打开的PPT"
Inputs: no named parameters.
wps_ppt_get_slide_countARead-onlyIdempotent
获取演示文稿中的幻灯片总数。
使用场景:
"一共有多少页幻灯片"
"PPT有几页"
"查看幻灯片数量"
Inputs: no named parameters.
wps_ppt_get_slide_infoARead-onlyIdempotent
获取指定幻灯片的详细信息,包括布局、元素列表等。
使用场景:
"查看第3页的信息"
"这页有什么内容"
"获取幻灯片详情"
Inputs: slideIndex (required).
wps_ppt_get_slide_notesARead-onlyIdempotent
获取指定幻灯片的备注内容。
使用场景:
"查看第3页的备注"
"读取演讲备注"
"这页有什么备注"
Inputs: slideIndex (required).
wps_ppt_get_slide_titleBRead-onlyIdempotent
获取指定幻灯片的标题。
Inputs: slideIndex (required).
wps_ppt_get_textboxesARead-onlyIdempotent
获取幻灯片上所有文本框的列表。
Inputs: slideIndex (required).
wps_word_find_in_documentARead-onlyIdempotent
在Word文档中查找文本并返回位置信息,不执行替换操作。
使用场景:
"找一下'项目名称'在文档的哪个位置"
"看看文档里有哪些地方需要填写"
在使用smart_fill_field之前,先用此工具定位关键字
返回信息包括:匹配文本、字符起止位置、所在段落索引、上下文(前后50字符)。 与find_replace不同,此工具仅查找不替换,返回位置信息供后续操作使用。
Inputs: find_text (required), match_case, max_results, match_whole_word.
wps_word_get_active_documentBRead-onlyIdempotent
获取当前WPS Writer活动文档的基本信息
Inputs: no named parameters.
wps_word_get_document_textARead-onlyIdempotent
获取当前Word文档的文本内容。
使用场景:
"读取文档内容"
"获取文档的前100个字符"
"查看文档从第50到第200个字符的内容"
可指定起始和结束位置来获取部分文本。
Inputs: end, start.
wps_word_get_open_documentsARead-onlyIdempotent
获取当前WPS Writer中所有已打开的文档列表。
使用场景:
"看看现在打开了哪些文档"
"列出所有打开的Word文件"
"查看当前文档列表"
Inputs: no named parameters.
wps_word_get_paragraphsARead-onlyIdempotent
获取Word文档的段落结构信息,返回每段的文本、样式和字符位置。
使用场景:
"了解文档的结构"
"查看文档有哪些段落"
"帮我看看模板里有哪些需要填写的位置"
在填写模板前,先读取文档结构以识别填写位置
返回信息包括:段落索引、文本内容、样式名称、字符起止位置。 支持分页获取(startParagraph/endParagraph),默认返回前50段。
Inputs: end_paragraph, start_paragraph.
wps_word_get_track_changes_statusARead-onlyIdempotent
获取当前文档的修订模式状态。
使用场景:
"看看修订模式开了没"
"当前文档有多少处修订"
"检查修订状态"
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 29 tools
Several tools overlap heavily: wps_check_connection, wps_common_ping, and wps_common_wire_check all test connectivity; wps_get_active_document duplicates wps_word_get_active_document; wps_get_cell_value duplicates wps_excel_get_cell_value. Word/PPT find functions and paragraph/text retrieval are distinct, but these redundancies create real selection risk.
All names use snake_case and mostly follow wps_<domain>_<verb>_<object>, but older generic tools like wps_get_active_document, wps_get_cell_value, and wps_check_connection lack domain prefixes, while wps_ppt_find_ppt_text is redundantly worded. The pattern is readable but not consistently applied.
29 tools is above the 25+ threshold and feels heavy, especially since several tools are near-duplicates (ping/check_connection/wire_check, active_document variants, cell_value variants) and could be consolidated or removed. It is not egregiously over-scoped for three Office applications, but it is larger than needed.
The surface is almost entirely read/inspection-oriented: it can locate and read content, but cannot modify cells, edit documents, update presentations, create files, or fill the fields that its own find tools are meant to identify. For an Office automation MCP, the inability to make any changes is a significant gap.
Maintenance
Related MCP Connectors
Read-only MCP access to a documented IT fleet: state, changes, posture. 15 tools.
Read-only DERO blockchain MCP: 33 tools (12 composites) incl. TELA discovery + bundled docs.
Generate, edit, merge, translate and PDF-convert PowerPoint (.pptx) over MCP. 8 tools.
Remote MCP for MCP tool deprecation receipt, structured receipts, audit logs, and reviewer-ready evi
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables secure static analysis of Microsoft Office documents and related file types for malicious content, integrating with systems that support the MCP protocol.4-
- AlicenseNot gradedqualityDmaintenanceEnables remote execution of commands, file operations, screenshots, and clipboard access on Windows machines through MCP tools.1MIT
- FlicenseNot gradedqualityDmaintenanceEnables reading and searching documents in allowlisted folders via LiteLLM and MCP tools, using COM for Office files to support IRM-protected content.-
- AlicenseNot gradedqualityBmaintenanceEnables AI agents on Windows to drive real Microsoft Word and WPS Office applications through COM, automating legacy .doc/.docx batch conversion, bookmark and placeholder template filling, print-fidelity PDF export, extraction from legacy binaries, editing of documents currently open on screen, and mail-merge batch generation. It hardens these operations with CJK font preservation, password and corruption pre-checks, structured self-correcting errors, path allowlisting, read-only mode, and automatic Word-to-WPS failover.1MIT