
Excel Webview2 Mcp
io.github.dsbissett由 GitHub 账号 dsbissett 发布v0.0.13更新于 Oct 25, 2026
MCP server for Excel add-ins via WebView2 CDP
概览
一个本地 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 环境变量或注册表策略开启。
安装
在 SourceWeft 中
- 打开 控制台中的 Excel Webview2 Mcp,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
Excel WebView2 MCP
Professional MCP connectivity for Microsoft Excel add-ins running inside WebView2.
[!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_addinwill start your local dev server (if configured) and launch Excel with WebView2 remote debugging enabled on port9222. Manual pre-launch is still supported: if an Excel add-in is already running with remote debugging on9222, 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
9222enabled. - 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.
- Context & structure:
- 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_addinnow force-kills the dev server process tree viataskkill.
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
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+)
- Your Office add-in project (with a
manifest.xmland a dev server script) lives on disk. - Excel desktop is installed on Windows.
- Node.js is installed and
npx @dsbissett/excel-webview2-mcp@latestis 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
- Your Excel add-in is already loaded and running in the local Excel desktop client.
- WebView2 remote debugging is enabled and bound to port
9222(see Launching Excel with the debug port). - The debugging endpoint is reachable at
http://127.0.0.1:9222.
Verify with:
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:
- WebView2 debug arguments and registry policy: https://learn.microsoft.com/en-us/microsoft-edge/webview2/how-to/debug-visual-studio-code
- Office add-ins debugging with Edge DevTools: https://learn.microsoft.com/en-us/office/dev/add-ins/testing/debug-add-ins-using-devtools-edge-chromium
- Office add-ins debugging overview, including Mac: https://learn.microsoft.com/en-us/office/dev/add-ins/testing/debug-add-ins-overview
Windows: preferred local-dev setup
Set the environment variable before launching Excel so the Excel process inherits it:
Then:
- Launch Excel from that same shell or from a parent process that inherited the variable.
- Start your add-in locally.
- Confirm the debug endpoint is live.
Worked example:
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:
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:
A healthy response is JSON and includes fields such as:
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:
Claude Code (CLI)
One-liner:
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:
- Add the marketplace from
.claude-plugin/marketplace.jsonwith/plugin marketplace add dsbissett/excel-webview2-mcp. - Install with
/plugin install excel-webview2-mcp.
Claude Code (VS Code extension)
- Open the Claude Code side panel in VS Code.
- Open the command palette and run Claude Code: Manage MCP Servers (or click the MCP icon in the Claude panel).
- Choose Add Server and paste the canonical MCP entry above, or run the
claude mcp addcommand 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:
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.
-
Create or edit
.vscode/mcp.jsonin your workspace (or the user-levelmcp.jsonvia MCP: Open User Configuration from the command palette). -
Add the server entry:
-
Open Copilot Chat, switch to Agent mode, and click the Tools icon to confirm the
excel-webview2tools 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
Supported Node.js versions are ^20.19.0, ^22.12.0, or >=23.
来源:README.md,提交 51a2812
工具
0版本历史
1- v0.0.13最新Sep 16, 2026
评分
已满足适用检查项的 40%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分
请在仓库或注册中心条目中声明许可证。