browser-agent
Click on "Install 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., "@browser-agentOpen example.com and extract all article titles from the blog"
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.
Autonomous Browser Agent — no screenshots
The agent drives a real Chromium via Playwright, and the LLM makes decisions based on a
structured textual snapshot of the page (ref | role | name | states), not images.
No vision model is needed, and no screenshots are taken at any step.
Three operating modes from a single codebase:
Mode | How to enable | Purpose |
Local, visible browser |
| debugging, visual control |
Your real Chrome via CDP |
| live sessions, better fingerprint |
VPS headless 24/7 |
| autonomous work through a task queue |
Architecture
File | Purpose |
| JS injection: DOM traversal + open Shadow DOM + iframes, filtering visible interactive elements, |
| Playwright session (headless/headful/CDP, stealth-init, proxy, image blocking) and executor of 14 actions |
| planner: Anthropic / OpenAI-compatible / Ollama, strict JSON action protocol |
| LangGraph loop |
| CLI: |
| MCP server: 13 browser tools for Claude Code / Cursor / your own orchestrator |
| launch your Chrome with a debugging port (Linux/macOS and Windows) |
| image based on |
Related MCP server: Playwright MCP Server
1. Installation on a local machine
git clone https://github.com/maxmkab/autonomous-browser-agent.git
cd autonomous-browser-agent
python -m venv .venv
source .venv/bin/activate # Windows: .venv\\Scripts\\activate
pip install -r requirements.txt
playwright install chromium
cp .env.example .env # вписать ANTHROPIC_API_KEYCheck without spending on the LLM — see exactly what the model sees:
python main.py snapshot --url https://example.comRun a task with a visible browser:
HEADLESS=false python main.py run \
--task "Найди раздел с ценами и извлеки все тарифы через extract" \
--url https://example.com \
--json state/report.json2. Embedding into your real browser (CDP)
The agent can work not in its own clean Chromium but in your Chrome — with live sessions, extensions, and a real fingerprint. No extensions need to be installed — control happens over the Chrome DevTools Protocol.
# 1) запустить Chrome с открытым портом (отдельный профиль для агента)
chmod +x scripts/chrome-cdp.sh
./scripts/chrome-cdp.sh 9222 # Windows: scripts\\chrome-cdp.bat 9222
# 2) в другом терминале отдать задачу агенту в этом же браузере
CDP_URL=http://127.0.0.1:9222 python main.py run --task "..."In this mode the agent does not touch storage_state.json: sessions are taken from the Chrome profile.
On first launch, log into the services you need by hand; the profile remembers them from then on.
3. Embedding into Claude Code / Cursor via MCP
mcp_server.py starts an MCP server with stdio transport. Tools:
browser_open, browser_snapshot, browser_click, browser_type, browser_select,
browser_check, browser_scroll, browser_press, browser_back, browser_tabs,
browser_save_session, browser_run_task, browser_close.
Config for Claude Code (~/.claude.json or .mcp.json in the project root):
{
"mcpServers": {
"browser-agent": {
"command": "/absolute/path/autonomous-browser-agent/.venv/bin/python",
"args": ["/absolute/path/autonomous-browser-agent/mcp_server.py"],
"env": {
"HEADLESS": "false",
"CDP_URL": "http://127.0.0.1:9222",
"ANTHROPIC_API_KEY": "sk-ant-...",
"REQUIRE_APPROVAL": "true"
}
}
}
}Or with a single command:
claude mcp add browser-agent -- /absolute/path/.venv/bin/python /absolute/path/mcp_server.pyAfter that, the model in Claude Code drives the browser in a loop
browser_snapshot → browser_click → browser_snapshot, receiving only textual snapshots.
The browser session lives between calls, so a scenario can be driven step by step.
For full autonomy there is browser_run_task — the agent runs the loop itself and returns a JSON report.
4. Moving authorization to the server
# локально, в видимом окне: залогинился → Enter в консоли
HEADLESS=false python main.py login --url https://site.ru/login
# переносим cookies + localStorage на сервер
scp state/storage_state.json root@YOUR_VPS_IP:/opt/browser-agent/state/5. Deploying to a VPS (Ubuntu 24.04 + Docker)
mkdir -p /opt/browser-agent/state && cd /opt/browser-agent
git clone https://github.com/maxmkab/autonomous-browser-agent.git .
cp .env.example .env && nano .env
docker build -t browser-agent .
docker run -d --name browser-agent --restart unless-stopped \
--shm-size=1g \
--env-file .env \
-v /opt/browser-agent/state:/app/state \
browser-agent--shm-size=1g is mandatory: Chromium in a container with the default 64 MB /dev/shm crashes
on heavy pages.
One-off task on the server:
docker exec -it browser-agent python main.py run --task "..." --url https://...Without Docker (systemd)
apt update && apt install -y python3-venv
cd /opt/browser-agent && python3 -m venv .venv && . .venv/bin/activate
pip install -r requirements.txt
playwright install --with-deps chromium/etc/systemd/system/browser-agent.service:
[Unit]
Description=Autonomous browser agent
After=network-online.target
[Service]
Type=simple
WorkingDirectory=/opt/browser-agent
EnvironmentFile=/opt/browser-agent/.env
ExecStart=/opt/browser-agent/.venv/bin/python main.py daemon --interval 300
Restart=always
RestartSec=10
StandardOutput=append:/var/log/browser-agent.log
StandardError=append:/var/log/browser-agent.log
[Install]
WantedBy=multi-user.targetsystemctl daemon-reload && systemctl enable --now browser-agent
journalctl -u browser-agent -f6. Task submission and n8n
The daemon reads state/tasks.jsonl — one line = one task:
{"id":"price-check-1","task":"Открой карточку товара, извлеки цену и наличие через extract","url":"https://site.ru/item/123"}
{"id":"lead-form","task":"Заполни форму заявки: имя Иван, телефон +79990000000. Отправку подтвердит человек."}Results are written to state/results.jsonl with the fields success, result, extracted,
steps, tokens_in/out, and the full history trace. n8n can write tasks to this file
(Execute Command / SSH node) and read the results.
7. Token savings
No screenshots: text only, no vision model.
DOM filtering: only visible interactive elements with a non-empty name go into the context, 250 max per frame.
Image/font/media blocking at the network level (
BLOCK_MEDIA=true).History compression (
HISTORY_WINDOW): full snapshots only for the latest steps, older ones are collapsed intoaction → result.Loop detection: if the snapshot fingerprint does not change, the model is instructed to change strategy.
8. Security
Actions matching RISKY_PATTERNS (payment, buy, order, delete, send,
checkout, pay, delete) require approval: in the console locally or a "yes" reply in Telegram
on the server (APPROVAL_MODE=telegram). ALLOW_EVAL=false by default forbids executing
arbitrary JS. All action errors are returned to the model as observations and do not crash the process.
Secrets are stored only in .env, which is excluded from git.
9. Pre-production checks
python main.py snapshot --url <target site>— do the needed elements appear in the snapshot?Run the task locally in headful with
REQUIRE_APPROVAL=true.The same task locally in headless — catches rendering differences before deploy.
Only then deploy to the VPS and start the daemon.
License
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityAmaintenanceEnables direct browser control via Chrome DevTools Protocol, supporting navigation, interaction, content extraction, and screenshots through a single MCP tool.1341MIT
- FlicenseNot gradedqualityCmaintenanceEnables browser automation through the MCP protocol, allowing AI agents to control a real browser using accessibility snapshots and natural language commands.
- AlicenseNot gradedqualityBmaintenanceEnables Codex to control a visible Chromium browser via MCP tools for navigation, page inspection, and interaction, while keeping sensitive steps like login and captcha under the user's control.31MIT
- AlicenseAqualityBmaintenanceBrowser automation MCP server that uses a real browser to give agents eyes and hands—open pages, click, fill, screenshot, and run scripts via accessibility-tree snapshots.22MIT
Related MCP Connectors
Hosted real Google Chrome MCP with per-user persistent state. Navigate, click, type, screenshot.
Browser MCP for logged-in tasks. Uses your Chrome — credentials stay local. Zero-token replay.
Stealth web browser for agents: search, fetch, click, download and type in persistent MCP sessions.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/maxmkab/autonomous-browser-agent'
If you have feedback or need assistance with the MCP directory API, please join our Discord server