claude-in-chrome never connects to a healthy native-messaging bridge (Linux)
Summary
mcp__claude-in-chrome__* tools always return "Browser extension is not connected", even though every link in the native-messaging chain is verifiably healthy — the bridge socket exists, is listening, and accepts connections. Claude Code never dials it.
Environment
| | |
|---|---|
| OS | Ubuntu 24.04.4 LTS (x11) |
| Chrome | 148.0.7778.215 |
| Extension | Claude 1.0.85 (fcoeoabgfenejglbffodgkkbkcdhcgfn) |
| Claude Code | 2.1.234 |
Extension is installed and enabled in the active profile (disable_reasons: []), and that profile is signed into claude.ai with the same account as Claude Code.
What I verified
Native messaging manifest is correct. ~/.config/google-chrome/NativeMessagingHosts/com.anthropic.claude_code_browser_extension.json has allowed_origins: ["chrome-extension://fcoeoabgfenejglbffodgkkbkcdhcgfn/"], matching the installed extension ID exactly, and path → ~/.claude/chrome/chrome-native-host, which execs the current Claude Code binary with --chrome-native-host.
The host launches and listens. Running the wrapper by hand:
[Claude Chrome Native Host] Initializing...
[Claude Chrome Native Host] Creating socket listener: /tmp/claude-mcp-browser-bridge-$USER/<pid>.sock
[Claude Chrome Native Host] Socket server listening for connections
[Claude Chrome Native Host] Socket permissions set to 0600
Chrome does spawn it. After a Chrome restart, pgrep -af -- --chrome-native-host shows the host running, and its socket exists.
The socket accepts clients. Connecting directly from a shell succeeds:
s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
s.connect("/tmp/claude-mcp-browser-bridge-$USER/<pid>.sock") # CONNECT OK
But Claude Code never connects. lsof on the socket shows only the listener, at every point during the session:
COMMAND PID USER FD TYPE NODE NAME
2.1.234 <hostpid> ... 9u unix ... /tmp/claude-mcp-browser-bridge-$USER/<pid>.sock type=STREAM (LISTEN)
Zero client entries, before and after each remedy below.
Remedies tried, all ineffective
- Reload the extension at
chrome://extensions. - Full Chrome restart — verified by PID and start time that the process genuinely changed. This did fix a real staleness: the previous Chrome had been running 11 days and had extension 1.0.84 loaded while 1.0.85 was on disk. After restart, Preferences confirmed 1.0.85 loaded. The tools still failed.
/mcpreconnect — reportedReconnected to claude-in-chrome. No client appeared on the socket.- Full Claude Code restart. No client appeared on the socket.
Two things that made this hard to diagnose
/mcpreports success while the browser bridge stays unconnected. "Reconnected to claude-in-chrome" reflects the MCP server process, not the browser pairing, so it reads as a fix that worked. This sent me down the wrong path twice.- The socket is named after the native-host PID, so its path changes on every Chrome restart. If anything caches that path at startup, it would produce exactly this symptom — a permanently stale address. Offered as a hypothesis, not a finding.
Also
~/.claude/logs/ is empty — there was no log anywhere explaining the failed connection, which left lsof as the only way to see what was actually happening.
Expected
Either the tools connect, or the error distinguishes "no bridge socket found" from "bridge found but handshake failed" so the failing half is identifiable.