[BUG] claude-in-chrome: socket protocol endianness mismatch on Linux/WSL — "Invalid message length" on connect
Resolved 💬 3 comments Opened May 20, 2026 by yancodecraft Closed May 24, 2026
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
claude-in-chrome doesn't work on Linux/WSL2. The MCP client connects to the native host Unix socket but is immediately rejected due to an endianness mismatch in the message length framing. The extension always shows "Browser extension is not connected"
What Should Happen?
tabs_context_mcp (and all mcp__claude-in-chrome__* tools) should successfully connect to the Chrome extension running in Linux Chrome (WSLg) and return the list of open tabs.
Error Messages/Logs
Chrome stdout logs (captured via nohup google-chrome > /tmp/chrome.log 2>&1):
[Claude Chrome Native Host] Initializing...
[Claude Chrome Native Host] Creating socket listener: /tmp/claude-mcp-browser-bridge-<user>/<pid>.sock
[Claude Chrome Native Host] Socket server listening for connections
[Claude Chrome Native Host] Handling Chrome message type: ping
[Claude Chrome Native Host] Responding to ping
[Claude Chrome Native Host] Handling Chrome message type: get_status
[Claude Chrome Native Host] MCP client 1 connected. Total clients: 1
[Claude Chrome Native Host] Invalid message length from MCP client 1: 268435456
[Claude Chrome Native Host] MCP client 1 disconnected. Remaining clients: 0
Analysis: 268435456 = 0x10000000. A 16-byte message sent as little-endian (\x10\x00\x00\x00) read as big-endian yields exactly 0x10000000. This is an endianness mismatch in the Unix socket protocol between the Claude Code MCP client and the native host on Linux.
Steps to Reproduce
- Install Claude Code on WSL2 (Ubuntu 24.04)
- Launch Linux Chrome via WSLg: nohup google-chrome > /tmp/chrome.log 2>&1 &
- Install the Claude browser extension (fcoeoabgfenejglbffodgkkbkcdhcgfn), log in with the same account as Claude Code
- Verify native messaging host is configured: cat ~/.config/google-chrome/NativeMessagingHosts/com.anthropic.claude_code_browser_extension.json
- Start Claude Code: claude --dangerously-skip-permissions
- Call mcp__claude-in-chrome__tabs_context_mcp → returns Browser extension is not connected
- Check grep "Invalid\|MCP client" /tmp/chrome.log → see Invalid message length from MCP client 1: 268435456
Environment: Claude Code 2.1.145, Chrome 147.0.7727.101, Ubuntu 24.04 on WSL2/Windows 11
Claude Model
Sonnet (default)
Is this a regression?
No, this never worked
Last Working Version
_No response_
Claude Code Version
2.1.145
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
WSL (Windows Subsystem for Linux)
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗