Let AI agents drive the browser tabs you already have open, by element reference, over MCP, a CLI, or Python.
pip install agent-browser-bridge Copy PIP instructions
Let an AI agent drive the Microsoft Edge window you already have open, on the active tab on your screen. On Windows the same daemon also drives the desktop itself: screenshots, mouse and keyboard for the dialogs and native apps a browser extension cannot reach.
Automating a clean browser profile drops existing cookies and auth state. Agent Browser Bridge attaches to your running browser instead, keeping active logins and extensions available while sending trusted Chrome DevTools Protocol events directly to the page.
A single background daemon provides the MCP server, CLI, and Python library.
Tested on Microsoft Edge. The extension uses standard MV3 and speaks CDP, so other Chromium browsers may work, but Edge is the only tested target.
pip install agent-browser-bridge Python 3.10 or newer, with no third-party packages at install time or runtime. The optional desktop extra adds Pillow for the Windows desktop half (pip install "agent-browser-bridge[desktop]").
When agent-bridge isn't recognized after install (Python's Scripts folder isn't on your PATH), run commands with py -m:
py -m agent_browser_bridge daemon start py -m agent_browser_bridge setup To add Scripts to your user PATH automatically, run py -m agent_browser_bridge setup --fix-path and reopen your terminal. If you're using pipx, run pipx ensurepath. To check launcher and environment health, run py -m agent_browser_bridge doctor.
Then install the companion extension directly from the Microsoft Edge Add-ons store (Agent Browser Bridge) or the Chrome Web Store, or load the extension from the local folder while developing:
agent-bridge extension open # opens the bundled extension directory Turn on Developer mode at edge://extensions, select the opened extension folder, and pick that directory. Start the daemon and verify Edge connected:
agent-bridge daemon start agent-bridge daemon status Daemon: running on 127.0.0.1:18999 (PID 24188) Extension: 2.6.1 (connected) CLI commands and Python's with Edge() start the daemon on first use if it isn't running, but daemon start brings the extension online right away.
pip install -U edge-agent-bridge moves an existing install over: it installs agent-browser-bridge and leaves a small compatibility shim so edge-bridge, edge, python -m edge_agent_bridge and from edge_agent_bridge import Edge keep working. From then on, upgrade with pip install -U agent-browser-bridge. Nothing else changes: same port, same data directory, same MCP server key and tool names, and the store extension updates in place under its new name.
agent-bridge setup That detects the MCP clients on your machine and registers the server with each one. Claude Code, Cursor, Windsurf, Gemini CLI, Codex CLI and VS Code are covered. JSON config files are backed up before they're touched, and a file that doesn't parse is left alone and reported.
agent-bridge mcp-config --client claude agent-bridge mcp-config --client cursor The server speaks stdio JSON-RPC and exposes 34 tools, all prefixed edge_ so they don't collide with Playwright MCP in a mixed setup. docs/agent-guide.md is written for the agent rather than for you: snapshot first, act by ref, re-snapshot after navigation.
The agent reads the page as a tree of roles, names and current values, each interactive node carrying a short id:
$ agent-bridge snapshot tab 1459 "Files - Example App" http://localhost:8080/files page "Files - Example App" url=http://localhost:8080/files - heading "Files" level=1 - textbox "Search" [e1] value="" - button "Upload" [e2] - file "Choose file" [e3] hidden - table "Files" - row "12080 spec.pdf 2026-09-01" [e4] - button "Open" [e5] Every action that takes a target accepts one of those refs, so click e5 hits the button that was actually named in the tree. A ref that no longer resolves returns stale_ref, and a ref from a snapshot taken before the last navigation returns stale_snapshot. Neither one silently clicks something else, which is the failure mode that makes text matching unusable on dense pages.
Values come back too, which is what makes "fill in the rest of this form" work: the agent can see which fields you already filled. Passwords are masked. Hidden input[type=file] nodes are listed anyway and tagged hidden, because upload buttons almost always hide the real input. Inside an iframe a ref carries its frame, as in f31e1, including cross-origin frames.
from agent_browser_bridge import Edge with Edge() as browser: snap = browser.snapshot() print(snap["text"]) browser.fill("e1", "spec") browser.click("e5") browser.wait(text="Opened") print(browser.console()) The daemon starts on first use. Edge pins itself to the tab of its first result, so a later call can't drift onto a different tab because you switched windows in the meantime. Bare CLI commands share one daemon-side pin instead: switch and new set it, tab-less commands keep acting on that tab, and --tab stays a one-shot override; several agents at once still need one session each. Methods return the raw result dict and never raise on a failed action: check success, read code and error.
Each CLI call pays roughly 600 ms of Python startup. For anything repetitive use MCP, the Python API, or run (one process for a whole step file).
pip install "agent-browser-bridge[desktop]" The daemon drives the Windows desktop through the same token and port as the browser. An agent takes a screenshot, reads it, acts with coordinates read off that image, then takes another screenshot to confirm. OS file dialogs, installers, native applications and pages the extension cannot attach to all become reachable.
While a desktop action runs, a small strip in the top-right corner of the primary display says so. It never takes focus and stays out of screenshots on Windows 10 2004 and later; EDGE_BRIDGE_NO_OVERLAY=1 turns it off. desktop notify puts an agent's own short notice there.
desktop record watches you instead of the agent: it keeps your clicks and keys, a screenshot per click, and on stop writes a SKILL.md of numbered steps with the images, which an agent can follow later with the same tools. The strip turns red for the whole recording and refuses to start without the strip. The bridge's own injected input is left out, so an agent can keep working while you demonstrate. Text composed through an IME never reaches a keyboard hook, so Japanese or Chinese input is not captured; the recorder stops itself after 2000 events or 30 minutes.
Coordinates are view pixels: the pixel space of the last shot of that display, which is scaled down to a 1280 long edge by default. The daemon scales them back up; never convert yourself. A point outside the view is refused, not clamped. Every shot result carries space (view, display, or region); a region shot is a crop with its own origin and says not to click from it. Pass --space display to use real display pixels. Each display has its own view starting at 0,0; --monitor all captures every display as one wide image for finding things, then capture the one display before clicking.
Windows only: elsewhere every desktop action answers desktop_unsupported, and without Pillow desktop_unavailable. Start the daemon from your own shell: one started by a scheduled task or a service cannot move the cursor, and an elevated one cannot pair with Edge, though it still drives unelevated desktop apps. agent-bridge doctor reports both halves.
The trust boundary is your OS user account. Anything running as you can already read your files and your browser profile, so the daemon doesn't try to defend against it.
desktop record installs keyboard and mouse hooks for as long as it runs, so everything you type, passwords included, lands in events.jsonl and, as Type "..." steps, in SKILL.md in your data directory. It starts only on an explicit record start, the red strip stays up until record stop (an agent's notices appear inside that red strip), and nothing is uploaded. Scrub the skill before sharing it and delete the folder when it has served its purpose.
eval runs arbitrary JavaScript in the page with your session. It's there on purpose, and it's the reason to think about which agent you hand this to. Actions that destroy state need an explicit tab id: tab_close without one is an error rather than a guess.
The extension asks for debugger, which is what makes input trusted and screenshots possible. While it is attached, Edge shows its "is debugging this browser" bar under a Chromium policy no extension can dismiss.
Against live Edge tabs, from tests/e2e/test_benchmark.py. These are one machine's numbers; the timings move with the host, so the suite treats them as advisory and gates on the correctness assertions instead. EDGE_BRIDGE_BENCH_STRICT=1 makes the timings gate too.
python -m pytest tests/e2e/test_benchmark.py -q -s Development python -m pytest -q -m "not e2e" # hermetic, no browser needed python -m pytest -q -m e2e # drives a real Edge python scripts/build_extension.py # syncs the manifest version, zips to dist/ The hermetic suite runs a real daemon against a fake extension over a real WebSocket, so it covers the wire protocol without Edge installed. CI runs it on Windows, Linux and macOS and the E2E suite against a real Edge on Windows; releases are automated, see docs/release.md.
Built by Shanewas Ahmed. If it saves you time, sponsorship funds keeping the CDP handlers current with Chromium releases:
All 2 files in this release have provenance metadata.
edge chrome browser-automation agent cdp websocket ai-agents real-time mcp desktop computer-use screenshot
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.
All 2 files in this release have been uploaded with provenance metadata.
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.




