Skip to main content
Glama
maxylev

MCP Server for Stealth Web Search and Fetching

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.


Related MCP server: markdown-for-agents-mcp

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.

Available Tools

2 tools
webfetchWeb FetchA

Fetch and extract the main text content from any webpage. Fully executes JavaScript to load React/SPAs and aggressively strips images/media (including base64) to save context tokens.

ParametersJSON Schema
NameRequiredDescriptionDefault
urlYesThe full URL of the webpage to fetch (must start with http/https).
templateNoTemplate to use: 'auto' (auto-detect from URL), a built-in page template 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' for minimal-filtering full-page output, or inline JSON.auto
max_lengthNoMaximum characters to return per request. Default is 10000.
block_mediaNoBlock images, videos, and fonts entirely at the network layer. Default is true.
start_indexNoCharacter offset for pagination. Default: 0.

TDQS

A3.5/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full behavioral burden. It explicitly discloses two significant traits: full JavaScript execution to load React/SPAs and aggressive stripping of images/media to save context tokens. It does not cover failure modes, redirects, or output format, but it goes well beyond the schema.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences with zero wasted words. The primary purpose is front-loaded, and the behavioral caveat fills the second sentence. Every phrase earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description covers core behavior and a key side effect, and the schema handles all parameters. However, it omits usage guidance relative to the sibling websearch and does not mention the return format, pagination behavior, or how output is structured, leaving an agent to make assumptions.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema documents all five parameters with 100% description coverage, so the baseline of 3 applies. The description itself adds no parameter-level meaning beyond the schema, and no parameter is left undocumented.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The first sentence names a specific verb ('Fetch and extract'), a resource ('main text content'), and a scope ('any webpage'). It is clear and not tautological, but it does not explicitly contrast with the sibling tool websearch, so it falls short of full differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives no guidance on when to use webfetch versus websearch. There are no prerequisites, excluded cases, or alternative-routing hints, so the agent must infer appropriate usage from the schema and tool name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

websearchWeb SearchA

Search the web using DuckDuckGo or Google. Returns a clean list of titles, URLs, and snippets. Excellent for researching general knowledge, news, and finding URLs.

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYesThe search query string.
engineNoSearch engine to use. Can be 'duckduckgo' or 'google'. Default is 'duckduckgo'.duckduckgo
regionNoRegion and language code to localize search results (e.g., 'us-en', 'uk-en', 'de-de'). For DuckDuckGo it maps directly. For Google, 'us' is country code and 'en' is language. Default is null (uses template default).
block_mediaNoBlock images, videos, and fonts entirely at the network layer. Default is true.
max_resultsNoMaximum number of search results to return. Default is 10.
safe_searchNoEnable safe search filtering. null = use template default. Applies to both DuckDuckGo and Google.

TDQS

A3.8/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden of behavioral disclosure. It does reveal that results are a clean list of titles, URLs, and snippets and that DuckDuckGo or Google may be used. However, it omits behavioral nuances such as network-layer media blocking, safe-search defaults, and engine-specific behavior, which would make behavior more transparent.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences long with no filler. The first sentence states the action and output format; the second adds use cases. It is front-loaded and every phrase earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a relatively simple search tool, the description plus fully documented schema covers essentials: what it does, what it returns, and when it is useful. The main missing piece is explicit differentiation from the sibling webfetch, but this is a minor gap given the straightforward nature of the tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, and each parameter already has a detailed description with defaults and accepted formats. The tool description adds no parameter-specific guidance beyond situating the tool for general research, so the baseline of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Search the web') and the resource, names the two engines used, and describes the output as a clean list of titles, URLs, and snippets. It does not explicitly contrast with sibling webfetch, so it falls just short of a 5, but the core purpose is unmistakable.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It provides clear context on when the tool is appropriate ('general knowledge, news, and finding URLs'). It does not explicitly state when not to use it or point to webfetch as the alternative for fetching page content, so it lacks explicit exclusions/alternatives that would earn a 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 2 tool updatesv3.3.4
    • Changedwebfetch7 fields changed
      • addedInput schema / properties / max_length / exclusiveMinimum
        Added value: +0
      • addedInput schema / properties / max_length / maximum
        Added value: +9007199254740991
      • changedInput schema / properties / max_length / type
        Previous value: -"number"New value: +"integer"
      • addedInput schema / properties / start_index / maximum
        Added value: +9007199254740991
      • addedInput schema / properties / start_index / minimum
        Added value: +0
      • changedInput schema / properties / start_index / type
        Previous value: -"number"New value: +"integer"
      • addedInput schema / properties / url / format
        Added value: +"uri"
    • Changedwebsearch8 fields changed
      • addedInput schema / properties / max_results / exclusiveMinimum
        Added value: +0
      • addedInput schema / properties / max_results / maximum
        Added value: +9007199254740991
      • changedInput schema / properties / max_results / type
        Previous value: -"number"New value: +"integer"
      • addedInput schema / properties / query / minLength
        Added value: +1
      • removedInput schema / properties / region / anyOf
        Removed value: -[
        -  {
        -    "type": "string"
        -  },
        -  {
        -    "type": "null"
        -  }
        -]
      • addedInput schema / properties / region / type
        Added value: +[
        +  "string",
        +  "null"
        +]
      • removedInput schema / properties / safe_search / anyOf
        Removed value: -[
        -  {
        -    "type": "boolean"
        -  },
        -  {
        -    "type": "null"
        -  }
        -]
      • addedInput schema / properties / safe_search / type
        Added value: +[
        +  "boolean",
        +  "null"
        +]
  2. 2 tool updatesv3.3.2
    • First observedwebfetch
    • First observedwebsearch

TDQS

A3.8/5.0

Scored across 2 tools

Disambiguation5/5

The two tools have clearly distinct purposes: websearch discovers URLs and snippets via search engines, while webfetch extracts content from a specific webpage. There is no overlap or ambiguity about which tool to use.

Naming Consistency5/5

Both names follow the same predictable pattern: a 'web' prefix combined with a clear action verb (search, fetch). The lowercase concatenated style is consistent across the entire toolset.

Tool Count3/5

With only two tools, the surface feels minimal and borderline thin, even though each tool covers a necessary core capability. The count is reasonable for the narrow search-and-fetch purpose but sits at the low end of the expected range.

Completeness4/5

The tools form a natural search-then-fetch workflow with no dead end: websearch provides URLs, and webfetch retrieves page content. Minor gaps exist, such as no explicit pagination or advanced crawling tools, but the core domain is well covered.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    A production-ready Model Context Protocol server that brings AI-powered web search directly into development environments, providing intelligent search results with proper citations in Claude Desktop, Cursor, or any MCP-compatible client.
    74 npm
    23
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    MCP server for AI agents -- fetch any URL with full JavaScript rendering (Playwright/Chromium) and convert to clean, token-efficient markdown. Works on React, Vue, Angular, and any JS-heavy page. Includes web search, batch fetching, binary file download, LRU cache, SSRF protection, and structured output.
    16 npm
    MIT
  • A
    license
    A
    quality
    B
    maintenance
    MCP server for browser automation with anti-detection. Scout pages, find elements, interact with websites, and monitor network traffic from any AI client that supports the Model Context Protocol.
    21
    1
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    MCP server for web scraping and browser automation, enabling AI agents to extract clean, token-efficient content from web pages.
    1
    MIT