Browser-MCP Navigator

Browser-MCP Navigator

Ultra-fast browser automation server over Chrome DevTools Protocol (CDP), exposed as MCP, enabling AI agents to control a real Chrome browser with low latency and minimal token usage.

Category
访问服务器

README

Browser-MCP (Browser-MCP Navigator)

Ultra-fast browser automation server over Chrome DevTools Protocol (CDP), exposed as a Model Context Protocol (MCP) server.

No screenshots. No Playwright relay. Direct CDP WebSocket — 20–50× fewer tokens, ~10ms per action.

Note: The core Python package is named browser_mcp internally.

What it does

Controls a real Chrome browser from any AI agent that supports MCP. The agent receives a compact accessibility-tree snapshot with @eN references after every action — no pixels, no heavy HTML blobs.

Agent  ──MCP──►  Browser-MCP Server  ──CDP──►  Chrome

Quick Start — Docker (Recommended)

git clone https://github.com/ingjohnfigueroablanco/browser-MCP.git
cd browser-MCP
cp .env.example .env          # optionally set MCP_API_KEY
docker compose up -d

Server ready at http://localhost:3067/sse.

Quick Start — Local (No Docker)

git clone https://github.com/ingjohnfigueroablanco/browser-MCP.git
cd browser-MCP
python -m venv .venv 
source .venv/bin/activate     # Windows: .venv\Scripts\activate
pip install -e .
python -m browser_mcp  # stdio mode

Connecting from Claude Code

Option A — Local subprocess / stdio

Add to your project's .mcp.json:

{
  "mcpServers": {
    "browser-mcp": {
      "command": "python",
      "args": ["-m", "browser_mcp"]
    }
  }
}

Option B — Docker / SSE

{
  "mcpServers": {
    "browser-mcp": {
      "type": "sse",
      "url": "http://localhost:3067/sse",
      "headers": { "X-API-Key": "your-key" }
    }
  }
}

Connecting from other agents / frameworks

Python agent (mcp SDK)

from mcp import ClientSession
from mcp.client.sse import sse_client

async with sse_client("http://localhost:3067/sse",
                      headers={"X-API-Key": "your-key"}) as (read, write):
    async with ClientSession(read, write) as session:
        await session.initialize()
        result = await session.call_tool("navigate", {"url": "https://example.com"})
        print(result.content[0].text)

Testing Localhost Apps (Docker)

The browser runs inside the container. localhost inside Docker ≠ your dev machine.

Approach How
Docker Desktop Use http://host.docker.internal:3000 instead of localhost:3000
ngrok ngrok http 3000 → gives a public URL the container can reach
Local mode (stdio) Chrome runs on your machine — localhost works normally

Available Tools

Tool Description
browser_start Launch / reconnect Chrome
browser_stop Close Chrome
navigate Go to URL, wait for load / networkidle
snapshot Accessibility tree as compact text with @eN refs
click Human-like click by coordinates
js_click element.click() — reliable for React / Angular SPAs
fill Clear + type text in an input
press_key Key press (Enter, Tab, Escape, ArrowDown…)
select_option Select native <select> by value or label
hover Mouse hover (menus, tooltips)
set_value React/Vue/Angular-safe input setter via native JS
scroll Scroll page or element into view
js_eval Run any JavaScript — drag, events, async fetch, bulk loops
js_eval_loop Bulk operations — run a JS snippet once per item
cdp_call Raw CDP protocol — file upload, device emulation, network intercept
get_text innerText of element or full page
wait_for Wait until text appears on page
read_console JS console logs
read_network Network requests / responses
screenshot PNG base64 (escape hatch)
current_url Current URL + title

Performance & Bulk Operations

The bottleneck is LLM round-trips, not the browser

Each tool call costs one full LLM inference + HTTP round-trip. The browser executes CDP in ~10ms.

Pattern Tool calls Typical wall time
20 × (click + fill + click) 60 ~10 min
1 × js_eval_loop with 20 items 1 ~15 sec

Rule: for N > 5 repetitions, use js_eval_loop

# GOOD — 1 tool call for 20 users
js_eval_loop(
    items=users,
    script="""
      document.querySelector('.agregar').click();
      await new Promise(r => setTimeout(r, 400));
      // ... fill logic ...
      document.querySelector('.crear').click();
      return item.user;
    """,
    delay_ms=300,
)

Environment Variables

Variable Default Description
MCP_TRANSPORT stdio stdio (local) or sse (Docker/remote)
MCP_HOST 0.0.0.0 SSE bind address
MCP_PORT 3067 SSE port
MCP_API_KEY (empty) API key header; empty = no auth
CHROME_PATH auto Explicit path to chrome.exe
CHROME_EXTRA_ARGS (empty) Extra Chrome flags
Browser-MCP_HEADLESS 0 1 for headless mode
Browser-MCP_HUMAN_DELAYS 1 0 removes human-like delays (faster)

Architecture

mcp/         FastMCP server + tool definitions
browser/     BrowserManager — lifecycle, navigate, snapshot, waits
snapshot/    AX tree → compact text with @eN refs (no screenshots)
actions/     mouse, keyboard, forms (ref → coordinates)
cdp/         Raw CDP WebSocket connection + event buffers
chrome/      Chrome launcher, port scan, reattach

Why it's faster than Playwright:

  • No Node.js relay — Python speaks CDP directly.
  • Chrome stays alive between calls (daemon) — 0 ms startup per tool call.
  • Snapshot = compact AX text, not full YAML or heavy screenshots.
  • @eN refs = stable backendNodeId — no DOM re-query per action.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选