cdp-bridge-mcp: Instructions file for Claude Code

CLAUDE.md

cdp-bridge-mcp CLAUDE.md is an instructions file for Claude Code from Unagi-cq/cdp-bridge-mcp. It costs 874 tokens per session, scanned A, original, MIT.

Repository instructions for CDP Bridge MCP, a service that lets an AI client control the user’s real Chromium browser through an extension and the Chrome DevTools Protocol.

In plain words
What is it for?
Use them when running CDP Bridge, loading its browser extension, controlling tabs or pages, developing the Python service, or building its package.
Why use it?
They document how to start the service, connect browser tabs, and develop or package the project, including its lack of tests, linting, and CI configuration.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: mentions CLAUDE.md; mentions Claude Code.

This is Unagi-cq/cdp-bridge-mcp's own configuration. It tells Claude Code how to work on cdp-bridge-mcp itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything cdp-bridge-mcp configures →

Reuse

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.

Copy the file
curl -O https://raw.githubusercontent.com/Unagi-cq/cdp-bridge-mcp/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/Unagi-cq/cdp-bridge-mcp

Made for: Claude Code.

Wrote 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.

agentmods badge for cdp-bridge-mcp CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/unagi-cq/cdp-bridge-mcp/claude-md/github.svg)](https://agentmods.dev/instructions/unagi-cq/cdp-bridge-mcp/claude-md)
Your own site
<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.

agentmods 80×15 button for cdp-bridge-mcp CLAUDE.md

Your own site · 80×15
<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>
Per session 874 This file is loaded in full into every session.
When invoked 874 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce 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

Measured 10d ago against content hash c88a96ffa1ba, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

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.

CLAUDE.md · 50 lines

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:mainmcp.run() 启动 FastMCP stdio 服务。

server.py — 定义 9 个 MCP 工具(browser_get_tabsbrowser_scanbrowser_execute_jsbrowser_switch_tabbrowser_focus_tabbrowser_batchbrowser_waitbrowser_navigatebrowser_screenshot)。所有工具用 asyncio.to_thread() 包裹同步代码。注意:工具在每次调用前通过 importlib.reload(simphtml) 重载模块,这样无需重启服务就能更新浏览器内 JS 辅助代码。

TMWebDriver.py — 核心桥接层。管理通过 WebSocket(127.0.0.1:18765)或 HTTP 长轮询(:18766)连接的浏览器会话。每个 Session 跟踪一个标签页(url、连接类型、活跃状态)。三种连接模式:

  • ws — 扩展直连 WebSocket
  • ext_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.pysimphtml.py 中已定义)输出所有诊断信息。stdout 仅用于 MCP JSON-RPC 消息,任何 print() 写到 stdout 都会污染 MCP 协议流,导致客户端报 Transport closed 错误。
  • 会话 ID 就是 Chrome 标签页 ID(字符串类型)。default_session_id 标识当前 MCP 工具操作的目标标签页。
  • execute_js() 有约 15 秒超时,并跟踪 ACK 确认——能区分"脚本未送达"和"脚本已送达但尚无结果"。
Changes

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.

  1. 10d ago First seen · 50 lines · 874 tokens per session scan A c88a96ffa1ba

Subscribe to this mod's changes

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.

Related

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.

vercel/next.js · 7,296 tokens

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.

openai/codex · 5,153 tokens

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).

microsoft/vscode · 6,785 tokens

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.

github/spec-kit · 7,104 tokens

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).

microsoft/vscode · 5,001 tokens

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.

langchain-ai/langchain · 4,469 tokens