agent-browser
🌐 Agent Browser API
一个通用、完全可用的 AI 代理无头浏览器。 让任何代理 —— Zapier Agents、Custom GPTs、Claude、Cursor、LangChain、CrewAI、n8n、Make 或你自己的代码 —— 拥有一个真正的 Chromium 浏览器:JavaScript 渲染、网页搜索、点击、输入、表单填写、下拉选择、截图、表格与数据提取,以及 PDF 生成。
🇮🇳 印地语 TL;DR: Yeh ek real browser hai jo koi bhi AI agent use kar sakta hai — 3 tarike: simple REST API, OpenAPI import (Custom GPT), ya native MCP (Claude/Cursor/ChatGPT)。Deploy karo, API key set karo, ho gaya。✅ 26/26 tests passing。
🔌 适用于任何代理 —— 三种连接方式
模式 | 适用对象 | 方式 |
REST API | Zapier Agents、n8n、Make、LangChain、CrewAI、任何代码 |
|
OpenAPI | OpenAI Custom GPTs(Actions)、API 工具 | 导入 |
MCP 🆕 | Claude Desktop/Code、Cursor、Windsurf、ChatGPT、VS Code、n8n MCP | 将你的 MCP 客户端指向 |
各平台完整复制粘贴指南:INTEGRATIONS.md · Zapier 专属说明:ZAPIER_SETUP.md
Related MCP server: WebControl
✨ 功能特性
能力 | 端点 | 功能说明 |
📖 浏览 |
| 渲染任意页面(含 JS)→ 干净的 Markdown + 标题 + 链接 + 元数据。可直接供 LLM 使用。 |
🔍 搜索 |
| 通过 Brave/Bing/DDG 进行网页搜索,带自动回退。无需搜索 API 密钥。 |
📸 截图 |
| 页面 PNG、整页或单个元素;自定义视口;二进制或 base64。 |
🧲 提取 |
| 通过 CSS 选择器提取结构化数据 → JSON。 |
📊 表格 |
| 页面上的所有数据表格 → JSON(表头 + 行),跳过布局/隐藏表格。 |
🖱️ 元素 |
| 可见的链接/按钮/输入框,附带可直接使用的 CSS 选择器 —— 代理可以看到哪些元素可点击。 |
| 将任意页面渲染为 PDF(纵向/横向)。 | |
🧭 会话 |
| 有状态的多步骤流程: |
🤝 MCP |
| 以上所有功能作为原生 MCP 工具(截图以真实图片形式返回)。 |
此外还有:API 密钥认证、CORS、速率限制、SSRF 防护、会话自动过期 + LRU 淘汰、基础隐身、SPA 稳定等待、面向 LLM 上下文安全的输出截断、有用的错误 hint、/llms.txt,以及完整的 OpenAPI 规范。
🚀 快速开始
免费部署(Render)—— 推荐
将此仓库 fork/推送到 GitHub。
前往 render.com → New → Blueprint → 选择此仓库(自动检测
render.yaml)。从服务的 Environment 选项卡中复制生成的
API_KEY。在
https://your-service.onrender.com上线 🎉
也适用于 Railway、Fly.io 或任何 Docker 主机。
Docker
docker build -t agent-browser .
docker run -p 8080:8080 -e API_KEY=your-secret-key agent-browser本地运行
npm install # installs deps + Chromium
API_KEY=your-secret-key npm start
# → agent-browser v2.0.0 listening on :8080🧪 试用
BASE=http://localhost:8080; KEY=your-secret-key
# Read a JS-heavy page as markdown
curl -X POST $BASE/v1/browse -H "X-API-Key: $KEY" -H "Content-Type: application/json" \
-d '{"url":"https://news.ycombinator.com"}'
# Search the web
curl -X POST $BASE/v1/search -H "X-API-Key: $KEY" -H "Content-Type: application/json" \
-d '{"query":"best CRM for startups","limit":5}'
# Extract every table on a page as JSON
curl -X POST $BASE/v1/tables -H "X-API-Key: $KEY" -H "Content-Type: application/json" \
-d '{"url":"https://www.scrapethissite.com/pages/forms/"}'
# Multi-step: search Wikipedia interactively
SID=$(curl -s -X POST $BASE/v1/sessions -H "X-API-Key: $KEY" -H "Content-Type: application/json" \
-d '{"url":"https://en.wikipedia.org"}' | jq -r .sessionId)
curl -X POST $BASE/v1/sessions/$SID/fill -H "X-API-Key: $KEY" -H "Content-Type: application/json" \
-d '{"fields":{"input[name=search]":"Artificial intelligence"}}'
curl -X POST $BASE/v1/sessions/$SID/press -H "X-API-Key: $KEY" -H "Content-Type: application/json" \
-d '{"key":"Enter"}'
curl $BASE/v1/sessions/$SID/content -H "X-API-Key: $KEY"
curl -X DELETE $BASE/v1/sessions/$SID -H "X-API-Key: $KEY"运行完整的冒烟测试套件:npm test —— 26 项检查覆盖每个端点以及真实的 MCP 客户端往返测试。
⚙️ 配置(环境变量)
变量 | 默认值 | 说明 |
| (空 = 关闭认证,仅限开发!) | 所有非公开端点所需的密钥。 |
|
| HTTP 端口。 |
|
| 最大并发有状态会话数(LRU 淘汰)。 |
|
| 空闲会话过期时间(10 分钟)。 |
|
| 导航超时时间。 |
|
| 每个 API 密钥或 IP 的每分钟请求数( |
|
| 允许的 CORS 来源。 |
|
| 允许浏览私有/内部地址(关闭 SSRF 防护)。 |
🔒 安全说明
在生产环境中务必设置
API_KEY(Render blueprint 会自动生成一个)。仅允许
http/httpsURL;localhost/私有/元数据地址默认被阻止。在 HTTPS 后面运行(Render/Railway 免费提供 TLS)。
evaluate在沙箱页面内部运行任意 JS —— 请保管好你的 API 密钥。公开(无密钥)端点仅为只读信息:
/、/health、/openapi.yaml、/llms.txt、/v1/tools。
📁 项目结构
src/server.js # Express API: auth, CORS, rate limit, routes
src/actions.js # Shared high-level actions (used by REST + MCP)
src/browser.js # Chromium lifecycle, sessions, TTL/LRU, SSRF guard
src/extract.js # HTML → markdown, CSS extraction, tables, elements
src/search.js # Multi-engine web search with fallback
src/mcp.js # MCP server (Streamable HTTP, 22 tools)
src/tools-manifest.js # GET /v1/tools (OpenAI function format)
openapi.yaml # Full API specification
test/run-tests.sh # 26-check smoke-test suite (incl. MCP round-trip)
Dockerfile # Production image (Playwright base, version-pinned)
render.yaml # One-click Render deploy许可证
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
- FlicenseNot gradedqualityDmaintenanceEnables AI agents to control the Google Chrome browser through a Node.js WebSocket bridge and a dedicated browser extension. It provides tools for capturing screenshots, executing JavaScript, managing tabs, and extracting page content via the MCP protocol.2
- FlicenseNot gradedqualityCmaintenanceHeadless browser automation for LLM agents via REST API or MCP tools. Enables navigating pages, reading structured content, clicking elements, filling forms, and executing JavaScript.
- AlicenseNot gradedqualityDmaintenanceProvides a real browser that bypasses bot detection (Cloudflare, Turnstile) for AI agents, enabling navigation, clicking, typing, screenshots, and data collection through MCP tools.71MIT
- AlicenseNot gradedqualityBmaintenanceHosted Chrome as an MCP skill. Enables any MCP-compatible agent to drive a real Chromium browser for tasks like navigation, clicking, typing, and taking screenshots.20MIT
Related MCP Connectors
Stealth web browser for agents: search, fetch, click and type through persistent sessions over MCP.
Hosted real Google Chrome MCP with per-user persistent state. Navigate, click, type, screenshot.
Screenshot, diff, audit and sitemap-capture any web page — 5 MCP tools for AI agents.
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/gopendrasharma89-tech/agent-browser'
If you have feedback or need assistance with the MCP directory API, please join our Discord server