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 分

    请在仓库或注册中心条目中声明许可证。