SuperAPIAI Directory

searchfetch

github.com · AI developer platforms

Fault-tolerant, stealth-enabled web search and content fetching.

Open website Alternatives
PricingOpen source开源项目(可免费自部署)
PlatformsLinux

About this tool

SearchFetch is a fault-tolerant, stealth-capable Model Context Protocol (MCP) server for web search and content scraping. It is built for AI agents (such as Cursor, Claude Code, OpenCode), uses a browser to render pages and converts content to Markdown.

Key Capabilities

  • Browser rendering: CloakBrowser runs Chromium and simulates human interaction. Websites may still require authentication or present challenges.
  • Fault tolerance: Reconnects disconnected browsers, retries network failures and HTTP 429 once, and blocks resource types selected by templates. HTTP errors are reported before waiting for rendering.
  • Token-optimized output: Strips base64 images, SVG, scripts, and inline styles from the DOM before Markdown conversion.
  • Dual runtime: Runs via Python (uvx, Python 3.10+) or Node.js (npx, Node 24+). First use downloads dependencies and browser binaries.
  • Template-driven extraction: Structured extraction via shared JSON templates (GitHub, npm, PyPI, crates.io, documentation pages, Docker Hub, etc.). Supports custom inline templates.

Usage and Installation

No manual installation of this repository is required. 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:

Command: uvx searchfetch (or npx -y searchfetch)

Available Tools

  • Search the web via template pipelines. DuckDuckGo and Google are built in; custom search templates can be selected by name.
  • Scrape pages using a stealth browser and extract structured Markdown using templates. For unknown pages, fall back to generic Markdown extraction.

Template extraction supports text, markdown, attribute, and html formats; subfields within sections; repeated sections; URL decoding transformations; per-template cookiess; as well as resource blocking for each template.

Built-in templates are located in templates/*.json and are shared by the Node.js and Python implementations.

Available page templates (auto-detected by URL or selected by name): wikipedia, reddit, mdn-web-docs, gitlab, youtube, devto, go-pkg, javadoc, github-repo, github-issue, npm-package, pypi-package, crates-package, docker-hub, docs-rs, docs-page.

raw — a special template that applies minimal filtering and returns the full body content as markdown. Use it when you need the complete page without template-specific extraction.

Local development

Both MCP servers expose websearch and webfetch over standard input/output:

  1. Validate tool input and parse built-in or inline JSON templates.
  2. Reuse one browser, creating an isolated browser context for each fetch attempt.
  3. Apply template cookies and resource blocking, navigate, check the HTTP status, and allow up to five seconds for network activity to settle.
  4. Remove configured elements, extract section fields, apply transformations, and assemble Markdown. Page templates may first try the raw Markdown source URL.
  5. Paginate page output using Unicode code points. Search requests can fall back from Google to DuckDuckGo HTML, then to Lite; the output indicates any fallback engine.

index.js and server.py contain runtime-specific browser and MCP integration. lib/ and selectors_utils.py contain focused formatting and selector helper utilities. Both runtimes read the same templates/*.json; the Python wheels package these as the searchfetch_templates resource. The shared fixtures in tests/fixtures/ test extraction behavior in both runtimes.

Top-level comma-separated selectors are ordered fallbacks. Commas inside CSS functions or properties are preserved; an empty fallback selects the current element. Sub-extraction searches descendants and enclosing elements, and does not borrow fields from adjacent results. Missing requiredfields and malformed selectors report errors.

Validation and limitations

npm test, npm run lint, and npm run format:check check both runtimes. npm run e2e runs real browser requests against local HTTP fixtures, tests every built-in template, and checks the installed npm executable and the Python wheel. Changes in public search engine availability and third-party page layouts require separate live checks. Pages that continue rendering after a limited wait may return partial content.

package-lock.json and uv.lock record dependency resolution.

Up/Down to navigate · Enter to open · ESC to closeBrowse all tools