Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add instructions/uk0/web-search-fast/claude-mdgit clone --depth 1 https://github.com/uk0/web-search-fastWrote 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/uk0/web-search-fast/claude-md)<a href="https://agentmods.dev/instructions/uk0/web-search-fast/claude-md"><img src="https://agentmods.dev/badge/instructions/uk0/web-search-fast/claude-md.svg" alt="Measured on agentmods" 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 | $0.02256 | $0.02256 |
| Opus 5 | $0.01128 | $0.01128 |
| Sonnet 5 | $0.00451 | $0.00451 |
| Haiku 4.5 | $0.00226 | $0.00226 |
Grade A, and why
web-search-fast 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 5d 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.
How it starts
The opening of the file, as written. The whole thing — 222 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Web Search MCP
项目概述
基于 Camoufox + FastAPI 的高性能 Web 搜索服务,将搜索引擎结果转换为结构化 JSON / Markdown 输出。支持 MCP 协议(Streamable HTTP)供 LLM 客户端直接调用,同时提供 Admin 管理面板。
当前版本
v0.3.6 — 2026-02-23
技术栈
| 组件 | 技术 | 用途 |
|---|---|---|
| Web 框架 | FastAPI + Uvicorn + Starlette | HTTP API + MCP 服务 |
| MCP 框架 | FastMCP (mcp>=1.25.0) | MCP 协议实现(stdio / SSE / HTTP) |
| 浏览器引擎 | Camoufox (Playwright) | 反检测 Firefox 浏览器抓取 |
| 异步运行时 | asyncio | 并发调度 |
| HTML 解析 | BeautifulSoup4 / lxml | 页面内容提取 |
| 内容转换 | markdownify | HTML → Markdown |
| 数据库 | SQLite (aiosqlite) | 搜索日志、API Key、IP 封禁 |
| 缓存 | Redis (可选) | IP 封禁缓存 |
| Admin 前端 | React + Vite + Tailwind CSS | 管理面板 SPA |
| 数据校验 | Pydantic v2 | 请求/响应模型 |
核心功能
MCP Tools(3 个)
| Tool | 说明 | 超时 |
|---|---|---|
web_search |
搜索引擎查询,返回 Markdown | 25s |
get_page_content |
获取单个 URL 页面内容 | 20s |
list_search_engines |
列出可用引擎和浏览器池状态 | — |
搜索引擎
- DuckDuckGo(推荐默认)— HTML-lite 模式,稳定可靠
- Google — JS DOM 提取,含首页预热 + 验证码检测 + 同意弹窗处理,被拦截时自动回退
- Bing —
global.bing.com避免地域重定向,含 URL 解码
搜索深度(depth)
| 层级 | 行为 | 说明 |
|---|---|---|
depth=1 |
SERP 解析 | 默认。提取标题、链接、摘要 |
depth=2 |
SERP + 正文抓取 | 进入每个结果链接,提取页面正文 |
depth=3 |
SERP + 正文 + 外链 | 继续抓取正文中的外部链接内容 |
Camoufox 指纹浏览器
内置功能(默认启用):GeoIP 伪装、人性化操作、图片阻止、Locale 匹配
可配置功能(环境变量):
| 环境变量 | 说明 |
|---|---|
BROWSER_POOL_SIZE |
浏览器并发数 |
BROWSER_PROXY |
代理服务器(socks5/http) |
BROWSER_OS |
目标 OS 指纹(windows/macos/linux) |
BROWSER_FONTS |
自定义字体列表 |
BROWSER_BLOCK_WEBGL |
阻止 WebGL 指纹 |
BROWSER_ADDONS |
Firefox 插件路径 |
Admin 管理面板
- Dashboard 统计、搜索历史、IP 监控、API Key 管理
- 三层中间件:SearchLogMiddleware → APIKeyAuthMiddleware → IPBanMiddleware
- SQLite 持久化 + Redis 可选缓存
项目结构
web-search-mcp/
├── CLAUDE.md
├── pyproject.toml
├── README.md
├── Dockerfile / Dockerfile.dev
├── docker-compose.yml
├── scripts/
│ └── mcp-server.sh # MCP 注册/更新脚本
├── src/
│ ├── __init__.py
│ ├── main.py # FastAPI 入口
│ ├── mcp_server.py # MCP 服务入口(FastMCP + 中间件 + Admin)
│ ├── config.py # 配置管理(BrowserConfig / AppConfig / AdminConfig)
│ ├── api/
│ │ ├── routes.py # HTTP API 路由
│ │ └── schemas.py # Pydantic 请求/响应模型
│ ├── core/
│ │ └── search.py # 框架无关的搜索逻辑(MCP + HTTP 共用)
│ ├── engine/
│ │ ├── base.py # 搜索引擎抽象基类 + 诊断日志
│ │ ├── google.py # Google(JS DOM 提取 + 预热 + 验证码)
│ │ ├── bing.py # Bing(global.bing.com + URL 解码)
│ │ └── duckduckgo.py # DuckDuckGo(HTML-lite 模式)
│ ├── scraper/
│ │ ├── browser.py # BrowserPool(tab-per-search 隔离)
│ │ ├── parser.py # HTML 内容解析
│ │ └── depth.py # 多层深度抓取(domcontentloaded + 时间预算)
│ ├── formatter/
│ │ ├── json_fmt.py # JSON 格式化
│ │ └── markdown_fmt.py # Markdown 格式化
│ ├── admin/
│ │ ├── database.py # SQLite 初始化 + 迁移
│ │ ├── models.py # Admin 数据模型
│ │ ├── repository.py # 数据访问层(API Key / IP Ban / 搜索日志)
│ │ ├── routes.py # Admin REST API 路由
│ │ └── static/ # Admin SPA 构建产物
│ └── middleware/
│ ├── api_key_auth.py # Bearer Token 认证(DB + 环境变量)
│ ├── ip_ban.py # IP 封禁中间件
│ └── search_log.py # 搜索日志 ASGI 中间件
├── admin-ui/ # Admin 前端源码(React + Vite + Tailwind)
├── tests/
│ ├── test_api.py
│ ├── test_engine.py
│ ├── test_scraper.py
│ ├── test_formatter.py
│ ├── test_admin_api.py
│ ├── test_browser_pool.py
│ └── test_middleware.py
└── docs/
├── CHANGELOG.md
└── tasks/
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.
- 5d ago First seen · 222 lines · 2,256 tokens per session scan A 1c78f5235f3c
web-search-fast CLAUDE.md is an instructions file published in the GitHub repository uk0/web-search-fast (70 stars, last pushed 20d ago), licensed MIT. It adds 2,256 tokens to every session, about $0.0113 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.
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.
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).