Borrowing it
Nothing to install: this file belongs to Unagi-cq/cdp-bridge-mcp. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/Unagi-cq/cdp-bridge-mcp/main/CLAUDE.mdgit clone --depth 1 https://github.com/Unagi-cq/cdp-bridge-mcpWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/instructions/unagi-cq/cdp-bridge-mcp/claude-md)<a href="https://agentmods.dev/instructions/unagi-cq/cdp-bridge-mcp/claude-md"><img src="https://agentmods.dev/badge/instructions/unagi-cq/cdp-bridge-mcp/claude-md/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/instructions/unagi-cq/cdp-bridge-mcp/claude-md"><img src="https://agentmods.dev/badge/instructions/unagi-cq/cdp-bridge-mcp/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00874 | $0.00874 |
| Opus 5 | $0.00437 | $0.00437 |
| Sonnet 5 | $0.00175 | $0.00175 |
| Haiku 4.5 | $0.00087 | $0.00087 |
Grade A, and why
cdp-bridge-mcp CLAUDE.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
What it actually says
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
常用命令
# 以 MCP stdio 服务方式运行(主要使用方式)
uvx cdp-bridge@latest
# 获取扩展目录路径(用于手动加载到浏览器)
uvx cdp-bridge-extension-path@latest # 或: python -m cdp_bridge extension_path
# 本地开发:安装依赖并运行
uv sync
uv run cdp-bridge
# 构建 PyPI 分发包
uv build
项目没有测试、lint 配置和 CI/CD。
架构
CDP Bridge MCP 让 LLM 客户端连接用户正在使用的真实浏览器,而非无头自动化实例。用户加载 Chromium 扩展(tmwd_cdp_bridge/),然后 MCP 服务将工具调用桥接为浏览器内的 JS 执行。
启动链路 → 控制台脚本 cdp_bridge:main → mcp.run() 启动 FastMCP stdio 服务。
server.py — 定义 9 个 MCP 工具(browser_get_tabs、browser_scan、browser_execute_js、browser_switch_tab、browser_focus_tab、browser_batch、browser_wait、browser_navigate、browser_screenshot)。所有工具用 asyncio.to_thread() 包裹同步代码。注意:工具在每次调用前通过 importlib.reload(simphtml) 重载模块,这样无需重启服务就能更新浏览器内 JS 辅助代码。
TMWebDriver.py — 核心桥接层。管理通过 WebSocket(127.0.0.1:18765)或 HTTP 长轮询(:18766)连接的浏览器会话。每个 Session 跟踪一个标签页(url、连接类型、活跃状态)。三种连接模式:
ws— 扩展直连 WebSocketext_ws— 扩展 WebSocket,带标签页级别的追踪(tabs_update广播)http— HTTP 长轮询降级方案
也可在 is_remote 模式下运行,通过 HTTP 代理到另一 TMWebDriver 实例。
simphtml.py — 浏览器内 HTML 优化。包含大型嵌入式 JS 代码块(optHTML() — 去除脚本/样式/不可见元素并对页面区域分类;findMainList() — 检测重复内容列表;smart_truncate() — 基于 token 预算的 HTML 截断)。Python 侧用 BeautifulSoup 做后处理(属性清理、列表截断、execute_js_rich() 的 DOM 变更 diff)。
tmwd_cdp_bridge/ — Chrome 扩展:background.js(WebSocket 连接 + 约每 5 秒自动重连)、content.js(页面内脚本执行)、popup.html/js(扩展工具栏界面)。
sop/ — 扩展 CDP 能力和 Vue3 组件处理的标准操作文档。
关键约定
- 日志必须走 stderr:用
log()(在TMWebDriver.py和simphtml.py中已定义)输出所有诊断信息。stdout 仅用于 MCP JSON-RPC 消息,任何print()写到 stdout 都会污染 MCP 协议流,导致客户端报Transport closed错误。 - 会话 ID 就是 Chrome 标签页 ID(字符串类型)。
default_session_id标识当前 MCP 工具操作的目标标签页。 execute_js()有约 15 秒超时,并跟踪 ACK 确认——能区分"脚本未送达"和"脚本已送达但尚无结果"。
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 10d ago First seen · 50 lines · 874 tokens per session scan A c88a96ffa1ba
cdp-bridge-mcp CLAUDE.md is an instructions file published in the GitHub repository Unagi-cq/cdp-bridge-mcp (297 stars, last pushed 1mo ago), licensed MIT. It adds 874 tokens to every session, about $0.0044 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other instructions, from other repositories
next.js AGENTS.md
AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.
codex AGENTS.md
AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.
vscode buildNext.instructions.md
Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).
spec-kit AGENTS.md
AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.
vscode oss-third-party-notices.instructions.md
Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).
langchain AGENTS.md
AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.