Claude in Chrome: orphaned Unix socket prevents reconnection on macOS
Bug Report: Claude in Chrome Extension - Orphaned Socket on macOS
Environment
- OS: macOS Darwin 25.2.0
- Claude Code Version: 2.1.42
- Chrome Version: 144.0.7559.133
- Extension: Claude in Chrome (fcoeoabgfenejglbffodgkkbkcdhcgfn)
Issue
After restarting the computer or Chrome, the chrome-native-host process dies but its Unix socket file remains in /tmp/claude-mcp-browser-bridge-<username>/. When Chrome respawns the native host, it creates a new socket with a new PID, but the MCP server (--claude-in-chrome-mcp) fails to discover and connect to it, returning "No Chrome extension connected" indefinitely.
Additionally, old --claude-in-chrome-mcp processes from previous Claude Code sessions accumulate (found 6 running simultaneously), potentially causing connection conflicts.
Root Cause
- Orphaned socket files: When
chrome-native-host(e.g., PID 7455) dies,/tmp/claude-mcp-browser-bridge-<user>/7455.sockis not cleaned up - MCP server doesn't re-scan: The MCP server doesn't dynamically discover new sockets after initialization
- Multiple MCP servers: Previous sessions leave
--claude-in-chrome-mcpprocesses running, causing potential conflicts
Steps to Reproduce
- Have Claude Code + Chrome extension working normally
- Restart the computer (or kill Chrome)
- Reopen Chrome and Claude Code
- Run any
mcp__claude-in-chrome__*tool - Observe "No Chrome extension connected" error indefinitely
Workaround
# 1. Kill old MCP server processes (keep only current session)
ps aux | grep "claude-in-chrome-mcp" | grep -v grep
kill <old PIDs>
# 2. Kill native host and clean orphaned sockets
kill $(pgrep -f chrome-native-host)
rm /tmp/claude-mcp-browser-bridge-<username>/*.sock
# 3. Trigger Chrome to respawn native host (click extension icon in Chrome)
# 4. Restart MCP server (run /chrome in Claude Code)
Expected Behavior
- Old socket files should be cleaned up automatically when the native host dies
- The MCP server should periodically re-scan for new sockets or handle stale socket detection
- Old
--claude-in-chrome-mcpprocesses should be cleaned up when their parent Claude Code session ends
Diagnostics
# Check native host
ps aux | grep "chrome-native-host" | grep -v grep
# Check socket
ls -la /tmp/claude-mcp-browser-bridge-<username>/
# Check MCP servers (should be only 1)
ps aux | grep "claude-in-chrome-mcp" | grep -v grep | wc -l
Related Issues
- #23218 - Similar connection issue on Windows (named pipe discovery bug)
- #23828 - Windows named pipe fix
This is the macOS equivalent - the socket exists and the native host is running, but the MCP server cannot connect due to stale state.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗