Claude in Chrome browser extension not connecting to Claude Code CLI
Environment:
- Claude Code version: 2.1.17
- macOS: Darwin 25.2.0
- Chrome extension version: 1.0.40 (installed in Profile 31)
Description:
The Claude in Chrome browser extension works correctly on its own (side panel functions properly), but Claude Code CLI
cannot connect to it to control the browser.
Steps to reproduce:
- Install Claude in Chrome extension (version 1.0.40)
- Run claude --chrome in terminal
- Call tabs_context_mcp tool
- Receive error: "Browser extension is not connected"
Troubleshooting attempted:
- Fully quit Chrome (Cmd+Q) and reopened
- Toggled extension OFF/ON in chrome://extensions/
- Opened Claude side panel (Cmd+E)
- Verified native messaging host exists and is configured correctly
Native messaging host configuration:
File: ~/Library/Application Support/Google/Chrome/NativeMessagingHosts/com.anthropic.claude_code_browser_extension.json
{
"name": "com.anthropic.claude_code_browser_extension",
"description": "Claude Code Browser Extension Native Host",
"path": "/Users/dhanapale/.claude/chrome/chrome-native-host",
"type": "stdio",
"allowed_origins": [
"chrome-extension://fcoeoabgfenejglbffodgkkbkcdhcgfn/"
]
}
Native host script:
#!/bin/sh
exec "/Users/dhanapale/.local/share/claude/versions/2.1.17" --chrome-native-host
Expected behavior:
Claude Code CLI should connect to the browser extension and be able to control Chrome tabs.
Actual behavior:
tabs_context_mcp always returns "Browser extension is not connected" even though:
- The extension is installed and functional
- The side panel works correctly
- Native messaging host files exist and are properly configured
- Chrome process shows --claude-in-chrome-mcp flag running
50 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
not connecting here...
Same issue here.
The connection page opens briefly then closes immediately.
I had same issue :
Solution applied by Claude Code and Explained !!
What happened:
automation
Desktop app instead of Claude Code CLI
The fix:
I updated com.anthropic.claude_browser_extension.json to point to Claude Code CLI's native host
path (~/.claude/chrome/chrome-native-host) instead of the Claude Desktop app path
(/Applications/Claude.app/...)
Note: If you reinstall or update Claude Desktop app, it may overwrite this config and you'll need
to update it again. To avoid this, you can either:
@E-ChintanGohil your solution worked. Here's the steps to fix for others:
Just to simplify for anthropic team: if calude desktop is installed after cc it will overwrite the correct chrome path causing cc not to connect to chrome.
Solution Verified ✅
I had the same issue and successfully resolved it using the solution mentioned by @E-ChintanGohil and @joemccann.
Root Cause
When Claude Desktop app is installed, it overwrites the native messaging host config to point to its own path instead of Claude Code CLI.
Before (broken):
After (working):
Quick Fix (macOS)
After Fix
claude --chromeand test withtabs_context_mcpEnvironment
Hope this helps others facing the same issue! 🎉
yes fixed thx
Additional Debugging Step
If you've already applied the fix from @joemccann and @E-ChintanGohil (updating the native messaging host config) but it's still not working, check for a stale native host process with a deleted socket.
Symptoms
claude mcp listshowsclaude-in-chrome · connectedDiagnosis
Fix
This happens when the socket file gets deleted but the native host process keeps running, leaving Chrome connected to a socket that Claude Code can't find.
Same issue here, above fixes didn't help. A report generated by Claude Code after trying to debug:
Bug Report: Claude for Chrome MCP tools return "Browser extension is not connected" despite everything being correctly configured
Environment
Symptoms
Verified Working Components
chrome.exe running (multiple processes)
Registry: HKCU\Software\Google\Chrome\NativeMessagingHosts\com.anthropic.claude_code_browser_extension
Points to: C:\Users\*****\AppData\Roaming\Claude Code\ChromeNativeHost\com.anthropic.claude_code_browser_extension.json
{
"name": "com.anthropic.claude_code_browser_extension",
"description": "Claude Code Browser Extension Native Host",
"path": "C:\\Users\\*****\\.claude\\chrome\\chrome-native-host.bat",
"type": "stdio",
"allowed_origins": [
"chrome-extension://fcoeoabgfenejglbffodgkkbkcdhcgfn/"
]
}
@echo off
REM Chrome native host wrapper script
REM Generated by Claude Code - do not edit manually
"C:\Program Files\nodejs\node.exe" "C:\Users\hunte\AppData\Roaming\npm\node_modules\@anthropic-ai\claude-code\cli.js" --chrome-native-host
PID 9200 : "C:\Program Files\nodejs\node.exe" "...\cli.js" --chrome-native-host
\\.\pipe\claude-mcp-browser-bridge-hunte
PowerShell can connect to this pipe successfully:
$pipe = New-Object System.IO.Pipes.NamedPipeClientStream(".", "claude-mcp-browser-bridge-hunte", [System.IO.Pipes.PipeDirection]::InOut)
$pipe.Connect(1000) # SUCCESS
PID 16096 : "...\cli.js" --claude-in-chrome-mcp
Debugging Steps Attempted, Multiple Times, In Various Orders (all failed to resolve)
Key Observation
The disconnect appears to be between:
The native host, named pipe, and MCP client all appear to be running correctly. The Chrome extension works fine when used directly in the browser. But the bridge between Claude Code's MCP tools and the native host is broken.
Process List When Issue Occurs
PID 9200 : cli.js --chrome-native-host (Native host - spawned by Chrome)
PID 16096 : cli.js --claude-in-chrome-mcp (MCP client)
PID 13228 : cli.js (Claude Code session 1)
PID 25944 : cli.js (Claude Code session 2)
For me, the native host works when run manually - creates pipe \\.\pipe\claude-mcp-browser-bridge-bleak and listens for connections. All config verified correct (registry, JSON manifest, batch file).
But Chrome never spawns it. Extension (v1.0.40) works fine in browser (sidebar, etc.) but never initiates the native messaging connection.
Claude's conclusion is that the extension never calls chrome.runtime.connectNative(). Something in the extension's connection trigger is broken or missing.
---
Update 2026-01-27. Further analysis by Claude:
What works (tested manually)
What fails
When Chrome spawns the native host (via connectNative()):
Implication
The native host code is fine. The failure is somewhere in the Chrome → native host initialization path. Either:
@alexbleakley @HunterJayPerson as bizarre as this might sound, i have fixed by downloading Claude Desktop, forcing the conflict reported in the other responses and applying the workaround.
Thanks, @gabrielmonteiro-vtexads. I was desperate enough to give the Claude Desktop trick a go, but sadly it didn't resolve anything for me.
@gabrielmonteiro-vtexads Also didn't work for me, thanks anyway though.
I downgraded to Claude Code 2.1.19 and that solved the problem! Recommend avoiding Claude Code 2.1.20 if you are on Windows and using Claude for Chrome.
Thanks, @HunterJayPerson! I had tried this previously but I think I was at that time running into #16691.
The combination of the bun workaround I posted in #16691, installing claude 2.1.19 with npm, and running claude from
...\AppData\Roaming\npm\claudeworked for me. But I spent a while debugging so I can't rule out that something else I did along the way was also necessary.@alexbleakley @HunterJayPerson rolling it back worked for me too, also on windows
Still broken in
2.1.23but working in2.1.19, tried the json/path patch mentioned in https://github.com/anthropics/claude-code/issues/20298#issuecomment-3796542141 and restarting everything of course.On my machine, I had switched to _claude native installer_ so couldn't use
npm uninstall -g @anthropic-ai/claude-codeandnpm install -g @anthropic-ai/claude-code@2.1.19to downgrade,claude --versionalways returned2.1.23Reverted with
claude install 2.1.19and chrome integration started working straight away with no other restarts required@agrath did like you
claude install 2.1.19and it worked right away after that. I have been uninstalling browsers, and extensions and reinstalled claude with no success. But 2.1.19 worked right away. Thanks!I'm having similar issues. A new Claude CLI session would connect to chrome, load a page, but then it'd get stuck with something (maybe it forgot to start the api or something). After fixing the issue it would try to load the page (tab_context) again and find it was disconnected. Restarting chrome and claude sessions did nothing. Running /chrome -> Reconnect did not fix it either.
I just managed to fix it while in session by running the following (in Claude Code CLI session):
I don't know why this worked and the
/chromeversion didn't. I don't know if this actually fixed things or it was a coincidence 🤷 It remained working for the rest of the session.Anyway, running Claude Code 2.1.23
Appreciate the previous comments. I fixed my issue by downgrading to 2.1.19
same issue here:
macOS, Mac mini,
Claude Code v2.1.25, extension v1.0.41
Subscribing for updates
Upgrading to the latest version fixed it for me. 2.1.29
Win11 user
Upgrading to the latest version now works for me. 2.1.29same issue
I had even removed Claude Desktop before
/mcp fine
/chrome fine
but can't connectet it from Claude Code
Confirmed the issue is fixed in 2.1.29 on my side, Win 11.
And back to not working in 2.1.31 for me, and reverting to 2.1.29 didn't fix it, but going all the way back to 2.1.19 did. I'm not sure what the actual underlying behaviour is, but this is what I noticed on the surface. Back to working on 2.1.19.
i rolled back to 2.1.19. no luck for me
For me (Mac) 2.1.31 is working partially:
seems like a big bug for windows users, why is this not resolved?
Having the same issue on Windows in Powershell 7. Tried fixes listed here and doesn't seem to work.
THe issue persists.
I'm having the same issue:
CC: 2.1.39
MacOS: 26.2
Chrome: 144.0.7559.133
Accessing the claude in chrome extension via claude code was just working for me a few days ago when I first tried it out but stopped working yesterday. Accessing the extension from Claude Desktop still works though.
Keep getting this:
CC: 2.1.39
MacOS: 26.2
Chrome: 145.0.7632.46
Fix: disable cloud bridge, use local socket
The root cause of the
"Browser extension is not connected"/"Invalid token or user mismatch"error is a GrowthBook feature flag that forces the MCP server to use a cloud WebSocket bridge (wss://bridge.claudeusercontent.com) instead of the local Unix socket.Quick fix — edit
~/.claude.jsonand set:Then restart:
claude --chromeThis bypasses the cloud bridge OAuth entirely and connects directly via the local socket. Full technical explanation here: https://github.com/anthropics/claude-code/issues/24593#issuecomment-3902208001
@Nachx639 Thanks, that fixed it for me!
Fixed for me too, thanks @Nachx639
@Nachx639 thx brother!
@Nachx639 thanks! this works now
Wow you are great thank you!
Fix by @Nachx639 fixed issue on Mac OS X
Also experiencing this issue. Adding my environment details:
fcoeoabgfenejglbffodgkkbkcdhcgfnVerified working:
nativeMessagingpermission, Service Worker shows no errorsStill fails: All
mcp__claude-in-chrome__*tool calls return "Browser extension is not connected"(Closed my duplicate #31971)
macOS: Claude Code v2.1.72 MCP client never connects to native host socket
Environment
Root cause analysis
After applying the native messaging host fix from this thread (pointing com.anthropic.claude_browser_extension.json to ~/.claude/chrome/chrome-native-host), the native host spawns correctly and creates a Unix socket:
The native host (PID 52687) is listening and accepting connections:
But the Claude Code main process (PID 52749) never connects to it:
The MCP server is registered (tools like mcp__claude-in-chrome__tabs_context_mcp are callable), but every call returns "Browser extension is not connected." The MCP client within Claude Code never opens a connection to the bridge socket — the tool responses are coming from the MCP server stub, not from the extension.
What was tried
Summary
The native messaging host fix from this thread resolves the host side (socket is created and listening), but the MCP client inside Claude Code v2.1.72 never attempts to connect to it. lsof confirms zero chrome/browser-related file handles on the Claude Code process. This appears to be a regression in the MCP client connection logic.
If you are still hitting "not connected" on recent versions: check if
tengu_copper_bridgeis enabled for your account. It forces WebSocket bridge over local sockets with no fallback. Workaround in PR #34789 (patch + hashes for cli.js v2.1.76).If still hitting "Browser extension is not connected" on v2.1.76+: the
tengu_copper_bridgeserver-side feature flag forces WebSocket bridge over working local sockets with no fallback. Workaround patch in PR #34789.Same issue, Chrome access works via the desktop app for me, but Claude Code can't connect.
Found a Reddit thread detailing the same issue: https://www.reddit.com/r/ClaudeAI/comments/1qdm0ei/claude_code_chrome_extension_not_connecting_tried/
macOS Sonoma, Claude in Chrome (beta), both accounts show jesse@naraepartners.com, connection never worked
Mac OS Tahoe 26.2, Claude 2.1.92, Chrome extension 1.0.66
I’m seeing the same failure on macOS with a current setup.
Environment:
~/.local/share/claude/versions/2.1.112)Observed behavior:
claude --chromestarts and/mcpshows the built-inclaude-in-chromeMCP as connected.tabs_contextstill returnsBrowser extension is not connected.https://clau.de/chrome/reconnectwhileclaude --chromeis running starts the native host, but the MCP tool still fails with the same error.Local diagnostics:
~/Library/Application Support/Google/Chrome/NativeMessagingHosts/com.anthropic.claude_code_browser_extension.json.~/.claude/chrome/chrome-native-host.~/.local/share/claude/versions/2.1.112 --chrome-native-host.com.anthropic.claude_browser_extension.json.bak.pongforpingand creates/tmp/claude-mcp-browser-bridge-$USER/<pid>.sock.~/.claude.jsonalso has no storedchromeExtensionpairing record after reconnect.I also temporarily tested 2.1.110 by pointing the wrapper at that installed version and got the same
Browser extension is not connectedresult, then restored the wrapper to 2.1.112.This looks like the extension/native-host launch path is working, but the Claude Code pairing/bridge layer never completes.
Environment
Symptoms
~/.config/google-chrome/NativeMessagingHosts/com.anthropic.claude_code_browser_extension.jsonis correctly formattedclaude --chromeand Chrome starts, the native host process is spawned (a--chrome-native-hostprocess is visible inps)/tmp/claude-mcp-browser-bridge-<user>/<pid>.socklsof -Ushows the native host is LISTENING on the socket, but no extension client ever connects to itclaude-in-chrometool consistently returns "Browser extension is not connected"Steps already tried
pkill -f chrome, verified no remaining processes)/chrome→ aclaude.aitab briefly opens then closes (OAuth handshake appears to succeed)claude.aiin Chrome with the same email as the Claude Code accountallowed_originsmatches the extension ID exactlyAdditional context
This appears to be the same issue as #20298 (originally reported on macOS). The pattern is identical on Linux: native messaging infrastructure is set up correctly on the OS side, the socket is created and listening, but the extension never establishes a connection through it. The service worker shows no activity at all when Claude Code attempts to invoke browser tools, suggesting the extension is not even being notified of the incoming connection request.