Excel Webview2 Mcp

io.github.dsbissett由 GitHub 帳號 dsbissett 發布v0.0.13更新於 Oct 25, 2026

MCP server for Excel add-ins via WebView2 CDP

已驗證STDIO僅桌面瀏覽器自動化開發者工具

概覽

AI 產生的概覽

一個本機 MCP 伺服器,讓助理連上在 WebView2 中執行的 Excel 增益集,可啟動、檢視並停止增益集工作階段。

可以做什麼
偵測、啟動與停止 Excel 增益集工作階段,包括啟動本機開發伺服器、將增益集側載到 Excel 並在 9222 埠開啟遠端偵錯,結束後再清除整個處理程序樹。讀取活頁簿與工作表結構、作用中與已使用範圍,以及範圍的值、公式、屬性與特殊儲存格。檢視設定格式化條件、資料驗證、表格、篩選、具名項目、註解與圖案。讀取計算狀態、樞紐分析表與其數值、圖表與圖表影像、自訂 XML 組件與設定。沿用繼承的 DevTools 基礎進行頁面檢視、螢幕擷取、主控台存取、網路檢視與效能分析。
適用情境
適合在 Windows 上開發或偵錯 Office Excel 增益集時使用,讓助理啟動增益集、查看活頁簿內容,並檢查增益集的主控台、網路流量與效能,不必切換工具。不適用於 Mac 版 Excel,該版本改用 Safari Web Inspector。
執行需求
Windows 並安裝 Excel 桌面版,另需 Node.js(支援 ^20.19.0、^22.12.0 或 >=23)以透過 npx 執行此 npm 套件。自動啟動需要磁碟上具備 manifest 與開發伺服器指令碼的 Office 增益集專案;或已有增益集在執行,且 WebView2 遠端偵錯繫結到 9222 埠,通常透過 WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS 環境變數或登錄原則開啟。
安裝前請注意
啟動與停止增益集會在 Windows 上啟動並強制結束開發伺服器處理程序樹,該工作階段中未儲存的工作可能遺失。伺服器會連上本機偵錯端點,將增益集的頁面、主控台與網路流量暴露給助理。用於偵錯埠的登錄備援方案會留下持續性的整機設定,環境變數較容易關閉。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Excel Webview2 Mcp,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

Excel WebView2 MCP

Professional MCP connectivity for Microsoft Excel add-ins running inside WebView2.

ItemValue
Package@dsbissett/excel-webview2-mcp
UpstreamFork of ChromeDevTools/chrome-devtools-mcp
Target runtimeExcel add-ins hosted in WebView2
Debug endpointhttp://127.0.0.1:9222
Recommended setupClaude Code plugin marketplace

[!IMPORTANT] As of v0.0.2, this server can launch Excel and sideload your add-in for you. You no longer need to start the dev server or attach a debugger before using it — excel_launch_addin will start your local dev server (if configured) and launch Excel with WebView2 remote debugging enabled on port 9222. Manual pre-launch is still supported: if an Excel add-in is already running with remote debugging on 9222, the server will attach to it.

What's New in v0.0.2

  • Add-in lifecycle management — new tools launch and stop Excel add-ins directly from Claude Code:
    • excel_detect_addin — discover manifest and dev server configuration for the current project.
    • excel_launch_addin — start the dev server (if needed) and launch Excel with the add-in sideloaded and CDP port 9222 enabled.
    • excel_stop_addin — tear down the launched Excel session and dev server process tree.
  • Read-only Excel inspection tools — a broad set of read operations for inspecting workbooks, worksheets, ranges, tables, pivots, charts, and more. None of these mutate workbook state:
    • Context & structure: excel_context_info, excel_workbook_info, excel_list_worksheets, excel_worksheet_info, excel_active_range, excel_used_range.
    • Range reads: excel_read_range, excel_range_properties, excel_range_formulas, excel_range_special_cells, excel_find_in_range.
    • Formatting & validation: excel_list_conditional_formats, excel_list_data_validations.
    • Tables & names: excel_list_tables, excel_table_info, excel_table_rows, excel_table_filters, excel_list_named_items.
    • Comments & shapes: excel_list_comments, excel_list_shapes.
    • Calculation & pivots: excel_calculation_state, excel_list_pivot_tables, excel_pivot_table_info, excel_pivot_table_values.
    • Charts: excel_list_charts, excel_chart_info, excel_chart_image.
    • Misc: excel_custom_xml_parts, excel_settings_get.
  • Socket-based port detection replaces HTTP polling for more reliable dev-server and CDP readiness checks on Node 24.
  • Robust cleanup on Windows — excel_stop_addin now force-kills the dev server process tree via taskkill.

Fork Notice

This repository is a fork of the Chrome DevTools MCP repository, ChromeDevTools/chrome-devtools-mcp. It preserves the upstream DevTools and MCP foundation, while adapting the connection model for Microsoft Excel add-ins hosted in WebView2.

What This Project Does

  • Connects Claude Code to a locally running Excel add-in through the Chrome DevTools Protocol (CDP).
  • Exposes MCP tools for inspection, automation, screenshots, console access, network inspection, and performance analysis.
  • Targets the embedded WebView2 runtime used by Excel add-ins instead of a standalone Chrome session.

Connection Model

text
Claude Code    |    vexcel-webview2-mcp    |    vWebView2 remote debugging endpoint (localhost:9222)    |    vLocally running Excel add-in

That separation matters: excel-webview2-mcp is a bridge to an existing debug session. It is not the thing that launches or hosts the add-in.

Prerequisites

You have two supported workflows:

Auto-launch (recommended, v0.0.2+)

  1. Your Office add-in project (with a manifest.xml and a dev server script) lives on disk.
  2. Excel desktop is installed on Windows.
  3. Node.js is installed and npx @dsbissett/excel-webview2-mcp@latest is runnable.

Call excel_detect_addin first to confirm the project is discovered, then excel_launch_addin to start the dev server and sideload the add-in into Excel with CDP port 9222 enabled. Use excel_stop_addin to tear everything down.

Manual / pre-attached

  1. Your Excel add-in is already loaded and running in the local Excel desktop client.
  2. WebView2 remote debugging is enabled and bound to port 9222 (see Launching Excel with the debug port).
  3. The debugging endpoint is reachable at http://127.0.0.1:9222.

Verify with:

sh
curl http://127.0.0.1:9222/json

Launching Excel with the debug port

This section applies to Excel desktop on Windows. Per Microsoft's WebView2 and Office add-in documentation, the supported way to pass Chromium flags into the WebView2 runtime is WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS. The WebView2 team also documents a registry-based fallback for persistent configuration.

If you are using Excel for Mac, this MCP server does not apply. Microsoft documents Excel for Mac debugging through Safari Web Inspector instead of a WebView2 CDP port.

Sources:

Windows: preferred local-dev setup

Set the environment variable before launching Excel so the Excel process inherits it:

powershell
$env:WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS="--remote-debugging-port=9222"

Then:

  1. Launch Excel from that same shell or from a parent process that inherited the variable.
  2. Start your add-in locally.
  3. Confirm the debug endpoint is live.

Worked example:

powershell
$env:WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS="--remote-debugging-port=9222"start excel.exe

The Office add-ins team documents this environment-variable mechanism generically for WebView2-hosted add-ins, and the WebView2 team documents --remote-debugging-port=9222 as a valid browser argument.

Windows: persistent registry fallback

If you need a persistent machine-local setting, the WebView2 team documents this registry policy path:

text
HKEY_CURRENT_USER\Software\Policies\Microsoft\Edge\WebView2\AdditionalBrowserArguments

Use:

  • Value name: EXCEL.EXE
  • Value data: --remote-debugging-port=9222

Use the environment variable first for local development. It is easier to turn on and off and avoids leaving a persistent machine-wide setting behind.

Verify the endpoint

Run:

sh
curl http://127.0.0.1:9222/json/version

A healthy response is JSON and includes fields such as:

json
{  "Browser": "...",  "Protocol-Version": "...",  "webSocketDebuggerUrl": "ws://127.0.0.1:9222/devtools/browser/..."}

If that curl command fails, Excel is not exposing the WebView2 debug port yet, and excel-webview2-mcp will not be able to attach.

Installation

The server ships as the npm package @dsbissett/excel-webview2-mcp and is invoked via npx. The configuration below is the same across every host — only the location of the config file changes.

Canonical MCP entry:

json
{  "mcpServers": {    "excel-webview2": {      "command": "npx",      "args": ["@dsbissett/excel-webview2-mcp@latest"]    }  }}
Claude Code (CLI)

One-liner:

sh
claude mcp add excel-webview2 -- npx @dsbissett/excel-webview2-mcp@latest

Use claude mcp add --scope user ... to make the server available in every project, or --scope project to check the config into .mcp.json for teammates.

Alternatively, install the bundled plugin:

  1. Add the marketplace from .claude-plugin/marketplace.json with /plugin marketplace add dsbissett/excel-webview2-mcp.
  2. Install with /plugin install excel-webview2-mcp.
Claude Code (VS Code extension)
  1. Open the Claude Code side panel in VS Code.
  2. Open the command palette and run Claude Code: Manage MCP Servers (or click the MCP icon in the Claude panel).
  3. Choose Add Server and paste the canonical MCP entry above, or run the claude mcp add command in the VS Code integrated terminal — the extension reads the same config.
Cursor

Edit ~/.cursor/mcp.json (global) or .cursor/mcp.json in the project root and add the canonical MCP entry above. Restart Cursor, then open Settings → MCP to confirm excel-webview2 shows as connected.

Codex (OpenAI Codex CLI)

Codex reads MCP servers from ~/.codex/config.toml. Add:

toml
[mcp_servers.excel-webview2]command = "npx"args = ["@dsbissett/excel-webview2-mcp@latest"]

Then launch codex and confirm the server appears in /mcp.

GitHub Copilot (VS Code)

GitHub Copilot Chat in VS Code supports MCP servers through the agent-mode configuration.

  1. Create or edit .vscode/mcp.json in your workspace (or the user-level mcp.json via MCP: Open User Configuration from the command palette).

  2. Add the server entry:

    json
    {  "servers": {    "excel-webview2": {      "command": "npx",      "args": ["@dsbissett/excel-webview2-mcp@latest"]    }  }}
  3. Open Copilot Chat, switch to Agent mode, and click the Tools icon to confirm the excel-webview2 tools are available. Use MCP: List Servers from the command palette to inspect status or restart the server.

Verifying the install

After adding the server, ask the model to call excel_detect_addin from your Office add-in project directory. A successful response confirms the MCP server is wired up; from there excel_launch_addin will take care of starting Excel.

By default, the server connects to the local WebView2 debugging endpoint at http://127.0.0.1:9222.

Local Development

sh
npm installnpm run buildnpm start

Supported Node.js versions are ^20.19.0, ^22.12.0, or >=23.

來源:README.md,提交 51a2812

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.0.13最新Sep 16, 2026

評分

已滿足適用檢查項的 40%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

    請在儲存庫或註冊中心條目中宣告授權條款。