{
  "markdown": "# Excel WebView2 MCP\n\nProfessional MCP connectivity for Microsoft Excel add-ins running inside WebView2.\n\n| Item              | Value                                        |\n| ----------------- | -------------------------------------------- |\n| Package           | `@dsbissett/excel-webview2-mcp`              |\n| Upstream          | Fork of `ChromeDevTools/chrome-devtools-mcp` |\n| Target runtime    | Excel add-ins hosted in WebView2             |\n| Debug endpoint    | `http://127.0.0.1:9222`                      |\n| Recommended setup | Claude Code plugin marketplace               |\n\n> [!IMPORTANT]\n> 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`.\n> 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.\n\n## What's New in v0.0.2\n\n- **Add-in lifecycle management** — new tools launch and stop Excel add-ins directly from Claude Code:\n  - [excel_detect_addin](src/tools/lifecycle.ts) — discover manifest and dev server configuration for the current project.\n  - [excel_launch_addin](src/tools/lifecycle.ts) — start the dev server (if needed) and launch Excel with the add-in sideloaded and CDP port `9222` enabled.\n  - [excel_stop_addin](src/tools/lifecycle.ts) — tear down the launched Excel session and dev server process tree.\n- **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:\n  - Context & structure: `excel_context_info`, `excel_workbook_info`, `excel_list_worksheets`, `excel_worksheet_info`, `excel_active_range`, `excel_used_range`.\n  - Range reads: `excel_read_range`, `excel_range_properties`, `excel_range_formulas`, `excel_range_special_cells`, `excel_find_in_range`.\n  - Formatting & validation: `excel_list_conditional_formats`, `excel_list_data_validations`.\n  - Tables & names: `excel_list_tables`, `excel_table_info`, `excel_table_rows`, `excel_table_filters`, `excel_list_named_items`.\n  - Comments & shapes: `excel_list_comments`, `excel_list_shapes`.\n  - Calculation & pivots: `excel_calculation_state`, `excel_list_pivot_tables`, `excel_pivot_table_info`, `excel_pivot_table_values`.\n  - Charts: `excel_list_charts`, `excel_chart_info`, `excel_chart_image`.\n  - Misc: `excel_custom_xml_parts`, `excel_settings_get`.\n- **Socket-based port detection** replaces HTTP polling for more reliable dev-server and CDP readiness checks on Node 24.\n- **Robust cleanup on Windows** — `excel_stop_addin` now force-kills the dev server process tree via `taskkill`.\n\n## Fork Notice\n\nThis repository is a fork of the Chrome DevTools MCP repository, [`ChromeDevTools/chrome-devtools-mcp`](https://github.com/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.\n\n## What This Project Does\n\n- Connects Claude Code to a locally running Excel add-in through the Chrome DevTools Protocol (CDP).\n- Exposes MCP tools for inspection, automation, screenshots, console access, network inspection, and performance analysis.\n- Targets the embedded WebView2 runtime used by Excel add-ins instead of a standalone Chrome session.\n\n## Connection Model\n\n```text\nClaude Code\n    |\n    v\nexcel-webview2-mcp\n    |\n    v\nWebView2 remote debugging endpoint (localhost:9222)\n    |\n    v\nLocally running Excel add-in\n```\n\nThat 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.\n\n## Prerequisites\n\nYou have two supported workflows:\n\n### Auto-launch (recommended, v0.0.2+)\n\n1. Your Office add-in project (with a `manifest.xml` and a dev server script) lives on disk.\n2. Excel desktop is installed on Windows.\n3. Node.js is installed and `npx @dsbissett/excel-webview2-mcp@latest` is runnable.\n\nCall `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.\n\n### Manual / pre-attached\n\n1. Your Excel add-in is already loaded and running in the local Excel desktop client.\n2. WebView2 remote debugging is enabled and bound to port `9222` (see [Launching Excel with the debug port](#launching-excel-with-the-debug-port)).\n3. The debugging endpoint is reachable at `http://127.0.0.1:9222`.\n\nVerify with:\n\n```sh\ncurl http://127.0.0.1:9222/json\n```\n\n## Launching Excel with the debug port\n\nThis 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.\n\nIf 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.\n\nSources:\n\n- WebView2 debug arguments and registry policy: <https://learn.microsoft.com/en-us/microsoft-edge/webview2/how-to/debug-visual-studio-code>\n- 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>\n- Office add-ins debugging overview, including Mac: <https://learn.microsoft.com/en-us/office/dev/add-ins/testing/debug-add-ins-overview>\n\n### Windows: preferred local-dev setup\n\nSet the environment variable before launching Excel so the Excel process inherits it:\n\n```powershell\n$env:WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS=\"--remote-debugging-port=9222\"\n```\n\nThen:\n\n1. Launch Excel from that same shell or from a parent process that inherited the variable.\n2. Start your add-in locally.\n3. Confirm the debug endpoint is live.\n\nWorked example:\n\n```powershell\n$env:WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS=\"--remote-debugging-port=9222\"\nstart excel.exe\n```\n\nThe 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.\n\n### Windows: persistent registry fallback\n\nIf you need a persistent machine-local setting, the WebView2 team documents this registry policy path:\n\n```text\nHKEY_CURRENT_USER\\Software\\Policies\\Microsoft\\Edge\\WebView2\\AdditionalBrowserArguments\n```\n\nUse:\n\n- Value name: `EXCEL.EXE`\n- Value data: `--remote-debugging-port=9222`\n\nUse the environment variable first for local development. It is easier to turn on and off and avoids leaving a persistent machine-wide setting behind.\n\n### Verify the endpoint\n\nRun:\n\n```sh\ncurl http://127.0.0.1:9222/json/version\n```\n\nA healthy response is JSON and includes fields such as:\n\n```json\n{\n  \"Browser\": \"...\",\n  \"Protocol-Version\": \"...\",\n  \"webSocketDebuggerUrl\": \"ws://127.0.0.1:9222/devtools/browser/...\"\n}\n```\n\nIf that `curl` command fails, Excel is not exposing the WebView2 debug port yet, and `excel-webview2-mcp` will not be able to attach.\n\n## Installation\n\nThe 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.\n\nCanonical MCP entry:\n\n```json\n{\n  \"mcpServers\": {\n    \"excel-webview2\": {\n      \"command\": \"npx\",\n      \"args\": [\"@dsbissett/excel-webview2-mcp@latest\"]\n    }\n  }\n}\n```\n\n<details>\n<summary><strong>Claude Code (CLI)</strong></summary>\n\nOne-liner:\n\n```sh\nclaude mcp add excel-webview2 -- npx @dsbissett/excel-webview2-mcp@latest\n```\n\nUse `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.\n\nAlternatively, install the bundled plugin:\n\n1. Add the marketplace from [`.claude-plugin/marketplace.json`](.claude-plugin/marketplace.json) with `/plugin marketplace add dsbissett/excel-webview2-mcp`.\n2. Install with `/plugin install excel-webview2-mcp`.\n\n</details>\n\n<details>\n<summary><strong>Claude Code (VS Code extension)</strong></summary>\n\n1. Open the Claude Code side panel in VS Code.\n2. Open the command palette and run **Claude Code: Manage MCP Servers** (or click the MCP icon in the Claude panel).\n3. 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.\n\n</details>\n\n<details>\n<summary><strong>Cursor</strong></summary>\n\nEdit `~/.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.\n\n</details>\n\n<details>\n<summary><strong>Codex (OpenAI Codex CLI)</strong></summary>\n\nCodex reads MCP servers from `~/.codex/config.toml`. Add:\n\n```toml\n[mcp_servers.excel-webview2]\ncommand = \"npx\"\nargs = [\"@dsbissett/excel-webview2-mcp@latest\"]\n```\n\nThen launch `codex` and confirm the server appears in `/mcp`.\n\n</details>\n\n<details>\n<summary><strong>GitHub Copilot (VS Code)</strong></summary>\n\nGitHub Copilot Chat in VS Code supports MCP servers through the agent-mode configuration.\n\n1. Create or edit `.vscode/mcp.json` in your workspace (or the user-level `mcp.json` via **MCP: Open User Configuration** from the command palette).\n2. Add the server entry:\n\n   ```json\n   {\n     \"servers\": {\n       \"excel-webview2\": {\n         \"command\": \"npx\",\n         \"args\": [\"@dsbissett/excel-webview2-mcp@latest\"]\n       }\n     }\n   }\n   ```\n\n3. 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.\n\n</details>\n\n### Verifying the install\n\nAfter 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.\n\nBy default, the server connects to the local WebView2 debugging endpoint at `http://127.0.0.1:9222`.\n\n## Local Development\n\n```sh\nnpm install\nnpm run build\nnpm start\n```\n\nSupported Node.js versions are `^20.19.0`, `^22.12.0`, or `>=23`.\n",
  "bytes": 10604,
  "sha": "440ca399f2f507fc6d8fc76c90526a105fc12670124485e4b8950b5ac0c212bf",
  "repo_slug": "dsbissett/excel-webview2-mcp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_dsbissett_excel_webview2_mcp_143c769c/readme"
}