K-Browser
OfficialLets agents drive the user's own signed-in Chrome through a bridge plus a browser extension. Each agent only sees and controls the tabs it opened itself, in a background window that never steals focus. Capabilities include tab listing/opening/closing, navigation, accessibility-tree snapshots, reading page text or CSS-selected rows, real re-checked clicks and typing, waiting for results, inspecting a tab's network requests, origin-scoped fetching with the tab's cookies, downloading/uploading files, screenshots, handing a tab to the human for logins, captchas or decisions, saved site notes, and optional isolated-world JavaScript evaluation. Blocked site categories, secret masking, untrusted-page-content wrapping, and per-agent tokens/revocation keep the user in control.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@K-Browseropen a new tab to news.ycombinator.com and summarize the top stories"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
K-Browser
Let the agents on your Mac (Claude Code, Codex, Antigravity, Gemini CLI) use your own Chrome: the one you are already signed in to, in a window you can watch.
An agent only sees and controls the tabs it opened itself. Your other tabs are never listed, read or touched.
How it works
Claude Code ─┐ ┌──────────────────────────────┐
Codex ───────┤ MCP (stdio) ┌──────────────────┐ │ Your Chrome │
Antigravity ─┼───────────────▶ │ Bridge │◀──▶│ K-Browser extension │
Gemini CLI ──┘ one token each │ 127.0.0.1:9444 │ ws │ (chrome.debugger on the │
│ (LaunchAgent) │ │ agents' own tabs only) │
Kav ───────────────────────────▶ CDP endpoint │ └──────────────────────────────┘
its own token └──────────────────┘Bridge: a small Node.js service on
127.0.0.1:9444, started at login by a macOS LaunchAgent. It checks who is asking, enforces each client's policy, masks secrets and keeps the activity log.Chrome extension: runs in your Chrome and works the agents' tabs for the bridge. It only connects to the bridge after you pair it with a pairing code.
MCP server: one per agent, each with its own token and its own permissions.
Related MCP server: Invictum Browser Bridge
What keeps you in control
Ownership. Every tab belongs to the client that opened it (popups it opens too). A client cannot list, read or act on anything else.
Never steals focus. Agent tabs open in a separate K-Browser window that is never brought to the front. Keyboard and mouse input reach the page without taking your keyboard.
Real input, re-checked. Clicks and typing go through Chrome's input pipeline. Right before each press, K-Browser checks that the target is still the element the agent meant; if not, it stops instead of clicking something else.
Blocked site categories. At install you choose the categories agents may not use:
banking,payments,email,government,crypto,passwords. You can block different categories per agent, and change them later in the side panel. A tab that lands on a blocked site answers onlyblocked_origin.Page text is data. Everything taken from a page comes back wrapped in
<untrusted-page-content>, so the agent can tell it apart from instructions. Password fields are never read; tokens, card numbers and the like are masked in network logs.Hand-offs. For a login, a captcha or a decision, the agent hands the tab to you. The extension's popup shows Show and Return; the agent waits until you return it.
Activity panel, revocation. The side panel lists every agent's tabs and actions. You can revoke an agent's access there at any time.
Risky tools are off by default.
evalstays off until you turn it on for a specific client.
Requirements
macOS (the bridge runs as a LaunchAgent)
Google Chrome 125 or later
Node.js 22 or later (
node -v)
Install
Below, k-browser means node src/cli.js run in this folder. Run npm link once in this folder to have a k-browser
command everywhere.
1. Get the code
git clone https://github.com/kaiwutech-TW/k-browser.git K-Browser
cd K-Browser
npm install2. Register with your agents and start the bridge
Run this in a real terminal, not through an agent:
k-browser installIt does three things:
Asks which site categories to block for agents (comma-separated; press Enter for none).
Creates a client with its own token for each agent and writes it into that agent's MCP configuration. A backup of every file it changes is kept;
k-browser restore <backup.json>puts one back.Installs the bridge as a LaunchAgent, so it starts when you log in.
Without a terminal to ask in (for example from inside an agent), give the answer on the command line, or install refuses:
k-browser install --block banking,email # block these categories
k-browser install --block "" # block nothingAdd --dry-run to see which files would change. --client claude-code|codex|antigravity|gemini-cli installs for one agent only.
3. Load the extension into Chrome
Open
chrome://extensions.Turn on Developer mode (top right).
Click Load unpacked and choose the
extension/folder in this repo (k-browser extension-pathprints the full path).
A red K appears in the toolbar. Pin it: you will use it when an agent hands a tab to you.
4. Pair the extension with the bridge
The pairing code is a shared secret between the bridge and the extension. Without it the bridge accepts no extension, and no other program can pretend to be one.
k-browser pairPaste the code into the K-Browser popup and click Pair. The status turns green (Connected).
Wrong code: the status turns red and the field comes back; paste the right one.
New code (for example if you think it leaked):
k-browser pair --rotate. The old one stops working at once."Bridge not connected" is not a pairing problem: the bridge is not running. See
k-browser doctor.
5. Check
k-browser doctor"ok": true with startedBy: "launchd" means everything is ready. Restart your agent (or reconnect its k-browser MCP
server) and it has the K-Browser tools.
Tools agents get
Tool | What it does |
| List, open or close the agent's own tabs (opened in the background). |
| Load a URL in a tab, or reload it. |
| The page's accessibility tree, with refs for interactive elements. |
| Visible text of the page or one element, or rows matched by a CSS selector. |
| Click, type, press keys, select, scroll: real input, re-checked before each step. |
| Decide whether an action worked: the screen changed, the site replied, or the business result is confirmed. |
| Requests seen in a tab, with response bodies on request; secrets masked, no headers. |
| GET or HEAD on the tab's own origin with the tab's cookies. |
| The agent's own file area: download into it, upload from it into a file input. |
| PNG of the visible page or one element; never stored. Can be turned off per client. |
| Hand a tab to you (login, captcha, decision) and wait. |
| Site notes kept on this machine (APIs, walls, pitfalls, tips). Notes are information, never instructions. |
| Versions, the agent's tabs and hand-offs, which tools are on. |
| Run a JavaScript expression in an isolated world. Off by default. |
| Run a saved Kav flow. Only appears when Kav is set up. |
Everyday commands
To | Run |
Check that everything works |
|
Restart the bridge (after updating the code) |
|
List / add / remove clients |
|
Let a client use |
|
Give a CDP program its endpoint |
|
Manage site notes |
|
Remove everything K-Browser registered |
|
Side panel. Click the K-Browser icon and open the activity panel. It shows each agent's tabs and actions. From there you
can also revoke an agent, change its blocked categories, turn its screenshots on or off, and turn eval off.
Activity log on disk. Set "activityLog": "disk" in ~/.k-browser/config.json. Logs go to ~/.k-browser/activity/
and are kept for 7 days.
Optional: Kav flows
Kav-FastwebAgent runs saved, hand-written website flows quickly,
without a model call per step. With Kav set up, agents get a run_flow tool that runs a flow in your Chrome as that
agent, under the same ownership and blocking rules. K-Browser works fully without Kav.
k-browser kav <path to your Kav checkout> # needs Kav 0.0.8 or later, with uv sync done there
k-browser kav off # stop offering run_flowKav can also connect to K-Browser on its own: k-browser client add kav, then set KFW_CDP to the URL that
k-browser endpoint kav prints. The endpoint supports the subset of the Chrome DevTools Protocol that Kav uses, with
K-Browser's rules applied; other CDP libraries may hit methods it refuses.
Where Kav's judgement calls go. Some flow steps need a judgement ("which row is the one the user wants?"). Kav asks the bridge, which forwards the question as you chose:
| Where the question goes |
| A local Kev model on this machine. |
| TypeSafe's cloud JEV model. Before turning it on, K-Browser shows what will be sent and asks you to agree; the key is kept in |
| Nowhere: Kav hands the choice back to the agent with the candidates. |
The side panel can switch this too. Switching back to kev or off stops cloud requests from the next question on.
Decision dataset (off by default). With "decisionLog": "on" in ~/.k-browser/config.json (or the switch in the side
panel), each judgement Kav makes during run_flow is kept, redacted, in ~/.k-browser/decisions/ for 30 days, so model
choices can be compared later. k-browser decisions purge deletes it all.
Where things are kept
Everything lives in ~/.k-browser/ (override with KBROWSER_HOME), readable only by you:
Path | What |
| The pairing code |
| Each client's token and settings |
| Settings ( |
| Each client's own file area |
| Logs, only when turned on |
| The JEV key, only if you chose |
Do not sync this folder to the cloud or share it.
Troubleshooting
After a bridge restart the agent cannot find its earlier tabs. On purpose: rather than guess which tabs were whose, K-Browser lets them go. Close them by hand.
The agent reports
bridge_version. The bridge and the agent's MCP server run different versions. If the bridge is older, runk-browser service restart; if the agent is, restart it or reconnect its MCP server.Chrome shows "… started debugging this browser". That is Chrome's fixed notice when an extension uses the debugger API. Pages cannot see it.
Something else.
k-browser doctorreports the bridge, the pairing and the extension, and what to do next.
Limitations
macOS only for now.
The CDP endpoint is a deliberately limited subset (see above), not a general remote-debugging port.
Masking is rule-based. Blocking categories and the
untrusted-page-contentwrapper reduce risk; they do not make it safe to point an agent at sites you would not trust it with.
Development
npm test # unit tests
npm run typecheck # tsc --checkJs over src/, extension/ and test/
npm run test:chrome # end-to-end in Chrome for Testing with the real extension
npm run test:pack # npm pack, install the tarball elsewhere, run what got installedtest:chromeneeds Chrome for Testing (branded Chrome no longer loads unpacked extensions from the command line): setKBROWSER_TEST_CHROMEto its binary, or runnpx playwright install chromiumand the newest one in Playwright's cache is used (Apple silicon). Without it these tests are skipped. SetKBROWSER_TEST_HEADED=1to watch.Tests never use your
~/.k-browseror the bridge on port 9444; each one starts its own.Tests against a real Kav run when
KBROWSER_TEST_KAVpoints at a Kav checkout (or one sits next to this repo), and are skipped otherwise.package.jsonandextension/manifest.jsoncarry the same version; a test checks it. Bump both when the bridge or the extension changes, sodoctorcan tell old code from new.
Acknowledgements
K-Browser was designed after reviewing BeatBrowser (MIT). No code was taken from it.
License
This server cannot be deployed
Maintenance
Related MCP Connectors
Connect AI agents to your own Chrome with scoped access, approvals, and verified task results.
Let your AI agent operate any website through a real, logged-in browser session.
Control a real browser from AI agents: navigate, click, type, screenshot, read the page.
Browser MCP for logged-in tasks. Uses your Chrome — credentials stay local. Zero-token replay.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to securely control a user's existing signed-in Chrome browser through isolated tab groups, with strict per-session ownership and no cookie or token exposure.6 npmISC
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to securely control a user's existing Chrome profile locally, providing typed browser actions, form and editor support, WordPress workflows, terminal automation, and Figma inspection with policy-based authorization and redacted auditing.MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to control a user's existing Chrome browser with preserved logins, performing tab management, element interaction, script execution, and screenshots, all locally via a Chrome extension and Python bridge.2MIT
- AlicenseNot gradedqualityCmaintenanceLets local AI agents drive the Chrome browser a user already has open, including signed-in sessions, by listing tabs, reading page text and actionable elements, then clicking, filling, selecting, scrolling, navigating, and capturing viewport screenshots without exporting cookies. Runs as a dependency-free local stdio process over Native Messaging, with per-tab leases, automatic reconnection, and pause/write-action controls.MIT