claude-code - 💡(How to fix) Fix Chrome extension service worker never initiates MCP bridge connection (Linux/AUR) [6 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#47808Fetched 2026-04-15 06:41:44
View on GitHub
Comments
6
Participants
3
Timeline
12
Reactions
0
Author
Timeline (top)
commented ×6labeled ×5closed ×1

The Claude Chrome extension installs and authenticates successfully in Google Chrome on Linux, but its service worker never executes the MCP bridge initialization code. The native messaging host crashes on startup due to missing DISABLE_AUTOUPDATER env var (AUR package issue), and even after fixing that, the extension's bridge logic never activates.

Error Message

Error in extension service worker: Unchecked runtime.lastError: Native host has exited.

Root Cause

The Claude Chrome extension installs and authenticates successfully in Google Chrome on Linux, but its service worker never executes the MCP bridge initialization code. The native messaging host crashes on startup due to missing DISABLE_AUTOUPDATER env var (AUR package issue), and even after fixing that, the extension's bridge logic never activates.

Fix Action

Fix / Workaround

Workaround: Setting DISABLE_AUTOUPDATER=1 in the user environment (via ~/.config/environment.d/) so Chrome passes it to the native host. Patching the script directly doesn't survive restarts since claude --chrome regenerates it.

RAW_BUFFERClick to expand / collapse

Summary

The Claude Chrome extension installs and authenticates successfully in Google Chrome on Linux, but its service worker never executes the MCP bridge initialization code. The native messaging host crashes on startup due to missing DISABLE_AUTOUPDATER env var (AUR package issue), and even after fixing that, the extension's bridge logic never activates.

Environment

Two issues found

1. Native host crashes due to auto-updater (AUR-specific)

The AUR package installs Claude Code at /opt/claude-code/bin/claude with a wrapper at /usr/bin/claude that sets DISABLE_AUTOUPDATER=1. However, claude --chrome generates ~/.claude/chrome/chrome-native-host pointing directly to /opt/claude-code/bin/claude, bypassing the wrapper. Without DISABLE_AUTOUPDATER, the native host crashes immediately after Chrome's native messaging connects to it.

Error in extension service worker: Unchecked runtime.lastError: Native host has exited.

Workaround: Setting DISABLE_AUTOUPDATER=1 in the user environment (via ~/.config/environment.d/) so Chrome passes it to the native host. Patching the script directly doesn't survive restarts since claude --chrome regenerates it.

Suggested fix: The generated chrome-native-host script should include export DISABLE_AUTOUPDATER=1, or it should call through /usr/bin/claude (or $(which claude)) instead of hardcoding the binary path.

2. Extension service worker never runs bridge logic

After fixing the native host crash, the extension's service worker remains completely dormant:

  • Service worker DevTools console is empty (no logs even on Verbose)
  • mcpConnected is never written to extension storage (or stays false)
  • chrome.runtime.connectNative() from DevTools works — returns a port, no errors, native host stays alive
  • But the extension never calls connectNative on its own
  • chrome_ext_bridge_enabled feature flag is true (source: defaultValue)
  • Extension has valid OAuth tokens (accessToken, refreshToken)
  • Pairing was completed (bridgeDisplayName set)
  • browserControlPermissionAccepted: true
  • Claude Code has 10+ active connections to bridge.claudeusercontent.com
  • Chrome has connections to the same bridge server
  • But the extension never joins the bridge for MCP tool calls

Steps to reproduce

  1. Install Claude Code via AUR package
  2. Install Claude extension in Google Chrome
  3. Log into claude.ai in Chrome
  4. Complete extension pairing
  5. Run claude --chrome
  6. Invoke any mcp__claude-in-chrome__* tool → "Browser extension is not connected"

Diagnostic details

  • Initially tried Chromium (known unsupported due to server-side feature flag). Switched to Google Chrome — same result for issue #2.
  • The cloud bridge (wss://bridge.claudeusercontent.com) is the data path, not local unix sockets. Both sides connect to the bridge server but the extension never initiates the MCP handshake.
  • No other Claude Code sessions running during final tests.
  • Extension toggled off/on, Chrome restarted multiple times — no change.

Expected behavior

After pairing and authentication, the extension's service worker should automatically initiate the MCP bridge connection via native messaging, allowing Claude Code's mcp__claude-in-chrome__* tools to function.

extent analysis

TL;DR

The most likely fix involves modifying the chrome-native-host script to include export DISABLE_AUTOUPDATER=1 or to call the claude binary through the wrapper script at /usr/bin/claude, and then troubleshooting the extension's service worker to initiate the MCP bridge connection.

Guidance

  1. Fix the native host crash: Modify the chrome-native-host script to include export DISABLE_AUTOUPDATER=1 before calling the claude binary, or change it to call /usr/bin/claude instead of the hardcoded binary path.
  2. Verify the extension's service worker: Check the service worker's DevTools console for any errors or logs that might indicate why it's not initiating the MCP bridge connection.
  3. Check the extension's feature flags and settings: Ensure that the chrome_ext_bridge_enabled feature flag is still set to true and that the extension has valid OAuth tokens and pairing information.
  4. Test the native messaging connection: Use the chrome.runtime.connectNative() method in the DevTools console to test the connection to the native host and verify that it's working as expected.

Example

To modify the chrome-native-host script, you can add the following line at the top of the script:

export DISABLE_AUTOUPDATER=1

Alternatively, you can change the line that calls the claude binary to:

/usr/bin/claude "$@"

Notes

The issue seems to be related to the native messaging host crashing due to the missing DISABLE_AUTOUPDATER environment variable, and the extension's service worker not initiating the MCP bridge connection. However, the root cause of the service worker issue is still unclear and may require further troubleshooting.

Recommendation

Apply the workaround by modifying the chrome-native-host script to include export DISABLE_AUTOUPDATER=1, and then troubleshoot the extension's service worker to initiate the MCP bridge connection. This should fix the native host crash and potentially resolve the service worker issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

After pairing and authentication, the extension's service worker should automatically initiate the MCP bridge connection via native messaging, allowing Claude Code's mcp__claude-in-chrome__* tools to function.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix Chrome extension service worker never initiates MCP bridge connection (Linux/AUR) [6 comments, 3 participants]