Claude in Chrome MCP: browser extension not connected from Claude Code CLI
Description
Claude in Chrome MCP tools (mcp__claude-in-chrome__tabs_context_mcp) always return "Browser extension is not connected" when called from Claude Code CLI, even though the native messaging host is correctly running and the socket bridge is active.
Environment
- OS: macOS 14.0 (Darwin 23.0.0)
- Claude Code version: 2.1.81
- Chrome version: 146.0.7680.153
- Claude browser extension: Installed (ID:
fcoeoabgfenejglbffodgkkbkcdhcgfn) - Claude Code launched with:
claude --chrome
Steps to Reproduce
- Install Claude browser extension in Chrome
- Log into claude.ai in Chrome with the same account as Claude Code
- Start Claude Code with
claude --chrome - Call
mcp__claude-in-chrome__tabs_context_mcpwithcreateIfEmpty: true - Get error: "Browser extension is not connected"
Debugging Performed
Native messaging host is correctly configured
The file at ~/Library/Application Support/Google/Chrome/NativeMessagingHosts/com.anthropic.claude_code_browser_extension.json exists with correct path and allowed_origins matching the extension ID.
Native host binary exists and works
~/.claude/chrome/chrome-native-host correctly execs the Claude Code binary with --chrome-native-host.
Socket bridge IS created and connectable
A socket is created at /tmp/claude-mcp-browser-bridge-<user>/<pid>.sock, owned by the Claude Code binary, and is connectable via Unix socket.
Key finding: Claude Desktop conflict
When Claude Desktop (Claude.app) was also installed, its native messaging host (com.anthropic.claude_browser_extension) took priority over Claude Code's (com.anthropic.claude_code_browser_extension). Both claim the same Chrome extension ID. Even after:
- Disabling Claude in Chrome from Claude Desktop settings
- Uninstalling Claude Desktop entirely
- Removing the Desktop's native messaging host config file
- Toggling the Chrome extension off/on
- Restarting Chrome
- Restarting Claude Code with
--chromeflag - Running
/reload-plugins - Fresh reinstall via
claude --chromeafter cleaning all artifacts
The MCP tool still reports "Browser extension is not connected."
Additional attempts that did not help
- Symlinked socket with Claude Code's PID
- Killed stale Desktop native host processes
- Verified Chrome extension ID matches allowed_origins
- Verified claude.ai login email matches Claude Code auth email
Expected Behavior
mcp__claude-in-chrome__tabs_context_mcp should detect the active native host socket and connect to the Chrome browser extension.
Actual Behavior
Always returns "Browser extension is not connected" regardless of native host state.
Additional Context
The user had Claude Desktop previously installed. Even after complete removal of Claude Desktop and all its native messaging artifacts, the connection cannot be established. This suggests the issue may be in how the MCP tool discovers or authenticates the socket connection, not in the native host setup itself.
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗