claude-code - 💡(How to fix) Fix Claude Code CLI cannot connect to Chrome extension when Claude Desktop uses the same extension ID [1 comments, 2 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#48502Fetched 2026-04-16 06:58:25
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
0
Timeline (top)
labeled ×5commented ×1

On a machine where Claude Desktop is installed, the Claude Code CLI's claude-in-chrome MCP bridge reports the extension as not connected, even though:

  • /mcp shows claude-in-chrome as ✔ connected
  • The Chrome extension is installed, enabled, signed in, and the side panel is open
  • Claude Desktop successfully connects to the same extension on the same machine

Every call to mcp__claude-in-chrome__tabs_context_mcp (and any other browser automation tool) returns:

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

Error Message

  • sidepanel.html console: Uncaught (in promise) Error: Could not establish connection. Receiving end does not exist. (plus unrelated CSP / Datadog / Segment warnings)

Root Cause

Root cause (as far as I can diagnose)

Fix Action

Fix / Workaround

Happy to provide further logs or test a patch.

Code Example

{
  "name": "com.anthropic.claude_browser_extension",
  "path": "/Applications/Claude.app/Contents/Helpers/chrome-native-host",
  "type": "stdio",
  "allowed_origins": [
    "chrome-extension://dihbgbndebgnbjfmelmegjepbnkhlgni/",
    "chrome-extension://fcoeoabgfenejglbffodgkkbkcdhcgfn/",
    "chrome-extension://dngcpimnedloihjnnfngkgjoidhnaolf/"
  ]
}

---

{
  "name": "com.anthropic.claude_code_browser_extension",
  "path": "/Users/philsmith/.claude/chrome/chrome-native-host",
  "type": "stdio",
  "allowed_origins": [
    "chrome-extension://fcoeoabgfenejglbffodgkkbkcdhcgfn/"
  ]
}

---

philsmith  96669  /Applications/Claude.app/Contents/Helpers/chrome-native-host chrome-extension://fcoeoabgfenejglbffodgkkbkcdhcgfn/

---

/tmp/claude-mcp-browser-bridge-philsmith/96669.sock
RAW_BUFFERClick to expand / collapse

Environment

  • OS: macOS (Darwin 25.3.0)
  • Chrome extension: Claude for Chrome (Beta) v1.0.68, ID fcoeoabgfenejglbffodgkkbkcdhcgfn
  • Claude Code CLI: v2.1.109 at /Users/philsmith/.local/share/claude/versions/2.1.109
  • Claude Desktop: installed and functional (connects to the extension successfully)

Summary

On a machine where Claude Desktop is installed, the Claude Code CLI's claude-in-chrome MCP bridge reports the extension as not connected, even though:

  • /mcp shows claude-in-chrome as ✔ connected
  • The Chrome extension is installed, enabled, signed in, and the side panel is open
  • Claude Desktop successfully connects to the same extension on the same machine

Every call to mcp__claude-in-chrome__tabs_context_mcp (and any other browser automation tool) returns:

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

Root cause (as far as I can diagnose)

Two native messaging host registrations exist and both list the same extension ID in allowed_origins:

~/Library/Application Support/Google/Chrome/NativeMessagingHosts/com.anthropic.claude_browser_extension.json (Desktop's):

{
  "name": "com.anthropic.claude_browser_extension",
  "path": "/Applications/Claude.app/Contents/Helpers/chrome-native-host",
  "type": "stdio",
  "allowed_origins": [
    "chrome-extension://dihbgbndebgnbjfmelmegjepbnkhlgni/",
    "chrome-extension://fcoeoabgfenejglbffodgkkbkcdhcgfn/",
    "chrome-extension://dngcpimnedloihjnnfngkgjoidhnaolf/"
  ]
}

~/Library/Application Support/Google/Chrome/NativeMessagingHosts/com.anthropic.claude_code_browser_extension.json (CLI's):

{
  "name": "com.anthropic.claude_code_browser_extension",
  "path": "/Users/philsmith/.claude/chrome/chrome-native-host",
  "type": "stdio",
  "allowed_origins": [
    "chrome-extension://fcoeoabgfenejglbffodgkkbkcdhcgfn/"
  ]
}

ps aux shows the extension launched Desktop's binary:

philsmith  96669  /Applications/Claude.app/Contents/Helpers/chrome-native-host chrome-extension://fcoeoabgfenejglbffodgkkbkcdhcgfn/

The bridge socket exists and is owned by that Desktop-host PID:

/tmp/claude-mcp-browser-bridge-philsmith/96669.sock

The CLI's host binary (~/.claude/chrome/chrome-native-host) is never invoked by the extension — it runs fine when launched manually and creates its own socket, but the extension never connects to it.

This strongly suggests the extension only calls chrome.runtime.connectNative("com.anthropic.claude_browser_extension") (Desktop's host name), and has no knowledge of the CLI's host name com.anthropic.claude_code_browser_extension. The CLI-installed host registration is therefore orphaned, and the CLI's MCP bridge cannot reach the extension.

Steps to reproduce

  1. Install Claude Desktop (registers com.anthropic.claude_browser_extension)
  2. Install Claude Code CLI and enable the Chrome extension integration (registers com.anthropic.claude_code_browser_extension)
  3. Install the Claude Chrome extension fcoeoabgfenejglbffodgkkbkcdhcgfn, sign in, open side panel
  4. In Claude Code, confirm /mcp shows claude-in-chrome: ✔ connected
  5. Attempt any mcp__claude-in-chrome__* tool call

Expected: extension responds, tab context / navigation tools work.

Actual: Every call returns "Browser extension is not connected."

Things I tried

  • Quit Claude Desktop (⌘Q), verified no UI process remains. The Desktop-bundled chrome-native-host helper (PID 96669) stays alive because Chrome keeps the extension's native-messaging pipe open; the CLI still cannot connect.
  • Reconnecting /mcpReconnected to claude-in-chrome but tool calls still fail.
  • Toggling the extension off/on in chrome://extensions/.
  • Reloading the side panel.
  • Verified native host binary works standalone: /Users/philsmith/.claude/chrome/chrome-native-host starts cleanly and creates its own socket at /tmp/claude-mcp-browser-bridge-philsmith/<pid>.sock.
  • Verified allowed_origins in both JSONs contains the correct extension ID.
  • Checked chrome://extensions/ → Claude → Inspect views:
    • service worker console: empty (other than an unrelated async-listener warning)
    • offscreen.html console: only [Offscreen] Document loaded and ready — no native-host connection attempt logged
    • sidepanel.html console: Uncaught (in promise) Error: Could not establish connection. Receiving end does not exist. (plus unrelated CSP / Datadog / Segment warnings)

What I think needs to happen

Either:

  1. The extension should also support com.anthropic.claude_code_browser_extension as a native host name (e.g., try CLI's host name first, or in addition to Desktop's), so Claude Code CLI users without Claude Desktop — and users with both — can connect; or
  2. The Desktop native host should multiplex, so the CLI's MCP bridge can share Desktop's socket at /tmp/claude-mcp-browser-bridge-philsmith/<pid>.sock instead of expecting its own host to be invoked; or
  3. Documentation needs to explicitly state that on machines with Desktop installed, the CLI integration won't work (or requires uninstalling Desktop's host JSON).

Happy to provide further logs or test a patch.

extent analysis

TL;DR

The most likely fix is to modify the Chrome extension to support both native host names, com.anthropic.claude_browser_extension and com.anthropic.claude_code_browser_extension, to enable connection with the Claude Code CLI.

Guidance

  • Verify that the Chrome extension is indeed only connecting to the Desktop's native host by checking the chrome-native-host process and its associated socket.
  • Consider modifying the Chrome extension to try connecting to both com.anthropic.claude_browser_extension and com.anthropic.claude_code_browser_extension native hosts, to support both Desktop and CLI users.
  • As an alternative, explore the possibility of multiplexing the Desktop native host to share its socket with the CLI's MCP bridge.
  • Review the documentation to ensure it accurately reflects the current limitations and potential workarounds for users with both Desktop and CLI installed.

Example

No code snippet is provided as the issue requires modifications to the Chrome extension or native host configurations, which are not explicitly defined in the issue.

Notes

The solution may require changes to the Chrome extension's native messaging implementation or the native host configurations. It is essential to test any modifications thoroughly to ensure compatibility with both Desktop and CLI users.

Recommendation

Apply a workaround by modifying the Chrome extension to support both native host names, as this approach seems to be the most feasible and user-friendly solution. This change would enable the extension to connect with the Claude Code CLI, even when the Desktop native host is present.

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…

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 Claude Code CLI cannot connect to Chrome extension when Claude Desktop uses the same extension ID [1 comments, 2 participants]