Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .claude-plugin/marketplace.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

| Plugin | 內容 |
|--------|------|
| `che-word-mcp` | Word (.docx) MCP server(OOXML 讀寫,218+ 工具) |
| `che-word-mcp` | Word (.docx) MCP server(OOXML 讀寫,242 工具) |
| `che-pdf-mcp` | PDF MCP server(PDFKit 解析、Vision OCR) |
| `che-pptx-mcp` | PowerPoint (.pptx) MCP server(PresentationML 解析與生成) |
| `macdoc` | macdoc CLI 使用指南 skill |
Expand Down
2 changes: 1 addition & 1 deletion plugins/che-word-mcp/.claude-plugin/plugin.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion plugins/che-word-mcp/.mcp.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"word": {
"type": "stdio",
"command": "${CLAUDE_PLUGIN_ROOT}/bin/che-word-mcp-wrapper.sh",
"description": "Word (.docx) MCP server — Swift-native OOXML manipulation, 218+ tools. Read/write paragraphs, runs, tables, hyperlinks, headers/footers, sections, styles, numbering, content controls (SDT), comments, footnotes/endnotes, equations, fields. v3.12.0: programmatic Track Changes (insert_text_as_revision / delete_text_as_revision / move_text_as_revision + as_revision flag on format_text / set_paragraph_format). Built on ooxml-swift v0.18.0. Office.js OOXML Roadmap P0 100% complete (PsychQuant/che-word-mcp#43)."
"description": "Word (.docx) MCP server — Swift-native OOXML 讀寫,242 tools(段落/表格/樣式/註腳/追蹤修訂/方程式/內容控制/欄位等),無需安裝 Word。Built on ooxml-swift v0.24.0。release history 見 CHANGELOG。"
}
}
4 changes: 4 additions & 0 deletions plugins/che-word-mcp/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [3.20.2] - 2026-07-02

### Fixed

- 文件一致性 refresh(PsychQuant/macdoc#118):tool count 統一為 **242**(binary v3.20.0 `tools/list` 實測;原散落 145/218+/235)、ooxml-swift 版本對齊 v0.24.0、`~/bin` 路徑宣稱改 `.bin-cache`(接 #117)、README 版本區塊對齊 shell 3.20.2 / binary 3.20.0;`.mcp.json` / `plugin.json` / marketplace description 縮為短摘要(release history 移交 CHANGELOG)。

### Changed

- **Plugin-scoped 安裝目錄(PsychQuant/macdoc#117)**:binary 與 sidecar 從共享 `~/bin/` 遷至 **plugin 層級**的 `.bin-cache/`(`<marketplace>/<plugin>/.bin-cache/`,即 version 目錄的上一層)— 跨 marketplace / 跨 plugin 碰撞 by construction 不可能,且跨 shell 版本持久(保留 #116 sidecar 短路,shell-only bump 不重下載;binary_version 變更才重下載)。舊 `~/bin` 副本不主動刪除(可能為使用者手動安裝),首次啟動 stderr 註記一次。
Expand Down
12 changes: 6 additions & 6 deletions plugins/che-word-mcp/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

## Purpose

Microsoft Word (.docx) MCP plugin. Wraps the [CheWordMCP](https://github.com/PsychQuant/che-word-mcp) Swift binary via auto-download wrapper. **Swift-native OOXML manipulation** — reads and writes .docx without requiring Microsoft Word installation. 218+ tools cover the full Office.js OOXML Roadmap P0 set ([#43](https://github.com/PsychQuant/che-word-mcp/issues/43) closed 100%).
Microsoft Word (.docx) MCP plugin. Wraps the [CheWordMCP](https://github.com/PsychQuant/che-word-mcp) Swift binary via auto-download wrapper. **Swift-native OOXML manipulation** — reads and writes .docx without requiring Microsoft Word installation. 242 tools(binary v3.20.0 `tools/list` 實測)cover the full Office.js OOXML Roadmap P0 set ([#43](https://github.com/PsychQuant/che-word-mcp/issues/43) closed 100%).

Built on [`ooxml-swift`](https://github.com/PsychQuant/ooxml-swift) v0.18.0.
Built on [`ooxml-swift`](https://github.com/PsychQuant/ooxml-swift) v0.24.0.

## Components

### MCP Tools (218+)
### MCP Tools (242)

| Category | Representative tools |
|----------|---------------------|
Expand Down Expand Up @@ -46,7 +46,7 @@ MCP namespace: `mcp__che-word-mcp__<tool>`.
| Mode | Param | Tools | Use when |
|------|-------|-------|----------|
| Direct | `source_path` | 18 | 快速 read-only 檢查(list/search/info),不需 open/close lifecycle |
| Session | `doc_id` | All 218+ | 任何寫入或多步驟編輯都要走這個 |
| Session | `doc_id` | All 242 | 任何寫入或多步驟編輯都要走這個 |

## Track Changes Contract(v3.12.0+ 重要)

Expand All @@ -63,11 +63,11 @@ MCP namespace: `mcp__che-word-mcp__<tool>`.

## Binary Dependency

這是 binary-based plugin:`.mcp.json` 指向 `bin/che-word-mcp-wrapper.sh`,wrapper 會 auto-download `CheWordMCP` binary 到 `~/bin/`
這是 binary-based plugin:`.mcp.json` 指向 `bin/che-word-mcp-wrapper.sh`,wrapper 會 auto-download `CheWordMCP` binary 到 plugin 層級的 `.bin-cache/`(#117)

- Binary repo: [`PsychQuant/che-word-mcp`](https://github.com/PsychQuant/che-word-mcp)
- Binary name: `CheWordMCP`
- Underlying lib: [`PsychQuant/ooxml-swift`](https://github.com/PsychQuant/ooxml-swift) v0.18.0
- Underlying lib: [`PsychQuant/ooxml-swift`](https://github.com/PsychQuant/ooxml-swift) v0.24.0
- Release asset naming: asset filename must contain `CheWordMCP`

### Plugin vs Binary Version Sync
Expand Down
14 changes: 7 additions & 7 deletions plugins/che-word-mcp/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# che-word-mcp

**Word MCP Server** — Swift 原生 OOXML 操作,**235 個工具**,支援 Dual-Mode 存取 + preserve-by-default round-trip fidelity + programmatic Track Changes 生成 + `document.xml` lossless round-trip。
**Word MCP Server** — Swift 原生 OOXML 操作,**242 個工具**,支援 Dual-Mode 存取 + preserve-by-default round-trip fidelity + programmatic Track Changes 生成 + `document.xml` lossless round-trip。

當前版本:**v3.20.0**(Plugin shell + Binary 同步)— closes [PsychQuant/che-word-mcp#160](https://github.com/PsychQuant/che-word-mcp/issues/160) — 兩個新 MCP tools 暴露 [PsychQuant/ooxml-swift v0.24.0](https://github.com/PsychQuant/ooxml-swift/releases/tag/v0.24.0) 的 `spliceOMath` API 給 MCP callers,跨 document 拷貝 verbatim `<m:oMath>` XML 區塊。
當前版本:Plugin shell **v3.20.2** / Binary **v3.20.0**(#116 起解耦)— closes [PsychQuant/che-word-mcp#160](https://github.com/PsychQuant/che-word-mcp/issues/160) — 兩個新 MCP tools 暴露 [PsychQuant/ooxml-swift v0.24.0](https://github.com/PsychQuant/ooxml-swift/releases/tag/v0.24.0) 的 `spliceOMath` API 給 MCP callers,跨 document 拷貝 verbatim `<m:oMath>` XML 區塊。

- **`splice_omath_from_source`** — 單一 OMath splice,low-level。Source 用 `source_path`(Direct mode 唯讀)或 `source_doc_id`(Session mode);target 必須是 session-mode `doc_id`。Position 支援 `atStart` / `atEnd` / `afterText` / `beforeText`(後兩者配合 `anchor` + 可選 `instance`)。`omath_index` 0-based、按 source-document order 跨 carrier 統一排序。`rpr_mode` 控制 source Run rPr 怎麼帶到 target Run(`full` 預設 verbatim / `omathOnly` 白名單 / `discard` 空 rPr);`namespace_policy` 控制 prefix vs URI 處理(`lenient` 預設接受 `mml:` vs `m:` prefix mismatch / `strict` 任何 prefix 不同就 throw)。回傳 `Spliced 1 OMath block (...)` 或 structured error。
- **`splice_paragraph_omath_from_source`** — paragraph-level batch convenience。把 source paragraph 內所有 OMath 按 source-document order splice 到 target paragraph 對應位置(內部用 ~10 chars source-text-context 自動推 anchor)。回傳 splice 數量或 `contextAnchorNotFound(omath_index, snippet)`(partial-success state 已留在 target)。
Expand Down Expand Up @@ -182,7 +182,7 @@ v3.0.0+ session state 追蹤:dirty tracking、autosave、`finalize_document`

## Round-trip Fidelity(v3.5.0 true byte-preservation)

底層 `ooxml-swift v0.19.2` 採用 **preserve-by-default + dirty tracking** 架構:`open_document` 保留原始 archive tempDir;`save_document` overlay 模式透過 `WordDocument.modifiedParts: Set<String>` 精確判斷哪些 part 真正被改動,**未改動的 typed-managed part 完全不重寫**——byte-for-byte 保留 `word/theme/`、`webSettings.xml`、`people.xml`、`commentsExtended/Extensible/Ids`、`glossary/`、`customXml/`、**以及 `word/document.xml`、`styles.xml`、`fontTable.xml`、`header*.xml`、`footer*.xml`、`comments.xml`、`footnotes.xml`、`endnotes.xml`** 等所有 typed parts。v0.19.x 額外解決 #56 P0:`<w:document>` root 34 個 `xmlns:*` declarations 完整保留,`<w:bookmarkStart>` / `<w:hyperlink>` / `<w:fldSimple>` / `<mc:AlternateContent>` 結構化 wrapper 全程 round-trip(pre-v0.19.0 會 silently 丟掉 wrapper 內 354 個 `<w:t>` text nodes)。
底層 `ooxml-swift v0.24.0` 採用 **preserve-by-default + dirty tracking** 架構:`open_document` 保留原始 archive tempDir;`save_document` overlay 模式透過 `WordDocument.modifiedParts: Set<String>` 精確判斷哪些 part 真正被改動,**未改動的 typed-managed part 完全不重寫**——byte-for-byte 保留 `word/theme/`、`webSettings.xml`、`people.xml`、`commentsExtended/Extensible/Ids`、`glossary/`、`customXml/`、**以及 `word/document.xml`、`styles.xml`、`fontTable.xml`、`header*.xml`、`footer*.xml`、`comments.xml`、`footnotes.xml`、`endnotes.xml`** 等所有 typed parts。v0.19.x 額外解決 #56 P0:`<w:document>` root 34 個 `xmlns:*` declarations 完整保留,`<w:bookmarkStart>` / `<w:hyperlink>` / `<w:fldSimple>` / `<mc:AlternateContent>` 結構化 wrapper 全程 round-trip(pre-v0.19.0 會 silently 丟掉 wrapper 內 354 個 `<w:t>` text nodes)。

NTPU 學位論文模板的中文字體(DFKai-SB / 華康中楷體)no-op `save_document` 後完整保留 13 fontTable + 6 distinct headers + 4 footers + three-segment PAGE field + `<w15:presenceInfo>` identity。

Expand Down Expand Up @@ -382,20 +382,20 @@ get_revisions / accept_revision / reject_revision / accept_all_revisions / rejec

- **語言**: Swift(macOS 13.0+)
- **MCP SDK**: swift-sdk 0.12+
- **OOXML 引擎**: [`ooxml-swift v0.19.2`](https://github.com/PsychQuant/ooxml-swift)(preserve-by-default + dirty tracking + revision generation + `document.xml` lossless round-trip)
- **OOXML 引擎**: [`ooxml-swift v0.24.0`](https://github.com/PsychQuant/ooxml-swift)(preserve-by-default + dirty tracking + revision generation + `document.xml` lossless round-trip)
- **LaTeX parser**: [`latex-math-swift v0.1.0+`](https://github.com/PsychQuant/latex-math-swift)(v3.2.0+)
- **Markdown export**: [`word-to-md-swift`](https://github.com/PsychQuant/word-to-md-swift) + [`markdown-swift`](https://github.com/PsychQuant/markdown-swift)

## 版本

- **Plugin shell**: v3.13.2
- **Binary**: v3.13.2(`CheWordMCP`)
- **Plugin shell**: v3.20.2
- **Binary**: v3.20.0(`CheWordMCP`,242 tools
- **GitHub**: https://github.com/PsychQuant/che-word-mcp
- **完整 CHANGELOG**: https://github.com/PsychQuant/che-word-mcp/blob/main/CHANGELOG.md

### Plugin Shell vs Binary 版本

兩者獨立但本次 v3.13.2 同步。Plugin shell(marketplace 端,含 SKILL.md / CLAUDE.md / `.mcp.json` / wrapper)有自己的 minor,反映文件 / skill 變動;Binary(GitHub release 端)有自己的 minor,反映 MCP server 內部新增 tool 或修 bug。Wrapper auto-download 從 release fetch binary 到 `~/bin/CheWordMCP`。
兩者獨立(#116 起以 `binary_version` 欄位正式解耦)。Plugin shell(marketplace 端,含 SKILL.md / CLAUDE.md / `.mcp.json` / wrapper)有自己的 minor,反映文件 / skill 變動;Binary(GitHub release 端)有自己的 minor,反映 MCP server 內部新增 tool 或修 bug。Wrapper auto-download 從 release fetch binary 到 plugin 層級的 `.bin-cache/CheWordMCP`(#117),安裝與每次啟動皆驗證 sha256 + Developer ID 簽章鏈

### 重要 milestones

Expand Down
10 changes: 5 additions & 5 deletions plugins/che-word-mcp/skills/che-word-mcp/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
---
name: che-word-mcp
description: Use when working with Microsoft Word (.docx) documents — reading content, creating new documents, modifying text/formatting/structure, working with tables/images/comments/track-changes/SDT/sections/styles/headers/hyperlinks. Swift-native OOXML server, 218+ tools, no Word install required.
description: Use when working with Microsoft Word (.docx) documents — reading content, creating new documents, modifying text/formatting/structure, working with tables/images/comments/track-changes/SDT/sections/styles/headers/hyperlinks. Swift-native OOXML server, 242 tools, no Word install required.
---

# che-word-mcp

A Swift-native MCP server for Microsoft Word (.docx) document manipulation. **218+ tools** for reading, writing, and modifying Word documents without requiring Microsoft Word installation. Built on `ooxml-swift` v0.18.0.
A Swift-native MCP server for Microsoft Word (.docx) document manipulation. **242 tools** for reading, writing, and modifying Word documents without requiring Microsoft Word installation. Built on `ooxml-swift` v0.24.0.

Office.js OOXML Roadmap P0 = **100% complete** ([PsychQuant/che-word-mcp#43](https://github.com/PsychQuant/che-word-mcp/issues/43)). Latest: v3.12.0 ships programmatic Track Changes generation.
Office.js OOXML Roadmap P0 = **100% complete** ([PsychQuant/che-word-mcp#43](https://github.com/PsychQuant/che-word-mcp/issues/43)). Binary v3.20.0(242 tools);programmatic Track Changes 自 v3.12.0 起提供。

## Two Modes of Operation

| Mode | Parameter | Use when | Tool count |
|------|-----------|----------|------------|
| **Direct Mode** | `source_path` | Quick read-only access, no state needed | 18 tools |
| **Session Mode** | `doc_id` | Full read/write with open→edit→save lifecycle | All 218+ tools |
| **Session Mode** | `doc_id` | Full read/write with open→edit→save lifecycle | All 242 tools |

### Direct Mode (`source_path`)

Expand Down Expand Up @@ -116,7 +116,7 @@ export_comment_threads_markdown(doc_id) → comment threads
export_all_images(doc_id, output_dir)
```

## Tool Categories (218+ total)
## Tool Categories (242 total)

### Document Lifecycle

Expand Down