
Chrome 扩展 + MCP 服务器 — AI 代理控制你真实浏览器中的一个标签页,已经登录
概览
默认支持Playwright支持的浏览器会话。质量保证自动化无需Chrome扩展。 - (默认):独立的Playwright浏览器上下文。这是支持的并行质量保证自动化路径和可靠截图。- (遗留/选择加入):当你需要现有Cookie和登录会话时,连接你的真实Chrome配置文件。 原生模式完全避免使用chrome.tabs.captureVisibleTab(),因此截图不依赖于Chrome是否处于前景、标签页是否可见,或扩展服务工作者是新的。 1. — Claude 代码、光标或任何 MCP 客户端通过 stdio 2 连接。在本地主机 3.4. 5.不是 Chrome 扩展的捕获 API “打开https://example.com,截图,并总结页面内容。” 不需要安装扩展。不需要 Chrome 前台。 关于完整的原生模式操作、应力命令和清理检查,请参见 docs/native-mode.md。 其他工具每页会把5万+字符输入上下文窗口。Pilot保持小规模:
概述(AI 翻译)
默认>原生Playwright支持的浏览器会话。质量保证自动化无需Chrome扩展。
Pilot 有两个浏览器后端:
- 原生模式(默认):隔离的Playwright浏览器上下文。这是支持的并行质量保证自动化和可靠截图路径。
- 扩展模式(遗留/选择加入):当你需要现有 cookie 和登录会话时,连接你的真实 Chrome 配置文件。
原生模式完全避免了chrome.tabs.captureVisibleTab(),因此截图不依赖于Chrome是否前景、标签页是否可见,或扩展服务工作者是新的。
它是如何运作的
- Pilot 作为 MCP 服务器运行 — Claude Code、光标或任何 MCP 客户端通过 stdio 连接
- 第一个试点进程成为localhost的代理
- 后续试点进程作为经纪客户端连接
- 每个会话都会获得一个独立的本地浏览器上下文/页面
- 截图来自Playwright,不是Chrome扩展的捕获API。
快速启动
1.添加MCP服务器
本地结账:
2.用它
“打开https://example.com,截图,并总结页面。”
没有安装扩展。
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
pilot — browser automation MCP for AI agents
Native Playwright-backed browser sessions by default. No Chrome extension required for QA automation.
Pilot has two browser backends:
- Native mode (default): isolated Playwright browser contexts. This is the supported path for parallel QA automation and reliable screenshots.
- Extension mode (legacy/opt-in): connects to your real Chrome profile when you need existing cookies and logged-in sessions.
Native mode avoids chrome.tabs.captureVisibleTab() entirely, so screenshots do not depend on Chrome being foregrounded, a tab being visibly active, or the extension service worker being fresh.
How it works
AI Agent → MCP Server → Broker on 127.0.0.1:3131 → Native browser session
(stdio) (first process owns broker) (Playwright context/page)
- Pilot runs as an MCP server — Claude Code, Cursor, or any MCP client connects via stdio
- The first Pilot process becomes the broker on localhost
- Later Pilot processes connect as broker clients
- Each session gets an isolated native browser context/page
- Screenshots come from Playwright, not the Chrome extension capture API
Quick Start
1. Add the MCP server
codex mcp add pilot \
--env PILOT_BROWSER_MODE=native \
--env PILOT_PROFILE=full \
-- npx -y pilot-mcp
For a local checkout:
npm install
npm run build
codex mcp add pilot \
--env PILOT_BROWSER_MODE=native \
--env PILOT_PROFILE=full \
-- node /absolute/path/to/pilot/dist/index.js
2. Use it
“Open https://example.com, take a screenshot, and summarize the page.”
No extension install. No Chrome foreground requirement.
For full native-mode operations, stress commands, and cleanup checks, see docs/native-mode.md.
Lean snapshots
Other tools dump 50K+ chars per page into your context window. Pilot keeps things small:
Other tools: navigate(58K) → navigate(58K) → answer = 116K chars
Pilot: navigate(2K) → navigate(2K) → snapshot(9K) = 13K chars
snapshot_diff shows only what changed between actions — no redundant re-reads.
Less context = faster responses, cheaper API calls, fewer hallucinations.
Pilot vs @playwright/mcp
| Pilot | @playwright/mcp | |
|---|---|---|
| Browser | Native Playwright context by default; real Chrome via legacy extension | New Chromium instance |
| Auth state | Native isolated by default; extension mode can use real Chrome cookies | Anonymous — manual setup |
安装
npx -y pilot-mcp配置
{
"mcpServers": {
"pilot": {
"command": "npx",
"args": ["-y", "pilot-mcp"],
"env": { "PILOT_PROFILE": "standard" }
}
}
}