BrowserAgent
OfficialProvides paste-ready Bitbucket Pipelines configurations for compiling and replaying BrowserEngine flows, with JSON/JUnit report outputs.
Provides paste-ready Forgejo CI configurations for compiling and replaying BrowserEngine flows, with JSON/JUnit report outputs.
Provides paste-ready GitHub Actions CI configurations for compiling and replaying BrowserEngine flows, with JSON/JUnit report outputs.
Provides paste-ready GitLab CI configurations for compiling and replaying BrowserEngine flows, with JSON/JUnit report outputs.
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., "@BrowserAgent Go to example.com and list all the links on the page."
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.
What it is
You can already ask an agent to click through a checkout. That works once. The next morning you want the same path on every commit, without paying for another model call, and without a test that dies the first time a designer changes a CSS id.
Today that usually means one of two dead ends:
Chat browsers (most MCP tools). The agent looks at the page, clicks, and talks to you. Tomorrow you run the agent again. Every replay spends tokens. The path lives in a transcript, not in CI.
Recorders (Playwright codegen, Selenium IDE, and friends). You get
#txt_visit_dateand.btn-primary. The next rename breaks the test. The log does not say "Login is gone." It says a selector missed. A person has to debug CSS.
BrowserEngine is the middle path.
The agent drives a real Chrome window and refers to controls the way a person would: "Username", "Login", "the Add to cart near Sauce Labs Backpack." Those visible names are what get saved, as ordinary JSON. CI then opens Chrome and follows the same names. No language model is in that run. No MCP session is required. The bill is the same as any other headless test.
When a step fails, CI gets a named report, not a dead CSS selector: step 2 click Login: two matches. --report writes JSON. --junit writes one testcase. This repo does not open tickets or push a heal. Everyone uses a different tracker and a different branch policy. Your next job (or an agent) reads the file and uses your tools.
That is what this repo is for: author with an agent, keep a file, replay without one, emit a report when it breaks. Headed while you watch, headless in CI. Same engine.
Modes
Mode | For | How |
Headed (default) | Authoring and demos | Visible Chrome, cursor HUD, paced typing |
Headless | CI and background |
|
Attach | Drive an already-running Chrome |
|
Extension | Drive your own browser profile |
|
MCP stdio | A live agent in this process |
|
MCP HTTP | A remote agent |
|
CLI compile | Check a flow file, no Chrome |
|
CLI run | Replay a flow |
|
CI report | Machine file for any host |
|
Pace, type delay, expect timeout, and the work-area snap are all env-configurable. See usage.
Extension mode skips the second browser entirely: an unpacked MV3 extension drives your signed-in browser profile over a native-messaging bridge, with a side-panel cockpit, origin allow-list, and a kill switch. While it drives, the controlled tab is grouped and badged and the page shows a control frame with the agent's cursor. Build it with npm run build:extension, then follow extension/README.md.
Related MCP server: mcp-browser-automation
Start
Requires Node.js >= 20.19.
git clone https://github.com/PremierStudio/BrowserEngine.git
cd BrowserEngine
npm install
npm run buildCheck the checked-in fixture (compile does not open Chrome). The JSON is a schema example. https://example.com/login is not a real form, so do not run this file against the network.
node dist/cli.js compile tests/fixtures/login.flow.jsonReplay your flow headless, and write a report:
$env:BROWSER_ENGINE_HEADED='0'
node dist/cli.js run flows/your.flow.json --report reports/flow.json --junit reports/flow.xmlA failure names the step (step 2 click: no target ...) and the same facts land in the report file. Paste-ready GitHub, GitLab, Forgejo, and Bitbucket jobs: CI.
Give an agent the same engine over MCP:
npm startPoint the client at node dist/cli.js. Prefer one run_flow over observe-per-page. Full tool list, desk controls, and env vars: usage.
Flows
Click and navigate must declare expectUrl or expectText. Type, hover, scroll, select, and press do not.
{
"version": 1,
"name": "login",
"origin": "https://example.com",
"steps": [
{
"action": "navigate",
"url": "https://example.com/login",
"expectText": "Username"
},
{ "action": "type", "name": "Username", "text": "tomsmith" },
{
"action": "click",
"name": "Login",
"role": "button",
"expectText": "Logout"
}
]
}Author with run_flow until every bind is unique, write the JSON (no uids), then compile / run in CI. Any host can fail the job on exit code 1. Pass --report / --junit for a machine file your next job (or an agent) can read. Paste-ready GitHub, GitLab, Forgejo, and Bitbucket jobs: CI.
Docs
Doc | What is in it |
MCP, desk/page/intent tools, env, public-site demos | |
npm package and MCP client setup | |
Side-panel cockpit, native host, origin allow-list | |
| |
Engine, clients, page model, what is not in this repo | |
| |
Settled engineering decisions |
Contributing
AGENTS.md and docs/engineering.md. Failing test first. No merge below 100% coverage and 100% mutation. TypeScript only.
License
Apache License 2.0 © Premier Studio. See LICENSE.
Available Tools
26 toolsbrowser_closeADestructive
Close this MCP Chrome and mark it closed in the registry.
Inputs: no named parameters.
browser_close_tabADestructive
Close a tab by id from browser_status. Refuses to close the last tab.
Inputs: id (required).
browser_new_tabBDestructive
Open a new tab. Pass url to navigate. Opens Chrome first if needed.
Inputs: url.
browser_openBDestructive
Open this MCP Chrome. Safe when already open.
Inputs: no named parameters.
browser_reapADestructive
Kill leftover Chrome whose MCP agent is gone.
Inputs: no named parameters.
browser_statusARead-only
List this MCP Chrome, peers, orphans, and closed instances. Does not open Chrome.
Inputs: no named parameters.
browser_switch_tabADestructive
Switch this MCP Chrome to the tab id from browser_status.
Inputs: id (required).
cancel_taskBDestructive
Cancel a working task (Tasks extension fallback).
Inputs: id (required).
clickCDestructive
Click the element identified by uid.
Inputs: uid (required).
compile_flowARead-only
Compile a run_flow against the live outline. Fills uids. A name must bind uniquely or this returns candidates. Does not act.
Inputs: steps (required), requireExpect.
confirm_actionCDestructive
Ask the user to confirm a potentially destructive action.
Inputs: message (required), responses, requestState.
explainBRead-only
Explain a uid, region, or diff with a summary and annotation.
Inputs: kind (required), x, y, uid, +3 more.
get_taskBRead-only
Get a task by id (Tasks extension fallback).
Inputs: id (required).
hoverBDestructive
Hover over the element identified by uid.
Inputs: uid (required).
list_callsARead-only
List recent MCP tool calls with durationMs and resultBytes.
Inputs: no named parameters.
list_tasksBRead-only
List every task in the store (Tasks extension fallback).
Inputs: no named parameters.
observeARead-only
Read the page. Prefer run_flow with name/role/near. detail=outline for labels, detail=full for a screenshot.
Inputs: detail.
pressCDestructive
Press a key on the page.
Inputs: key (required).
run_flowADestructive
Run a named sequence. Prefer name (role/near) over uid. A name must bind uniquely. Re-resolves after click/navigate. Optional expectUrl/expectText poll. Call once instead of observe-per-page.
Inputs: steps (required).
scrollBDestructive
Scroll by dx/dy within the element identified by uid.
Inputs: dx (required), dy (required), uid (required).
selectCDestructive
Select a value in the element identified by uid.
Inputs: uid (required), value (required).
typeBDestructive
Type text into the element identified by uid.
Inputs: uid (required), text (required).
verifyCRead-only
Assert a condition against the current snapshot and return evidence.
Inputs: kind (required), uid, expected.
wait_taskBRead-only
Block until a task reaches a terminal state or the timeout elapses.
Inputs: id (required), timeout (required).
watch_untilBDestructive
Poll the page until a condition matches or the timeout elapses.
Inputs: kind (required), value (required), timeout (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 26 tools
Each tool targets a distinct function: lifecycle, tabs, page interactions, flows, verification, and task management. Even similar operations like observe and watch_until differ in immediate read vs. polling. No overlapping purposes that would cause misselection.
Naming follows a mixed convention: browser_ prefix for lifecycle/tab tools, single verbs for actions (observe, click, type), and verb_noun for flows/tasks (compile_flow, get_task). While readable, the inconsistency is noticeable and could be more uniform (e.g., all verb_noun).
At 26 tools, the set is on the heavier side, slightly exceeding the typical well-scoped range. The breadth is justified by the broad scope of browser automation, but it could benefit from consolidation (e.g., merging task fallback tools) to stay under 25.
The surface covers lifecycle, tab management, element interaction, navigation, flow execution, verification, and task handling. Minor gaps like explicit page reload or download handling exist, but most workflows are supported without dead ends.
Maintenance
Related MCP Connectors
Official Browserless MCP server: browser automation, scraping, screenshots and PDFs for AI agents.
Unofficial Browserless MCP — wraps the Browserless headless-Chromium REST API (browserless.io)
MCP server for Mint — AI-powered QA that runs your app in a real browser on every PR.
Hosted real Google Chrome MCP with per-user persistent state. Navigate, click, type, screenshot.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn advanced MCP server for browser automation using Puppeteer, specifically optimized for token efficiency through minimal data returns and progressive enhancement. It enables agents to navigate pages, capture LLM-optimized screenshots, extract structured content, and perform batch interactions.3MIT
- AlicenseBqualityDmaintenanceAn MCP server for generic browser automation using Playwright. Enables MCP clients to navigate pages, inspect elements, execute JavaScript, capture screenshots, and monitor console logs and network traffic via a headless Chromium instance.7ISC
- AlicenseAqualityDmaintenanceMCP server for headless browser automation via Puppeteer, with stealth anti-detection and Playwright-format ARIA snapshots.310 npmMIT
- AlicenseBqualityCmaintenanceA browser-automation MCP server built on Playwright that provides deterministic snapshots via MutationObserver/requestAnimationFrame, HITL governance, multi-task isolation, and self-healing browser sessions for LLM-driven browsing.25MIT