Diagnose and fix Claude in Chrome MCP extension connectivity issues. This plugin provides systematic troubleshooting for browser automation failures, focusing on the primary conflict between Claude.app (Cowork) and Claude Code native messaging hosts.
When Claude.app added Cowork support (browser automation from the desktop app), it introduced a competing native messaging host that conflicts with Claude Code CLI.
Add this to ~/.zshrc to easily switch between Claude.app and Claude Code:
chrome-mcp-toggle() { local CONFIG_DIR=~/Library/Application\ Support/Google/Chrome/NativeMessagingHosts local CLAUDE_APP="$CONFIG_DIR/com.anthropic.claude_browser_extension.json" local CLAUDE_CODE="$CONFIG_DIR/com.anthropic.claude_code_browser_extension.json" if [[ -f "$CLAUDE_APP" && ! -f "$CLAUDE_APP.disabled" ]]; then # Currently using Claude.app, switch to Claude Code mv "$CLAUDE_APP" "$CLAUDE_APP.disabled" [[ -f "$CLAUDE_CODE.disabled" ]] && mv "$CLAUDE_CODE.disabled" "$CLAUDE_CODE" echo "Switched to Claude Code CLI" echo "Restart Chrome and Claude Code to apply" elif [[ -f "$CLAUDE_CODE" && ! -f "$CLAUDE_CODE.disabled" ]]; then # Currently using Claude Code, switch to Claude.app mv "$CLAUDE_CODE" "$CLAUDE_CODE.disabled" [[ -f "$CLAUDE_APP.disabled" ]] && mv "$CLAUDE_APP.disabled" "$CLAUDE_APP" echo "Switched to Claude.app (Cowork)" echo "Restart Chrome to apply" else echo "Current state unclear. Check configs:" ls -la "$CONFIG_DIR"/com.anthropic*.json* 2>/dev/null fi}
Usage: chrome-mcp-toggle then restart Chrome (and Claude Code if switching to CLI).
# 1. Which native host binary is running?ps aux | grep chrome-native-host | grep -v grep# Claude.app: /Applications/Claude.app/Contents/Helpers/chrome-native-host# Claude Code: ~/.local/share/claude/versions/X.X.X --chrome-native-host# 2. Where is the socket? (Claude Code)ls -la "$(getconf DARWIN_USER_TEMP_DIR)/claude-mcp-browser-bridge-$USER" 2>&1# 2. Where is the socket? (Claude.app)ls -la /tmp/claude-mcp-browser-bridge-$USER/ 2>&1# 3. What's the native host connected to?lsof -U 2>&1 | grep claude-mcp-browser-bridge# 4. Which configs are active?ls ~/Library/Application\ Support/Google/Chrome/NativeMessagingHosts/com.anthropic*.json
Critical Insight: MCP connects at startup. If the browser bridge wasn’t ready when Claude Code started, the connection will fail for the entire session. The fix is usually: ensure Chrome + extension are running with correct config, THEN restart Claude Code.
If you have the Claude extension installed in multiple Chrome profiles, each spawns its own native host and socket, causing confusion.Fix: Only enable the Claude extension in ONE Chrome profile.
Multiple Claude Code Sessions
Running multiple Claude Code instances can cause socket conflicts.Fix: Only run one Claude Code session at a time, or use /mcp to reconnect after closing other sessions.
Hardcoded Version in Wrapper
The wrapper at ~/.claude/chrome/chrome-native-host may have a hardcoded version that becomes stale after updates.Diagnosis: