Chrome MCP socket path exceeds Unix socket limit on macOS
Resolved 💬 4 comments Opened Jan 12, 2026 by NOGIT007 Closed Feb 28, 2026
Bug Description
The Chrome native host fails to create a Unix socket because the generated path exceeds the macOS socket path limit of 104 characters.
Error
[Claude Chrome Native Host] Creating socket listener: /var/folders/lj/2d1lbtpn09dcd3t1tfx7pkt40000gn/T/com.apple.shortcuts.mac-helper/claude-mcp-browser-bridge-kennetkusk
error: Failed to listen at /var/folders/lj/2d1lbtpn09dcd3t1tfx7pkt40000gn/T/com.apple.shortcuts.mac-helper/claude-mcp-browser-bridge-kennetkusk
When tested with Node.js directly:
Failed: listen EINVAL: invalid argument /var/folders/lj/.../claude-mcp-browser-bridge-kennetkusk
Root Cause
The socket path is 116 characters, but macOS Unix sockets have a maximum path length of 104 characters (from sun_path in sockaddr_un).
Path breakdown:
/var/folders/lj/2d1lbtpn09dcd3t1tfx7pkt40000gn/T/(52 chars) - macOS TMPDIRcom.apple.shortcuts.mac-helper/(31 chars) - subdirectoryclaude-mcp-browser-bridge-(25 chars) - socket prefixkennetkusk(10 chars) - username- Total: 116 characters
Reproduction Steps
- Install Claude Code 2.1.5
- Install Claude Chrome extension
- Configure native messaging host
- Try to use Chrome MCP tools
- Connection fails with "Browser extension is not connected"
Verification:
# This succeeds (shorter path):
node -e "require('net').createServer().listen('/tmp/test-socket', () => console.log('ok'))"
# This fails (exact Claude path):
node -e "require('net').createServer().listen('/var/folders/.../claude-mcp-browser-bridge-username', () => console.log('ok'))"
# Error: EINVAL
Environment
- Claude Code version: 2.1.5
- OS: macOS (Darwin 25.2.0, arm64)
- Chrome extension: Claude for Chrome (Beta) v1.0.36
- Bun: 1.3.5
Suggested Fix
Use a shorter socket path, for example:
/tmp/claude-browser-{short-hash}.sock(~35 chars)- Or use
$HOME/.claude/browser.sock(~40 chars)
This would stay well under the 104 character limit regardless of username length or TMPDIR path.
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗