Skip to main content

SearchFetch (MCP Server)

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)

{
  "mcpServers": {
    "searchfetch": {
      "command": "uvx",
      "args": ["searchfetch"]
    }
  }
}

Option B: Node.js (npx)

{
  "mcpServers": {
    "searchfetch": {
      "command": "npx",
      "args": ["-y", "searchfetch"]
    }
  }
}

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.

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

Available page templates (auto-detected by URL or selectable 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 — special template that applies minimal filtering and returns full body content as markdown. Use when you need the complete page without template-specific extraction.


Local Development

# Install dependencies
npm ci
uv sync --locked --extra dev

# Run tests
npm test                # runs all tests (JS + Python)
npm run test:js         # Node.js unit tests (built-in test runner)
npm run test:py         # Python unit tests (pytest)

# Lint
npm run lint            # runs all linters
npm run lint:js         # ESLint
npm run lint:py         # Ruff

# Format
npm run format          # auto-format all source files
npm run format:check    # check formatting without changes

# MCP inspector (for manual testing)
npm run inspector-js    # test with MCP Inspector (Node.js)
npm run inspector-py    # test with MCP Inspector (Python)

Architecture

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

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

index.js and server.py contain the runtime-specific browser and MCP integration. lib/ and selectors_utils.py hold focused formatting and selector helpers. Both runtimes read the same templates/*.json; Python wheels bundle these as searchfetch_templates resources. Shared fixtures in tests/fixtures/ exercise extraction behavior in both runtimes.

Selectors separated by top-level commas are ordered fallbacks. Commas inside CSS functions or attributes are preserved; an empty fallback selects the current element. Child extraction searches descendants and enclosing elements, without borrowing fields from neighboring results. Missing required fields and malformed selectors report errors.

Verification and limits

npm test, npm run lint, and npm run format:check check both runtimes. npm run e2e runs real browser requests against local HTTP fixtures, exercises every built-in template, and checks the installed npm executable and Python wheel. Public search-engine availability and changing third-party page layouts require separate live checks. A page that continues rendering beyond the bounded wait may return partial content.

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

Metadata

Release files for searchfetch 3.3.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for searchfetch 3.3.4
File Size Uploaded
searchfetch-3.3.4.tar.gz 21.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for searchfetch 3.3.4
File Interpreter ABI Platform
searchfetch-3.3.4-py3-none-any.whl Python 3 none any Details

Total release size: 51.3 kB

Release files / searchfetch-3.3.4.tar.gz

Download URL searchfetch-3.3.4.tar.gz
Size 21.9 kB
Tags Source
SHA-256 checksum
How to use checksums
9fca2d6e87b6ec2b8a0880997209f3b1423a02f77c6f371f5612e663ecf7d138
BLAKE2b-256 checksum
How to use checksums
c9e3d8c1f5df2a7fc1623df907d103274a35590ac487fb06481fe42b255cbcb8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 15, 2026.

Transparency log

Release files / searchfetch-3.3.4-py3-none-any.whl

Download URL searchfetch-3.3.4-py3-none-any.whl
Size 29.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
63c11bdb22bd2eedfc4daf0031c046eb649f89b4938f17600b7d7aedcf42a1de
BLAKE2b-256 checksum
How to use checksums
5afa1c3f4e5bacc59bbfea79542b79f460e0ea087ef62bd0055e6fa0528cf21b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 15, 2026.

Transparency log

Release history Release notifications | RSS feed

4.0.0

2 release files

This release

3.3.4 This release

2 release files

3.3.3

2 release files

3.3.2

2 release files

3.3.1

2 release files

3.3.0

2 release files

3.2.3

2 release files

3.2.2

2 release files

3.2.1

2 release files

3.2.0

2 release files

3.1.0

2 release files

3.0.1

2 release files

3.0.0

2 release files

2.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page