
Word AI
io.github.flyfish-dev由 GitHub 帳號 flyfish-dev 發布v0.8.6更新於 Oct 25, 2026
Structure-preserving Word DOCX editing MCP server and Office.js bridge for AI agents.
概覽
一個本機 MCP 伺服器,讓 AI 助理透過保留結構、可稽核的 PatchSet 操作來檢查與編輯 Microsoft Word DOCX 檔案。
- 可以做什麼
- 檢查 DOCX 結構:健康檢查、文件對應、錨點、內容控制項、段落、表格、欄位、圖片、註解與修訂,以及文字差異和版本間結構比較。規劃並套用編輯:產生受限制的 PatchSet 操作,進行評估、試執行、備份、套用、驗證與回復,以雜湊前置條件取代重建文件。操作目前開啟的文件:透過 Office.js 工作窗格與本機橋接,在即時 Word 工作階段中列出、快照、讀取、預覽、套用與回復編輯。選用的唯讀佐證:安裝 OfficeCLI 後,透過包裝工具檢視 HTML、螢幕擷取、問題、JSON 查詢與驗證。
- 適用情境
- 當助理需要修改真實 Word 文件而不破壞樣式、編號、表格、圖片、欄位、頁首或頁尾,且編輯需要試執行、稽核與回復時使用。適合受控的 DOCX 編輯實驗、代理整合與內部工作流程試辦,而非正式環境的遠端部署。
- 執行需求
- 以本機程序在使用者電腦上執行(僅桌面端)。MCPB 套件需要 Python 3.10+,首次執行會建立虛擬環境;獨立套件依平台提供;npm 管道首次執行會下載對應平台的套件。優先使用 .NET 8 Open XML 後端,無法使用時退回 Python。即時 Word 工作階段需要 Office.js 工作窗格、監聽 localhost 的本機橋接及其啟動時輸出的權杖。工作區根目錄與允許的文件資料夾透過參數傳入。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Word AI,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
Word AI
Structure-preserving Word (DOCX) editing for AI agents.
Word AI is an open-source MCP server and Office.js bridge for safe, auditable, incremental editing of Microsoft Word documents. It is designed for Codex, OpenAI Agents, and other MCP clients that need to edit .docx files without rebuilding the document or damaging styles, numbering, tables, images, fields, headers, footers, and relationships.
Why Word AI
AI systems are good at generating text, but Word documents are structured packages. A naive DOCX-to-Markdown-to-DOCX workflow can break numbering, styles, tables, images, fields, references, and layout. Word AI keeps the original DOCX structure as the source of truth:
- Agents generate constrained
PatchSetoperations. - The local engine applies targeted OOXML/Open XML edits.
- Every write goes through assessment, dry-run, backup, validation, audit, and diff.
- The Office.js add-in provides a Word taskpane for anchor governance and human-in-the-loop workflows.
Key Features
- 63 MCP tools for DOCX inspection, anchors, headings, paragraphs, tables, fields, images, comments, revisions, PatchSet planning, dry-run, apply, validation, rollback, diff, live Word session editing, and optional read-only OfficeCLI evidence.
- PatchSet-only writes. No full document rebuilds, no Markdown/HTML round-trips, and no direct source overwrite by default.
- Agent-friendly PatchSet normalization for common aliases such as
operation,target_tag,new_text,text_sha256, and camelCase operation names, while preserving the canonical safety gates. - Content-control first editing using stable Word content control tags such as
WORD-AI:SRS:1.0:overview. - Strong preconditions with
source_sha256,expected_old_sha256, andexpected_old_text. - Structure validation for package parts, content controls, tables, paragraphs, fields, comments, images, revisions, and protected body blocks.
- Python MCP facade and bridge runtime for local agent integration, path policy, session queues, and distribution compatibility.
- .NET 8 Open XML SDK engine as the authoritative offline DOCX transaction backend, using a packaged native binary or Release DLL when available.
- Single-file standalone binaries and quickstart bundles for no-clone, no-venv, no-.NET-SDK offline DOCX editing and one-command Agent Skill installation.
- Office.js taskpane for Word-side anchors, PatchSet preview, dry-run, apply, and open-document content-control editing with hash checks.
- Live Word session tools (
word_session_*) so Codex can read, preview, apply, and roll back edits in the currently open Word document through Office.js. - Local HTTP bridge secured by a local token and localhost-only CORS for Office add-in workflows.
Architecture
The Office.js taskpane is the Word session layer. It creates and lists content controls, connects to the local bridge, registers the current Word document as a live session, polls commands queued by Codex, executes supported PatchSet operations through Office.js, and returns audit/rollback data.
Quick Start
Use the most native distribution path your agent host supports:
- MCP Registry / MCPB first: install the MCP server from the official MCP Registry using server name
io.github.flyfish-dev/word-ai. - Standalone quickstart for the lowest local setup cost: download the current-platform GitHub Release bundle when you want one executable that can run MCP, install the Skill, and generate Codex config without a source checkout.
- Agent Skill next: install the
word-aiSkill so Codex, Claude Code, and compatible agents know when to choose offlinedocx_*versus liveword_session_*. - Local source install for full Word sessions: use this when you need the Office.js taskpane, localhost bridge, .NET Open XML regression path, or development workflow.
- npm as a secondary channel: use npm only when your MCP host cannot consume MCP Registry/MCPB yet, or when you want a no-clone stdio server command.
MCP Registry details:
- Server name:
io.github.flyfish-dev/word-ai - Registry metadata: server.json
- MCPB package:
https://github.com/flyfish-dev/word-ai/releases/download/v0.8.6/word-ai-0.8.6.mcpb - Registry latest API:
https://registry.modelcontextprotocol.io/v0.1/servers/io.github.flyfish-dev%2Fword-ai/versions/latest
Fast local setup with the standalone quickstart bundle:
Choose the artifact matching your platform: linux-x64, linux-arm64, osx-arm64, osx-x64, win-x64, or win-arm64. See Distribution for the complete release asset policy.
Install the Skill and full local runtime:
This installs the Python MCP facade, builds the Office.js taskpane, builds the .NET Open XML backend when .NET SDK 8 is available, writes .wordai/codex-config.toml, and installs the word-ai skill into Codex, Claude Code, and detected compatible agent clients.
Install or refresh only the Agent Skill:
For browser-only taskpane debugging:
On Windows PowerShell:
For a readiness check:
Developer checks:
Build the .NET engine:
Offline Engine Selection
Offline file transactions use the .NET Open XML backend by default when it is available. Selection order is:
WORD_AI_DOTNET_EXEor a packaged native executable undernative/<rid>/ordist/native/<rid>/.WORD_AI_DOTNET_DLLor the local Release DLL atdotnet/WordAi.OpenXml/bin/Release/net8.0/WordAi.OpenXml.dll.- Local source project via
dotnet run --project dotnet/WordAi.OpenXml/WordAi.OpenXml.csproj. - Python OOXML fallback only when .NET is unavailable and
WORD_AI_ENGINE=auto.
MCPB includes self-contained native backends for osx-arm64, osx-x64, linux-x64, linux-arm64, linux-musl-x64, linux-musl-arm64, win-x64, and win-arm64. Standalone quickstart bundles are built for standard hosted platforms: linux-x64, linux-arm64, osx-arm64, osx-x64, win-x64, and win-arm64, with the matching Open XML backend linked into the single-file executable. Word AI detects the current RID, including Linux glibc vs musl for native backend loading, and loads the matching binary automatically. The npm launcher keeps the package small: on first run it downloads the current-platform quickstart bundle from GitHub Releases and executes the bundled word-ai. Advanced deployments can override detection with WORD_AI_DOTNET_RID, WORD_AI_DOTNET_EXE, or WORD_AI_DOTNET_NATIVE_DIR; set WORD_AI_NPM_USE_SOURCE_BOOTSTRAP=1 only when you want the legacy Python venv npm path.
Control it with WORD_AI_ENGINE=auto|dotnet|python, or pass engine to docx_assess_patchset, docx_dry_run_patchset, docx_apply_patchset, and docx_validate. Use WORD_AI_ENGINE=dotnet in production to fail fast instead of silently falling back.
Build the Office add-in:
Agent Skill Auto-Install
Word AI ships a formal word-ai Agent Skill. This is the preferred way to teach agents the safe workflow, even when the MCP server is installed through the MCP Registry. The installer copies the Skill into the locations that current agent clients scan automatically:
- Codex official user skills:
~/.agents/skills/word-ai - Codex app compatibility skills:
~/.codex/skills/word-ai - Claude Code personal skills:
~/.claude/skills/word-ai - Existing compatible clients when detected: Cursor, Windsurf, GitHub Copilot, and OpenClaw skill folders
Install or refresh only the skills:
Advanced targets:
After installation, start a new agent session or restart the client if the skill does not appear immediately. The skill can then be invoked directly as word-ai / $word-ai, or selected implicitly when a DOCX editing task mentions Word, Office.js, content controls, PatchSet, validation, rollback, or audit.
Global MCP Distribution
Word AI is published for discovery through the official MCP Registry and MCPB distribution. Prefer this channel for MCP host installation because it carries standardized server metadata, versioning, transport details, and provenance:
- MCP server name:
io.github.flyfish-dev/word-ai - MCPB package:
https://github.com/flyfish-dev/word-ai/releases/download/v0.8.6/word-ai-0.8.6.mcpb - Registry metadata: server.json
- Publishing guide: MCP Registry Publishing
- Standalone and quickstart guide: Distribution
Local container smoke test:
The MCP Registry release uses a public MCPB artifact for one-click-friendly local server installation. The standalone quickstart bundle is the lowest-friction local command path because it embeds the Python facade, dependencies, current-platform .NET Open XML backend, schemas, and Skill template in one executable. The MCPB package requires Python 3.10+ and bootstraps a local virtual environment on first run. The Dockerfile remains available for local or self-hosted builds. For full Office.js live-session editing, use the local source install path because the Word taskpane and localhost bridge must run on the user's machine.
Secondary npm Channel
npm is a convenience fallback for clients that do not yet consume MCP Registry/MCPB packages, for CI smoke tests, and for quick no-clone stdio server startup. It is not the primary discovery channel.
Recommended scoped package:
Unscoped compatibility package:
After a global install, the same commands are available directly:
The first npm run downloads the current-platform quickstart bundle from GitHub Releases, caches it under the user cache, and executes the bundled standalone word-ai. No Python venv, pip install, or separate Open XML backend download is required on the default npm path. Set WORD_AI_NPM_USE_SOURCE_BOOTSTRAP=1 only when you explicitly want the legacy Python venv bootstrap path.
Use With Codex MCP
The installer writes a ready-to-merge MCP configuration snippet:
Add it to your Codex MCP config. The generated snippet includes write-tool approval gates. A minimal manual version is:
Secondary npm-based Codex setup, for hosts that cannot install from MCP Registry/MCPB yet:
You can replace @flyfish-dev/word-ai with the unscoped compatibility package word-ai-mcp in the npm-based Codex config.
--root is the primary workspace for relative paths and Word AI sidecars. Repeat --allow-root for external document folders you want Codex to edit, such as Downloads, Documents, or a team project folder. The installer-generated .wordai/codex-config.toml includes common user document folders automatically.
Recommended approval policy for write tools:
docx_dry_run_patchsetdocx_apply_patchsetdocx_backupdocx_restore_backupdocx_rollbackword_session_apply_patchsetword_session_wrap_selectionword_session_rollback- sidecar export tools
Example prompt:
For the currently open Word document, load the Office add-in, connect the bridge, then ask Codex:
Office.js Bridge And Live Word Sessions
The easiest path is:
For manual startup, start the local bridge:
Start the taskpane:
Then sideload office-addin/manifest.xml in Word. The taskpane runs at https://localhost:3100/taskpane.html by default and proxies /bridge/* to the local bridge. The bridge prints a local token at startup. Use that token in the taskpane.
Once connected inside Word, the taskpane registers a live session under .wordai/sessions. Codex can then use:
word_session_listword_session_snapshotword_session_read_content_controlword_session_preview_patchsetword_session_apply_patchsetword_session_wrap_selectionword_session_rollbackword_session_command_status
This path edits the currently open Word document through Office.js. word_session_apply_patchset performs a live preflight against the open document, checks expected_old_sha256, applies supported content-control operations, returns an audit object, and generates a rollback PatchSet. The offline DOCX path still uses docx_* tools and the OOXML/Open XML validator.
OfficeCLI Compatibility Policy
Word AI can optionally use OfficeCLI as auxiliary evidence for read-only or low-risk checks: view html, view screenshot, view issues, query --json, and validate. OfficeCLI mutation commands such as set, add, remove, raw-set, batch, and merge are not part of the default Word AI workflow unless they are wrapped by Word AI PatchSet, dry-run, audit, rollback, and explicit approval gates.
The MCP server exposes this integration only through allowlisted wrappers: officecli_view_html, officecli_view_screenshot, officecli_view_issues, officecli_query, and officecli_validate. If OfficeCLI is not installed, these tools return available=false and the core Word AI workflow continues to use docx_* and word_session_*.
Word AI borrows useful OfficeCLI design ideas such as schema/help-first usage, semantic paths, watch/render evidence, template merge concepts, and dump/batch inspection. The authoritative write model remains Word AI PatchSet.
Safe Editing Workflow
Documentation
- Documentation Index
- Getting Started
- Distribution
- Word AI Codex Skill
- Architecture
- Tool Contract
- Security Design
- QA Report
- Validation Matrix
- MCP Registry Publishing
- v0.8.6 Changelog
- v0.8.5 Changelog
- v0.8.4 Changelog
- v0.8.3 Changelog
- v0.8.1 Changelog
- v0.8.0 Changelog
- v0.7.1 Changelog
- v0.7 Changelog
Repository Status
Word AI is currently a local-first developer tool. It is suitable for controlled DOCX editing experiments, agent integration, and internal workflow pilots. For production remote MCP deployments, use proper MCP Streamable HTTP transport, authentication, network controls, audit storage, and render/visual diff infrastructure.
License
GNU Affero General Public License v3.0 or later (AGPL-3.0-or-later). See LICENSE.
來源:README.md,提交 1edacba
工具
0版本歷史
1- v0.8.6最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分