MathType · MCP · AI Agent · Windows · Office Automation
專案概述
讓 AI Agent 在 Microsoft Word 與 PowerPoint 裡建立可編輯的 MathType 7 公式。專案以可安裝的 skill、Codex 與 Claude 的 plugin,以及本機 MCP server 提供,Word 文件另支援 MathType 原生的公式編號與動態交叉引用。產出的是真正的Equation.DSMT4 物件,不是 Word OMath、圖片或手打的 Unicode 公式,所以公式隨時能回到 MathType 編輯。
核心功能
- 建立可編輯的
Equation.DSMT4物件,不以 Word OMath、圖片或手打 Unicode 公式代替 - DOCX 支援行內公式與置中的獨立公式
- 掃描完整文章後,把原稿中的數學內容分類為行內公式、未編號獨立公式、編號獨立公式或動態引用;唯讀掃描能找出純文字數學(含 Word 上下標格式),標記步驟再把審閱後的片段換成標記
- 插入
(1)等 Word 的 MathType 原生編號與動態引用 - 透過隱藏的 Word 轉換文件,在 PowerPoint 建立置中的浮動 MathType 公式
- 保留來源 Office 檔案,輸出前先驗證;既有輸出預設不覆寫,需明確指定
-Overwrite - 大型 Word 文件分批渲染(
batch_size預設 40),可中斷續跑,也能在背景執行並以get_mathtype_render_status查詢進度 - 附中英雙語的學術公式樣式參考:純量變數斜體、向量粗體小寫、矩陣與張量粗體大寫、函數名稱與 SI 單位正體
- 跨 Agent 的 skill 與 plugin,附本機 MCP server 供 Codex 與 Claude 直接使用;ChatGPT 須透過 remote endpoint 或 Secure MCP Tunnel
專案架構
Word 的渲染由 JSON manifest 驅動:manifest 為每個公式列出 TeX、版面(行內或獨立)與是否編號,並以文件中恰好出現一次的標記(例如{{MATH:id}})指定位置;每個引用也有各自的標記,指向已編號的公式。
發生逾時時,bridge 只終止自己記錄為啟動的 Office 程序;PowerPoint 作業也不會關閉使用者原本已開啟的 PowerPoint。repository 的目錄結構如下:
mathtype-for-word
skills/mathtype-for-word · 跨 Agent skill、參考資料與 launcher
SKILL.md
scripts · Office automation bridge、MCP server 與封裝程式
mathtype-word.ps1 · Office bridge
mcp_server.py · MCP server
mathtype_batch.py · 批次渲染
ensure-pwsh.ps1 · 安裝 PowerShell 7
package_plugin.py · 封裝
.claude-plugin/marketplace.json · Claude Code marketplace
.agents/plugins/marketplace.json · Codex marketplace
config/defaults.json · Word 公式編號預設設定
evals/fixtures · 真實繁中、英文 DOCX 與 PPTX 評測輸入
en-paper-draft.docx · 搭配 en-word-manifest.json
en-presentation-draft.pptx · 搭配 en-powerpoint-manifest.json
tests · 靜態、MCP、Office 整合、視覺與封裝測試
run-tests.ps1
dist · 封裝產物
mathtype-for-word-plugin.zip · plugin 封裝,附 SHA-256 檔
mathtype-for-word.skill · 獨立 skill 套件
CHANGELOG.md · 各版本變更紀錄
快速開始
先確認下方注意事項列出的系統需求。README 另附一段安裝 prompt,貼給 Agent 就能依目前環境完成設定;手動安裝則依使用的 Agent 擇一:1
Claude Code 安裝 plugin
claude plugin marketplace update mathtype-for-word 與 claude plugin update mathtype-for-word@mathtype-for-word。2
Codex 安裝 plugin
codex plugin marketplace upgrade mathtype-for-word,再執行一次 codex plugin add。3
重新啟動並驗證安裝
安裝或升級後重新啟動 Claude Code 或 Codex,再執行驗證:三個命令分別檢查 Word 的前置條件、PowerPoint 的前置條件,並執行含實機 Office 的測試;路徑為 repository 內的相對路徑。
4
交給 Agent 處理文件
告訴 Agent 要編輯的 DOCX 或 PPTX,以及需要建立的公式。Agent 會保留來源檔,把結果寫成新檔;驗證回傳
ok: true 才算完成。安裝方式比較
注意事項
實際應用面
適合把論文草稿或簡報中的公式交給 AI Agent 處理,而成品必須是能在 MathType 中再編輯的公式物件的情境。Word 文件的編號與交叉引用是 MathType 原生欄位,不是手打的文字。repository 內附真實的繁體中文與英文 DOCX、PPTX 評測輸入,可以拿來做簡易測試。相關連結
- GitHub:felimet/mathtype-for-word
- 各平台安裝矩陣:installation-matrix.md
- MathType 下載頁面:mathtype.tw/download
- 收錄於:hashgraph-online/awesome-ai-plugins
- 收錄於:hol.org/plugins