-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Description
Description
The Claude in Chrome extension (v1.0.61) never initiates a native messaging connection (chrome.runtime.connectNative) despite being installed, enabled, and correctly configured. The --claude-in-chrome-mcp subprocess starts and registers as a built-in MCP, but returns "Browser extension is not connected" because no native host socket exists.
Environment
- OS: macOS 15.5 (Darwin 24.6.0, Apple Silicon)
- Chrome: 145.0.7632.160
- Claude Code CLI: 2.1.76
- Extension version: 1.0.61
- Extension ID:
fcoeoabgfenejglbffodgkkbkcdhcgfn - Claude Desktop: Installed but not running
What works
- Extension is installed and enabled (sidebar works, can chat in it)
- Native host binary works: responds to ping/pong correctly via native messaging protocol
--claude-in-chrome-mcpsubprocess works: responds to MCP initialize, returns proper error when no socket found- End-to-end bridge works when native host is manually started: socket accepts connections, forwards messages via 4-byte length-prefixed protocol
CLAUDE_CODE_ENABLE_CFC=1env var correctly enables the built-in MCP (shows "claude-in-chrome · ✓ connected" in built-in MCPs)- Both native messaging manifests are valid and point to
~/.claude/chrome/chrome-native-host
What doesn't work
- The extension's service worker never calls
connectNative— verified by:- Monitoring
ps auxforchrome-native-hostprocesses after Chrome restart — none spawned - Wrapping the native host in a logging script — wrapper never executed
- Checking
/tmp/claude-mcp-browser-bridge-<user>/— no socket directory created - Multiple Chrome restarts, extension disable/enable cycles, full extension reinstall — no effect
- Monitoring
Root cause analysis
Decompiled the extension's service worker (service-worker.ts-C4SRwdsa.js). The connectNative call is in function M(), which is called on:
- Module load:
b(),o(),M() chrome.runtime.onInstalledchrome.runtime.onStartupchrome.permissions.onAdded(for nativeMessaging)
M() has guards:
if(I) return true; // already connected
if(A) return false; // already attempted, never retries
A = true;The function checks chrome.permissions.contains({permissions:["nativeMessaging"]}) and typeof chrome.runtime.connectNative === "function" before attempting connection. One of these checks may be failing silently, or b() / o() may be throwing before M() is reached. The service worker console shows no errors.
Steps to reproduce
- Install Claude Chrome extension (v1.0.61)
- Verify native messaging manifests exist in
~/Library/Application Support/Google/Chrome/NativeMessagingHosts/ - Start
CLAUDE_CODE_ENABLE_CFC=1 claude --chrome - Call any
mcp__claude-in-chrome__*tool - Get "Browser extension is not connected" error
- Verify no
chrome-native-hostprocess was ever spawned
Troubleshooting attempted
- Full Chrome restart (quit + reopen) — multiple times
- Extension disable/enable toggle
- Extension full uninstall + reinstall from Chrome Web Store
- Cleared extension Local Storage, IndexedDB, Sync Extension Settings
- Set
tengu_chrome_auto_enable: truein~/.claude.json - Set
CLAUDE_CODE_ENABLE_CFC=1env var - Renamed/disabled Desktop native messaging manifest (
com.anthropic.claude_browser_extension.json) - Created symlink from
os.tmpdir()path to/tmp/socket directory - Multiple fresh Claude Code sessions (not resumed)
Notes
- The
CLAUDE_CODE_ENABLE_CFC=1env var is required to even register the MCP — without it,_uT()returns false becauses8()(OAuth scope check) fails tengu_chrome_auto_enabledefaults tofalseserver-side- The extension tries two host names in order:
com.anthropic.claude_browser_extension(Desktop) thencom.anthropic.claude_code_browser_extension(Code) — neither gets called