[BUG] Chrome extension native messaging connection not initiated on Windows when Claude Desktop is closed
Environment
- OS: Windows 11 (Build 26220.7670)
- Claude Code version: 2.1.22
- Claude Desktop version: 1.1.1200 (installed but closed during testing)
- Chrome extension ID: fcoeoabgfenejglbffodgkkbkcdhcgfn
- Browsers tested: Google Chrome, Perplexity Comet (Chromium-based)
- Node.js: Installed at
C:\Program Files\nodejs\node.exe
Summary
Claude Code's Chrome MCP tools (mcp__claude-in-chrome__*) fail with "Browser extension is not connected" even after:
- Properly configuring the native messaging host manifest
- Ensuring Claude Desktop is completely closed
- Restarting the browser multiple times
The native messaging host (chrome-native-host.bat) is never spawned by Chrome because the extension never calls chrome.runtime.connectNative().
Root Cause Analysis
With Claude Desktop Running
- Desktop spawns its own
chrome-native-host.exedirectly (doesn't rely on Chrome/manifest) - Extension connects successfully to Desktop
- Claude Code's MCP tools still fail (Desktop's host doesn't bridge to Code)
With Claude Desktop Closed
- No native host process spawns at all
- Manifest correctly points to Code's host (
C:\Users\haymo\.claude\chrome\chrome-native-host.bat) - Registry correctly points to manifest
- Extension ID is in
allowed_origins - But the extension never initiates the native messaging connection
Diagnostic Evidence
Registry Configuration (Correct)
HKCU\Software\Google\Chrome\NativeMessagingHosts\com.anthropic.claude_browser_extension
(Default) = C:\Users\haymo\AppData\Roaming\Claude\ChromeNativeHost\com.anthropic.claude_browser_extension.json
Modified Manifest (Correct)
{
"name": "com.anthropic.claude_browser_extension",
"description": "Claude Browser Extension Native Host",
"path": "C:\\Users\\haymo\\.claude\\chrome\\chrome-native-host.bat",
"type": "stdio",
"allowed_origins": [
"chrome-extension://dihbgbndebgnbjfmelmegjepbnkhlgni/",
"chrome-extension://fcoeoabgfenejglbffodgkkbkcdhcgfn/",
"chrome-extension://dngcpimnedloihjnnfngkgjoidhnaolf/"
]
}
Native Host Script (Verified Working)
@echo off
REM Chrome native host wrapper script
REM Generated by Claude Code - do not edit manually
"C:\Program Files\nodejs\node.exe" "C:\Users\haymo\.npm-global\node_modules\@anthropic-ai\claude-code\cli.js" --chrome-native-host
- Bat file exists and runs manually (tested with timeout, waits on stdin as expected)
- CRLF line endings verified
- Node.js and CLI paths verified to exist
Process Observations
| Scenario | Native Host Process | MCP Tool Result |
|----------|---------------------|-----------------|
| Desktop running | chrome-native-host.exe from app-1.1.1200 | "Browser extension is not connected" |
| Desktop closed | No process spawned | "Browser extension is not connected" |
Extension Console
- No errors in extension's service worker console
- Extension loads, creates tab groups, but never initiates native messaging
Expected Behavior
When Claude Code's MCP tools are called (e.g., tabs_context_mcp), Claude Code should either:
- Trigger the Chrome extension to call
connectNative(), causing Chrome to spawn the native host - Or spawn the native host directly (like Claude Desktop does)
Actual Behavior
- MCP server responds to tool calls
- MCP server reports "Browser extension is not connected"
- No native host process is ever spawned
- Extension never attempts native messaging connection
Workaround Attempted (Failed)
Modified Desktop's manifest to point to Code's native host bat file. This correctly updates the manifest, but Chrome never spawns it because the extension never requests the connection.
Related Issues
- #20887 - Chrome MCP connects to Desktop instead of Code
- #20546 - Extension conflict: Desktop and Code compete
- #20341 - Desktop native host intercepts connection
- #20943 - Claude Desktop and Claude Code conflict over Chrome extension
Suggested Fix
Claude Code needs a mechanism to trigger the Chrome extension to initiate the native messaging connection — similar to whatever mechanism Claude Desktop uses. Without this trigger, the extension sits idle and never spawns the native host.
Possible approaches:
- Claude Code could spawn the native host directly (like Desktop does)
- Claude Code could signal the extension via another channel (WebSocket, etc.) to trigger
connectNative() - The extension could poll for native messaging availability on a timer
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗