Claude Code浏览器 MCP(Playwright MCP 0.0.86)
浏览器型 · 内容不丢,多走几步厂商怎么说
读页面的无障碍树快照。
- 上限
- 25,000 Token(按 Claude 的 Token 计) 或 50,000 字符,哪个先到算哪个
- 超出以后
- 整份输出存成文件,Agent 再搜索或分段读。
- 核实时的版本
- 2.1.332
例外:结果里带图片,或设了 ENABLE_MCP_LARGE_OUTPUT_FILES=false 时,超出就截断(保留开头)。单个工具可以声明更高的上限,最高 500,000 字符。
- Claude Code docs: MCP output limits and warnings
the default maximum is 25,000 tokens
- Claude Code docs: MCP output limits and warnings
saves a successful result with no image content to a file once it's longer than 50,000 characters
我们实测
- 日期
- 2026-11-29(UTC)
- 环境
- 我们本机的命令行 · 订阅
- Agent 版本
- 2.1.332
- 模型
- Haiku
- 测试页
- 生成的目录页(快照 44,334 / 69,003 / 697,383 字符)
- 次数
- 9 次
Claude Code 2.1.332 on macOS
claude -p --model claude-haiku-5-5 --setting-sources project
tools: mcp__playwright, Read, Grep, Glob
Playwright MCP 0.0.86: --headless --isolated读到页尾:9 次里 9 次
超出上限时,快照存成了文件,Agent 多走 1 步(页内查找或 Grep)找到了暗号。
原始记录(9 次)
暗号的值写成 [code],本机文件路径写成 <local>。测试页是公开的,可以自己打开对答案。问法、步骤、回答保留英文原文。
- 第 1 次对问法
Open http://127.0.0.1:8765/c1.html in the browser. It is a template library page. Find the template support codes on that page (one is in the middle of the list, one is at the end) and reply with both codes exactly.
步骤browser_navigate url=http://127.0.0.1:8765/c1.html → 363 charsRead file=<local file> → 44,334 chars
回答The page has two template support codes: - **Middle of the list:** `[code]` - **End of the page:** `[code]`
- 第 2 次对问法
Open http://127.0.0.1:8765/c1.html in the browser. It is a template library page. Find the template support codes on that page (one is in the middle of the list, one is at the end) and reply with both codes exactly.
步骤browser_navigate url=http://127.0.0.1:8765/c1.html → 363 charsbrowser_snapshot → 40,254 chars
回答The page has two template support codes: - **Middle of the list:** `[code]` - **End of the page:** `[code]` I loaded the page in the browser and read both codes from the accessibility snapshot.
- 第 3 次对问法
Open http://127.0.0.1:8765/c1.html in the browser. It is a template library page. Find the template support codes on that page (one is in the middle of the list, one is at the end) and reply with both codes exactly.
步骤browser_navigate url=http://127.0.0.1:8765/c1.html → 363 charsbrowser_snapshot → 40,254 chars
回答Both codes are on the page at http://127.0.0.1:8765/c1.html: - **Middle of the list:** `[code]` - **End of the page:** `[code]`
- 第 4 次对问法
Open http://127.0.0.1:8765/c2.html in the browser. It is a template library page. Find the template support codes on that page (one is in the middle of the list, one is at the end) and reply with both codes exactly.
步骤browser_navigate url=http://127.0.0.1:8765/c2.html → 363 charsbrowser_snapshot → 1,553 charsbrowser_find → 756 chars
回答The two template support codes on the page are: - **Middle of the list:** `[code]` - **End of the page:** `[code]` I found them with a text search of the page rather than reading the full snapshot, which was too large to load.
- 第 5 次对问法
Open http://127.0.0.1:8765/c2.html in the browser. It is a template library page. Find the template support codes on that page (one is in the middle of the list, one is at the end) and reply with both codes exactly.
步骤browser_navigate url=http://127.0.0.1:8765/c2.html → 363 charsbrowser_snapshot → 1,553 charsbrowser_find → 756 chars
回答Both codes are on the page: - **Middle:** `[code]` - **End:** `[code]` I found them with a text search of the page's accessibility tree rather than reading the full snapshot, which was too large to load. The search returned exactly two "support code" matches, so there are no other candidates.
- 第 6 次对问法
Open http://127.0.0.1:8765/c2.html in the browser. It is a template library page. Find the template support codes on that page (one is in the middle of the list, one is at the end) and reply with both codes exactly.
步骤browser_navigate url=http://127.0.0.1:8765/c2.html → 363 charsbrowser_snapshot → 1,553 charsGrep pattern=(?i)support|code path=<local> → 204 chars
回答The two template support codes on the page are: - **Middle of the list:** `[code]` - **End of the page:** `[code]` I found them by searching the page's accessibility snapshot, which was too large to read in one pass. The search covered the whole snapshot, so these are the only two matches for "support" or "code".
- 第 7 次对问法
Open http://127.0.0.1:8765/c4.html in the browser. It is a template library page. Find the template support codes on that page (one is in the middle of the list, one is at the end) and reply with both codes exactly.
步骤browser_navigate url=http://127.0.0.1:8765/c4.html → 363 charsbrowser_snapshot → 1,555 charsGrep pattern=(?i)support path=<local> → 208 chars
回答The two template support codes on the page are: - **Middle:** `[code]` - **End:** `[code]` I found them by searching the page's accessibility snapshot for "support" rather than reading all 18,000 lines. Both appear under the page's Support heading, at lines 9019 and 18022 of the saved snapshot.
- 第 8 次对问法
Open http://127.0.0.1:8765/c4.html in the browser. It is a template library page. Find the template support codes on that page (one is in the middle of the list, one is at the end) and reply with both codes exactly.
步骤browser_navigate url=http://127.0.0.1:8765/c4.html → 363 charsbrowser_snapshot → 1,555 charsGrep pattern=(?i)support path=<local> → 208 chars
回答Both codes are on the page: - **Middle of the list:** `[code]` - **End of the list:** `[code]` I found them by searching the page snapshot for "support" rather than reading all 18,024 lines.
- 第 9 次对问法
Open http://127.0.0.1:8765/c4.html in the browser. It is a template library page. Find the template support codes on that page (one is in the middle of the list, one is at the end) and reply with both codes exactly.
步骤browser_navigate url=http://127.0.0.1:8765/c4.html → 363 charsbrowser_snapshot → 1,555 charsGrep pattern=(?i)support path=<local> → 208 chars
回答Both codes are on the page: - **Middle of the list:** `[code]` - **End of the list:** `[code]` I found them by searching the page's accessibility snapshot for "support" rather than reading all 18,000 lines, so I didn't check the surrounding text around each one.
44,000 字符的页面上,快照直接读进对话。69,000 和 697,000 字符的页面上,工具结果写明输出超过上限,快照存成了文件,Agent 多走 1 步(页内查找或 Grep)找到了暗号。