
Office Addin Mcp
io.github.dsbissett由 GitHub 帳號 dsbissett 發布v0.8.0更新於 Nov 3, 2026
MCP server for Office add-ins via WebView2/CDP. Provides excel.*, page.*, and addin.* tools.
概覽
本機 MCP 伺服器,透過 CDP 連接 Office 的 WebView2 增益集,讓助理讀取與修改 Excel、Word、Outlook、PowerPoint 與 OneNote 內容。
- 可以做什麼
- 彙總、表格化、查詢並批次修改 Excel 活頁簿,含伺服器端篩選/分組/彙總 DSL
- 探索 Word 文件結構並批次執行尋找取代編輯
- 查詢 Outlook 信箱與目前郵件,並在撰寫模式下設定主旨或內文
- 查詢 PowerPoint 投影片並改寫標題或內文項目;查詢 OneNote 筆記本並在頁面附加 HTML 或項目
- 讀取 Excel 範圍並嵌入 PowerPoint 投影片,將工具呼叫序列錄製為可重放的巨集,管理增益集生命週期
- 作為備援提供頁面自動化:截圖、快照、點擊、輸入、導覽、主控台與網路日誌
- 適用情境
- 適合讓助理在 Windows 上直接操作已開啟的 Office 文件和郵件,例如彙總活頁簿、依區域樞紐分析工作表、草擬回覆或重建投影片,省去使用者來回複製資料。在 macOS 與 Linux 上也可用於無頭 Chrome 頁面自動化。
- 執行需求
- 以本機 stdio 程序執行,通常透過 npx(需 Node.js 14+)或預先建置的執行檔啟動;從原始碼建置需 Go 1.22+。Office 相關工具需要 Windows 10/11 上的 Office,並開啟 WebView2 偵錯埠(將 WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS 設為遠端偵錯埠),或使用 --launch-addin 側載增益集專案。伺服器預設會探測本機偵錯端點。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Office Addin Mcp,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
office-addin-mcp
Drive Excel, Word, Outlook, PowerPoint, and OneNote add-ins from any MCP client — through one Go binary that speaks the Model Context Protocol over stdio.
office-addin-mcp attaches to the WebView2 runtime that Office uses to host Office.js add-ins, then exposes a high-level tool surface to LLM clients. Instead of teaching the model how to chain 15 raw Office.js primitives, the server ships one tool call per workflow.
See the latest release · CHANGELOG.md · PLAN-workflow-surface.md.
Highlights
- Workflow tools, not primitives.
excel.tabulateRegion,word.applyEdits,outlook.draftReply,powerpoint.rebuildSlideFromOutline,onenote.appendToPage, andexcel.summarizeWorkbookeach compress what used to be 5–20 calls into one Office.js batch (one CDP round-trip). - Server-side query DSL.
excel.query/outlook.query/powerpoint.query/onenote.queryrun filter / project / groupBy / agg / limit inside the host so a 100k-row workbook returns a 5-row answer. - Persistent document context cache.
*.discovertools snapshot workbook / document / mailbox / deck / notebook structure to%LOCALAPPDATA%\office-addin-mcp\doccache.jsonso repeat discovery calls cost zero CDP round-trips. - MCP Resources with live subscriptions. Reference Office state by URI —
office://excel/Book1/Sheet1!A1:D20,office://word/<doc>/bookmark/<name>,office://outlook/inbox,office://pp/<deck>/slide<N>,office://onenote/<notebook>/<section>/<page>— and subscribe tonotifications/resources/updatedwhen contents change. - Macro record & replay.
macro.record_start→ run any sequence of tools →macro.record_stopwrites a JSON macro to disk. On next launch the server registers each macro as a callablemacro.<name>tool. - Auto-diagnostics on Office.js errors.
ItemNotFound, address parse failures, slide-index errors, and compose-vs-read mismatches are enriched in the failure envelope withavailable_sheets,nearest_name_suggestions,parsed_address,slide_count,item_mode, and arecoveryHint— so the model can self-correct without a second round-trip. - Self-healing CDP connection. If Excel closes unexpectedly, the server detects the dead connection on the next tool call, stops the stale sideload registration, relaunches Excel (including the dev server if needed), resets the session pool, and retries the original operation — no agent intervention required. Only activates when the server owns the launch (via
--launch-addinor a prioraddin.launchcall); attaching to an external--browser-urlendpoint is never disturbed. - Progress notifications on long operations.
addin.launch,addin.ensureRunning, and macro replay stream MCP$/progressnotifications at each phase boundary (dev-server start, sideload, CDP-ready wait, step execution) so clients can show a live status bar instead of a silent spinner. - Cross-host orchestration.
office.embedreads a range from Excel and inserts it onto a PowerPoint slide in one call. - Page automation fallback.
page.*/pages.*/inspect.*/interact.*cover screenshot, snapshot, click, fill, type, hover, navigate, evaluate, wait, console log, network log — same primitives against headless Chrome on macOS/Linux. - Per-host
runScriptescape hatch.excel.runScript,word.runScript,outlook.runScript,powerpoint.runScript,onenote.runScriptrun arbitrary<Host>.runcallbacks when the workflow surface isn't enough.
Requirements
Install
npm (recommended)
Or run on demand without installing:
Pre-built binaries for Windows x64, macOS (Intel + Apple Silicon), and Linux (x64 + ARM64) ship via optional npm dependencies — the correct binary is fetched automatically.
Build from source
Use it in Claude Code
One command registers the server globally:
Or add it manually. Project scope (.claude/mcp.json in the repo) or user scope (~/.claude.json → mcpServers) both work:
Then, in any Claude Code session:
- Open the Office host (see Office host setup below) so the WebView2 debug port is listening.
- Ask Claude to do something — e.g. "Summarize the workbook, then pivot the Sales sheet by region." It will pick
excel.summarizeWorkbookandexcel.queryautomatically. - Run
/mcpin Claude Code to inspect the tool list, orclaude mcp listfrom a shell.
Tip: pass
--launch-addinand Claude can sideload the add-in project under the current working directory automatically. No manual env var needed.
Use it in other MCP clients
VS Code (GitHub Copilot)
Workspace config at .vscode/mcp.json:
Or: Command Palette → MCP: Add Server → paste the command.
Cursor
~/.cursor/mcp.json (global) or .cursor/mcp.json (project):
Codex (OpenAI)
~/.codex/config.toml:
Windsurf
~/.codeium/windsurf/mcp_config.json:
Any MCP-compatible client
- command:
npx - args:
["-y", "@dsbissett/office-addin-mcp@latest"] - transport:
stdio
Office host setup
Office hosts only expose their WebView2 runtime to CDP when started with a debug-port env var. The variable is shared across every Office app, so the same setup works for all five:
PowerShell
Command Prompt
The server probes http://127.0.0.1:9222 by default. Override with --browser-url or --ws-endpoint. Or skip the setup entirely with --launch-addin — the server will detect the Office add-in project under cwd and sideload it through office-addin-debugging.
Tool surface
Phase 0 of PLAN-workflow-surface.md deleted the raw cdp.* surface; everything below is the workflow-shaped replacement. Each workflow tool is one MCP call → one Office.js batch → one CDP round-trip.
Excel
Word
Outlook
PowerPoint
OneNote
Cross-host & macros
Add-in lifecycle & generic page automation
MCP Resources
LLM clients can reference Office state by URI instead of re-fetching it every turn. Five resource templates are registered on startup:
Resources support resources/subscribe. The server polls fingerprints every 30s and emits notifications/resources/updated when content changes; resources/unsubscribe (or client disconnect) tears down the polling goroutine.
Performance notes
urlPatternselects the WebView2 page by substring match against the target URL. After the first call against a session, the selector cache dropsdiagnostics.cdpRoundTripsfrom ~3 to 1 on subsequent calls.- The session pool allows 3 reconnects per 60-second window. Exhaustion surfaces as
connection/session_acquire_failed. If the server owns the launch, it attempts one automatic stop+relaunch cycle before surfacing that error, so transient Excel restarts are transparent to the agent. - DocCache snapshots are atomic-rename writes, mode 0600. Disable with
--no-doccache.
Flags & environment variables
The binary takes no positional subcommands — it speaks MCP over stdio. The legacy call / daemon / serve --stdio subcommands have been removed.
Layout
License
MIT
來源:README.md,提交 fc2ee47
工具
0版本歷史
1- v0.8.0最新Sep 16, 2026
評分
已滿足適用檢查項的 40%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分
請在儲存庫或註冊中心條目中宣告授權條款。