Title: Claude Chrome Extension Unable to Connect to Claude Code CLI Despite Correct Configuration
Environment:
- OS: Windows 10/11
- Chrome Version: 144.0.7559.133
- Claude Code Version: 2.1.37
- Claude Extension Version: 1.0.47
- Chrome Profile: Custom profile (not Default)
- Account: Claude Max subscription
Expected Behavior:
The Claude Chrome extension should establish a native messaging connection with Claude Code CLI, allowing browser automation tools to function.
Actual Behavior:
Connection fails with error: "Browser extension is not connected" when calling mcp__claude-in-chrome__tabs_context_mcp from Claude Code CLI.
Symptoms:
- MCP server "claude-in-chrome" successfully connects: Successfully connected to stdio server in 862ms
- MCP tool calls complete: Tool 'tabs_context_mcp' completed successfully in 5s
- But tool returns error message about extension not being connected
- Extension side panel shows error: Error: Could not establish connection. Receiving end does not exist (in mcpPermissions-BCnWD2v-.js and
sidepanel-BM4PE_2r.js)
- Extension service worker shows no errors in console and status is RUNNING
Configuration Verified:
✅ Native messaging host registered in Windows Registry:
HKEY_CURRENT_USER\Software\Google\Chrome\NativeMessagingHosts\com.anthropic.claude_code_browser_extension
✅ Manifest file exists at:
%APPDATA%\Claude Code\ChromeNativeHost\com.anthropic.claude_code_browser_extension.json
✅ Manifest contents (sanitized):
{
"name": "com.anthropic.claude_code_browser_extension",
"description": "Claude Code Browser Extension Native Host",
"path": "C:\\Users\\[USERNAME]\\.claude\\chrome\\chrome-native-host.bat",
"type": "stdio",
"allowed_origins": [
"chrome-extension://fcoeoabgfenejglbffodgkkbkcdhcgfn/"
]
}
✅ Extension ID matches: fcoeoabgfenejglbffodgkkbkcdhcgfn
✅ Extension has nativeMessaging permission in manifest.json
✅ Logged into claude.ai with same account as Claude Code CLI
✅ OAuth connection shown in claude.ai Settings → Claude Code: "Connected"
Troubleshooting Steps Attempted:
- Fixed conflicting MCP configuration: Removed custom "chrome" MCP server from ~/.claude.json that was causing EADDRINUSE error on pipe
\\.\pipe\claude-mcp-browser-bridge-[USERNAME]
- Restarted Claude Code CLI multiple times: Ensured clean session and pipe release
- Verified extension installation:
- Extension installed in correct profile
- Extension enabled and visible in chrome://extensions
- Service worker status: RUNNING (verified in chrome://serviceworker-internals/)
- Service worker console shows no errors
- Reinstalled extension:
- Uninstalled extension completely
- Unregistered service workers
- Cleared browser data
- Closed Chrome completely (verified with Task Manager)
- Reinstalled from https://claude.ai/chrome
- Issue persists
- Verified authentication:
- Logged into claude.ai in Chrome profile
- Account matches between browser and CLI
- OAuth token valid in Claude Code CLI
- Tested with fresh Chrome profile: Issue persists across profiles
- Checked native host script: ~/.claude/chrome/chrome-native-host.bat exists and points to correct Node.js and CLI paths
Debug Logs:
MCP server successfully connects:
[DEBUG] MCP server "claude-in-chrome": Successfully connected to stdio server in 862ms
[DEBUG] MCP server "claude-in-chrome": Connection established with capabilities:
{"hasTools":true,"hasPrompts":false,"hasResources":false,"serverVersion":{"name":"Claude in Chrome","version":"1.0.0"}}
Tool execution completes but returns error:
[DEBUG] MCP server "claude-in-chrome": Calling MCP tool: tabs_context_mcp
[DEBUG] MCP server "claude-in-chrome": Tool 'tabs_context_mcp' completed successfully in 5s
Extension console errors (from side panel):
sidepanel-BM4PE_2r.js:6 Uncaught (in promise) Error: Could not establish connection. Receiving end does not exist.
mcpPermissions-BCnWD2v-.js:2 Uncaught (in promise) Error: Could not establish connection. Receiving end does not exist.
Analysis:
The MCP server infrastructure is working correctly - it connects, can execute tools, and returns responses. However, the Chrome extension's
background service worker is not establishing or maintaining the native messaging connection. The "Receiving end does not exist" error suggests
the extension's message listeners are not being initialized, despite the service worker showing as RUNNING with no console errors.
Suspected Root Cause:
The extension's service worker may not be properly initializing the native messaging port connection, or the connection is failing silently
without logging errors. This could be:
- A timing issue in extension initialization
- A bug in the native messaging setup code
- A Chrome API issue with native messaging in Manifest V3 extensions
- Windows-specific permission or security issue
Additional Notes:
- Multiple service worker registrations were observed initially (some STOPPED, some RUNNING)
- CSP warnings present in extension console (Segment CDN scripts blocked) but these appear unrelated to core functionality
Request:
Please investigate why the Chrome extension is unable to establish the native messaging connection despite all infrastructure being correctly
configured. Debug logs or a diagnostic tool would be helpful to identify where the connection is failing.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗