Skip to content

Claude-in-Chrome: Extension not connecting despite valid native host and socket #32112

@CharlesHaworth

Description

@CharlesHaworth

Environment

  • Claude Code version: 2.1.71 (native install, macOS Darwin 25.3.0, Apple Silicon)
  • Chrome: Latest stable
  • Claude Desktop: Also installed
  • OS: macOS Sequoia

Problem

All mcp__claude-in-chrome__* tools return "Browser extension is not connected" despite the native messaging host running correctly and the Unix domain socket existing.

What works

  • Native messaging host manifest is correctly configured at ~/Library/Application Support/Google/Chrome/NativeMessagingHosts/com.anthropic.claude_browser_extension.json
  • The manifest points to Claude Code's binary: ~/.claude/chrome/chrome-native-host
  • The wrapper script executes: ~/.local/share/claude/versions/2.1.71 --chrome-native-host
  • Chrome spawns the native host process successfully (confirmed via ps aux)
  • Unix socket is created at /tmp/claude-mcp-browser-bridge-charles/<PID>.sock
  • Socket accepts connections (confirmed via nc -U)
  • claude doctor reports all healthy
  • /chrome in Claude Code shows a "reconnect extension" button; clicking it causes Chrome to flash (native host respawns)

What doesn't work

  • Claude Code's MCP server never connects to the socket
  • mcp__claude-in-chrome__tabs_context_mcp always returns "Browser extension is not connected"
  • Tried: restarting Chrome, restarting Claude Code (both --resume and fresh session), killing/respawning the native host, clearing stale sockets

Root cause hypothesis

The Chrome extension hardcodes the native host name com.anthropic.claude_browser_extension (Desktop's host ID), not com.anthropic.claude_code_browser_extension (Code's host ID). We redirected the Desktop manifest to point to Claude Code's binary, which successfully spawns the native host and creates the socket. However, Claude Code's MCP server appears to either:

  1. Not scan /tmp/claude-mcp-browser-bridge-charles/ for sockets, or
  2. Only scan at startup and miss sockets created afterward, or
  3. Use a different communication mechanism entirely that we haven't identified

Steps to reproduce

  1. Have both Claude Desktop and Claude Code installed on macOS
  2. Install the Claude browser extension in Chrome
  3. Start Claude Code with --chrome (or default chrome enabled)
  4. Open Chrome
  5. Verify native host is running: ps aux | grep chrome-native-host
  6. Verify socket exists: ls /tmp/claude-mcp-browser-bridge-charles/
  7. Call any mcp__claude-in-chrome__* tool - returns "not connected"

Files checked

~/Library/Application Support/Google/Chrome/NativeMessagingHosts/
  com.anthropic.claude_browser_extension.json      (redirected to Code's binary)
  com.anthropic.claude_code_browser_extension.json (Code's original manifest)
  com.anthropic.claude_browser_extension.json.bak  (Desktop's original manifest)

~/.claude/chrome/chrome-native-host  (wrapper script -> 2.1.71 --chrome-native-host)
/tmp/claude-mcp-browser-bridge-charles/<PID>.sock  (created by native host)

Expected behavior

Claude Code's MCP server should connect to the browser extension socket and mcp__claude-in-chrome__tabs_context_mcp should return tab information.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:chromebugSomething isn't workingduplicateThis issue or pull request already existshas reproHas detailed reproduction stepsplatform:macosIssue specifically occurs on macOSstaleIssue is inactive

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions