Chrome extension service worker never initiates native messaging connection (Linux/Xpra)

Resolved 💬 3 comments Opened Mar 7, 2026 by rashidshafeev Closed Mar 10, 2026

Description

The Claude in Chrome extension's service worker never initiates a connectNative() call to the native messaging host, despite all infrastructure being correctly set up and functional. The MCP tools always return "Browser extension is not connected."

This was first encountered on extension v1.0.49 / Claude Code v2.1.39 in February 2026. Retested today with extension v1.0.57 / Claude Code v2.1.71 — same behavior persists.

Environment

| Component | Version |
|-----------|---------|
| Claude Code | 2.1.71 |
| Chrome | 145.0.7632.75 |
| Claude in Chrome extension | 1.0.57 |
| OS | Ubuntu 24.04.2 LTS (Noble Numbat) |
| Kernel | 6.8.0-101-generic x86_64 |
| Display | Xpra 6.4.3-r0 virtual display :100 |
| Chrome flags | --no-sandbox --disable-gpu (running as root on VPS) |

What works

Every component in the chain is verified functional:

| Component | Status | Evidence |
|-----------|--------|----------|
| Xpra display :100 | LIVE | xpra list confirms |
| Chrome | Running | 12 processes active |
| Extension v1.0.57 | Installed | manifest.json present in profile, from Web Store |
| Native host wrapper | Correct | Shell script exec's claude --chrome-native-host |
| Native host manifest | Correct | Points to wrapper, allowed_origins matches extension ID |
| Native host process | Running | PID visible, parent is Chrome (Chrome spawned it correctly) |
| Bridge socket | Created | /tmp/claude-mcp-browser-bridge-root/{PID}.sock exists |
| Socket permissions | Correct | srw------- root root |
| Socket connectable | Yes | Manual net.connect() succeeds |
| Claude Code --chrome | Running | MCP server active |
| Same account | Yes | Same Anthropic account on CLI and Chrome |

What doesn't work

The extension's service worker never sends any messages through the native messaging port. The native host spawns, creates a socket, and listens — but receives no communication from the extension side.

ss -x | grep {native_host_pid} shows "No peer connections to native host socket" — the MCP server never connects because the native host never relays any handshake.

Calling any mcp__claude-in-chrome__* tool returns:

Browser extension is not connected. Please ensure the Claude browser extension is installed and running...

Previous debug session (Feb 2026, v1.0.49 / v2.1.42)

Extensive debugging was done previously. Key findings:

  1. Manual connectNative() works: Running chrome.runtime.connectNative('com.anthropic.claude_code_browser_extension') in the extension's service worker DevTools console returns a valid Port object and spawns a second native host. Proves the native messaging infrastructure is functional.
  1. But the manual port doesn't fix it: The manually created port isn't wired into the extension's internal tab management/routing logic, so MCP still reports "not connected."
  1. Extension service worker console is clean: No errors, no output related to native messaging connection attempts. The code path that should call connectNative() on startup simply never executes.
  1. Standard workarounds all failed: Restart Chrome, toggle extension, restart Claude Code, restart Xpra, kill stale sessions, switch_browser MCP call, /chrome → Reconnect — none worked.

Reproducing

  1. Ubuntu 24.04 VPS with Xpra virtual display
  2. Install Chrome + Claude in Chrome extension from Web Store
  3. Start Chrome on Xpra display: xpra start :100 --start="google-chrome --no-sandbox --disable-gpu" --bind-tcp=0.0.0.0:14501
  4. Run claude --chrome --resume
  5. Attempt any mcp__claude-in-chrome__* tool call → "not connected"

Possibly related issues

  • #24192 - Linux: Native messaging bridge socket never created
  • #23811 - macOS: Service worker never initiates native messaging connection
  • #24935 - v2.1.39 + ext v1.0.47: "not connected" despite correct setup
  • #24593 - Persistent connection failure from CLI
  • #21796 - MCP shows connected but extension doesn't connect
  • #16350 - Native host dies when service worker goes idle

Multiple reporters in those issues describe the exact same pattern: all infrastructure works, but the extension's service worker never calls connectNative(). The recent changelog fix ("Fixed Chrome extension auto-detection getting permanently stuck on 'not installed' after running on a machine without local Chrome") addresses detection logic, not this connection initiation issue.

Diagnostic data

Native host manifest (~/.config/google-chrome/NativeMessagingHosts/com.anthropic.claude_code_browser_extension.json):

{
  "name": "com.anthropic.claude_code_browser_extension",
  "description": "Claude Code Browser Extension Native Host",
  "path": "/root/.claude/chrome/chrome-native-host",
  "type": "stdio",
  "allowed_origins": [
    "chrome-extension://fcoeoabgfenejglbffodgkkbkcdhcgfn/"
  ]
}

Native host wrapper (~/.claude/chrome/chrome-native-host):

#!/bin/sh
# Chrome native host wrapper script
# Generated by Claude Code - do not edit manually
exec "/root/.local/share/claude/versions/2.1.71" --chrome-native-host

Process tree snapshot:

chrome (PID 2053166)
  └── claude --chrome-native-host (PID 2053510)
        └── listening on /tmp/claude-mcp-browser-bridge-root/2053510.sock
              └── NO peer connections (ss -x confirms)

claude --chrome --resume (PID 2046838)  ← current session, MCP active
claude --chrome --resume (PID 47645)    ← other active session

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗