SearchFetch (MCP Server)
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
A fault-tolerant, stealth-enabled Model Context Protocol (MCP) server for web searching and content fetching. Built for AI Agents (Cursor, Claude Code, OpenCode), it uses a browser to render pages and converts their content into Markdown.
Features
- **Browser rendering:** CloakBrowser runs Chromium with humanized interactions. Sites can still require authentication or present challenges.
- **Fault tolerance:** Reconnects disconnected browsers, retries network failures and HTTP 429 once, and blocks template-selected resource types. HTTP errors are reported before waiting for rendering.
- **Token-Optimized Output:** Strips base64 images, SVGs, scripts, and inline styles from the DOM _before_ Markdown conversion.
- **Dual runtime:** Run through Python (uvx, Python 3.10+) or Node.js (npx, Node 24+). First use downloads dependencies and a browser binary.
- **Template-Driven Extraction:** Structured extraction via shared JSON templates (GitHub, npm, PyPI, crates.io, docs pages, Docker Hub, and more). Supports custom inline templates.
---
Usage & Installation
You do not need to install this repository manually. Configure your agent to use the zero-install commands npx or uvx.
Claude Desktop Configuration
**Option A: Python (uvx - Recommended)**
**Option B: Node.js (npx)**
Cursor / IDE Configuration
Add via the **MCP panel** in Cursor settings:
- **Type:** command
- **Command:** uvx searchfetch (or npx -y searchfetch)
---
Available Tools
1. websearch
Search the web through the template pipeline. DuckDuckGo and Google are built-in; custom search templates can be selected by name.
| Parameter | Type | Default | Description |
| ------------- | ------------ | -------------- | ---------------------------------------------------------------------------------------------- |
| query | string | _required_ | The search query string. |
| engine | string | "duckduckgo" | "duckduckgo", "google", or a custom search template name. |
| max_results | number | 10 | Positive integer limit on extracted results. |
| region | string/null | null | Region/language code (e.g. "us-en", "de-de"). DDG maps directly; Google maps to gl/hl. |
| safe_search | boolean/null | null | Enable safe search. null uses the template default. |
| block_media | boolean | true | Block images, media, and fonts at the network layer. |
2. webfetch
Fetch a page with the stealth browser and extract structured Markdown using a template. Falls back to generic Markdown extraction for unknown pages.
| Parameter | Type | Default | Description |
| ------------- | ------- | ---------- | ----------------------------------------------------- |
| url | string | _required_ | Full URL (must start with http/https). |
| template | string | "auto" | "auto", a built-in name, or inline JSON template. |
| start_index | number | 0 | Nonnegative integer offset in Unicode code points. |
| max_length | number | 10000 | Positive integer limit in Unicode code points. |
| block_media | boolean | true | Block images, videos, and fonts at the network layer. |
Template extraction supports text, markdown, attribute, and html formats; child fields within a section; repeated sections; URL-decoding transforms; per-template cookies; and per-template resource blocking.