Skip to content
mcp-retrieval

Model Context Protocol server

Web search for your LLM.
No API keys.

An MCP server in Go that exposes web_search, web_search_images and web_scrape to any MCP client. It runs locally, it is free, and it is fast.

bash
docker pull ghcr.io/role1776/mcp-retrieval:latest

No Go toolchain needed.

  • MIT licence
  • Go 1.25+
  • stdio & HTTP
  • In the MCP Registry

Tools

Three read-only tools

Each returns a structured JSON payload matching its output schema. The SDK mirrors the same JSON into the text content block for clients that do not read structuredContent.

web_search

Runs one or more queries in parallel and returns per-query deduplicated, reranked snippets with links.

Parameters for web_search
ParameterTypeDefault
queries[]string
max_resultsint5
timeout_msint645000
datestring
queries
Required. Executed in parallel.
max_results
Snippets per query, capped at MAX_RESULTS (20).
timeout_ms
Whole-call timeout; clamped to [min, max] from config.
date
Freshness filter: d (day), w (week), m (month), y (year).

web_search_images

Runs one or more image queries in parallel and returns per-query deduplicated image results.

Parameters for web_search_images
ParameterTypeDefault
queries[]string
max_imagesint5
timeout_msint645000
datestring
queries
Required. Executed in parallel.
max_images
Images per query, capped at MAX_IMAGES (10).
timeout_ms
Whole-call timeout; clamped to [min, max] from config.
date
Freshness filter: d / w / m / y.

web_scrape

Downloads one or more pages in parallel and returns the main article text as Markdown.

Parameters for web_scrape
ParameterTypeDefault
urls[]string
robots_txtboolfalse
timeout_msint645000
remove_linksboolfalse
max_charsint20000
urls
Required. Downloaded in parallel.
robots_txt
Respect the page's robots.txt.
timeout_ms
Whole-call timeout; clamped to [min, max] from config.
remove_links
Strip Markdown links from the text.
max_chars
Truncate page text to N characters, capped at MAX_DOCUMENT_CHARS (20000).

Both queries and urls lists are capped at MAX_QUERIES (10) items per call. Queries must be 512 characters or fewer; URLs 2048 or fewer, and http or https only. Every call returns one entry per query or URL, each with its own statussuccess, failed or timeout — so a partial failure still returns the items that did work.

Why

Why mcp-retrieval

A hosted search API bills per query and holds a key you have to manage. This is the other shape of the same capability: a binary you run.

  • No API keys

    Web search goes through DuckDuckGo Lite, image search through Bing Images. There is nothing to sign up for and no key to rotate.

  • Free and local

    One static binary or one container on your own machine rather than a hosted endpoint. No account, no per-query billing, no quota.

  • Fast

    Written in Go and shipped as a single binary. Every call fans out across the whole query or URL list concurrently, with per-item timeouts.

  • Idiomatic and layered

    Clean architecture with dependencies pointing inward toward the domain, each layer talking to the next through interfaces. Contributions gate on go build, go vet and go test all green.

  • Model-ready output

    Pages come back as readability-extracted Markdown, not raw HTML. Partial failures still return whatever worked, each item carrying its own success, failed, or timeout status.

Setup

Connect a client

Point your MCP client at the binary or the container. Clients that install from the MCP Registry build the invocation themselves and prompt for the variables declared in server.json.

json
{
  "mcpServers": {
    "retrieval": {
      "command": "/absolute/path/to/app",
      "env": {
        "MAX_RESULTS": "20"
      }
    }
  }
}

The env block is optional — command alone is enough.

Engine

Retrieval engine

All network work is delegated to retrieval-go. What it does on the way out is the reason the free sources stay reachable.

Sources

Web search uses DuckDuckGo Lite. Image search uses Bing Images. Page fetching runs the raw HTML through a readability extractor and converts the main article to Markdown, tables included.

No search-engine API keys are required.

Browser impersonation

Each request is sent from one of about eleven real browser profiles, picked at random. Every profile pairs a genuine TLS/JA3 fingerprint, via uTLS, with a matching User-Agent and client-hint headers.

Chrome 133/131/120 on Windows, macOS and Linux; Edge 131; Firefox 120 on Windows and macOS; Safari 18.4 on macOS; and iOS 18.4 Safari. Traffic looks like an ordinary browser rather than a Go HTTP client, which is what keeps the free sources reachable.

Response handling

Responses are transparently decompressed: gzip, br, zstd and deflate.

Keep-alive is disabled, so a pooled connection cannot pin a single fingerprint or exit IP across requests.

Proxy rotationoptional

Set PROXY_SCHEME, PROXY_HOST, PROXY_PORT, PROXY_LOGIN and PROXY_PASSWORD, and the adapter installs a proxy factory that appends a unique session-<id> to the proxy login on every request.

With a session-based residential provider that yields a fresh exit IP per request, spreading load and avoiding rate limits. Without a proxy, requests go out directly.

On the cost of that traffic

Search and scrape move small text responses, not video. On a cheap pay-as-you-go residential plan the bandwidth cost of a thousand queries is therefore an order of magnitude below what a hosted search API charges per-query for the same thousand.

The repository does not measure this, so no figure is quoted here — check it against your own provider’s rate.

None of this needs configuration to work. The defaults are applied automatically; only the proxy credentials are optional extras.

Configuration

Environment variables

Everything is configured through environment variables, validated before startup. Variables already present in the environment win over the .env file, so an MCP client's env block always takes effect. Every field has a default, so the server runs with no configuration at all.

MCP server

4
Environment variables in the MCP server group, with defaults.
EnvDefaultNotes
MCP_TRANSPORTstdiostdio or http.
MCP_NAMEmcp-retrievalServer name advertised to clients.
MCP_VERSION0.1.1Server version advertised to clients. Identifies the build.
MCP_PATH/mcpHTTP route (http transport only).

HTTP server

http transport only.3
Environment variables in the HTTP server group, with defaults.
EnvDefault
SERVER_PORT8080
SERVER_READ_TIMEOUT60s
SERVER_WRITE_TIMEOUT60s

HTTP client and proxy

6
Environment variables in the HTTP client and proxy group, with defaults.
EnvDefaultNotes
MAX_IDLE_CONNS_PER_HOST100HTTP connection pooling.
PROXY_HOSTOptional. If set, requests are routed through a rotating-session proxy.
PROXY_PORTRequired when PROXY_HOST is set.
PROXY_SCHEMERequired when PROXY_HOST is set.
PROXY_LOGINRequired when PROXY_HOST is set.
PROXY_PASSWORDRequired when PROXY_HOST is set.

Limits

10
Environment variables in the Limits group, with defaults.
EnvDefault
MAX_QUERIES10
DEFAULT_RESULTS5
MAX_RESULTS20
DEFAULT_TIMEOUT_MS5000
MAX_TIMEOUT_MS10000
MIN_TIMEOUT_MS1000
DEFAULT_IMAGES5
MAX_IMAGES10
DEFAULT_DOCUMENT_CHARS20000
MAX_DOCUMENT_CHARS20000

Logging

1
Environment variables in the Logging group, with defaults.
EnvDefaultNotes
LOG_MODElocallocal → text handler at debug level; prod → JSON handler at info level. Logs go to stderr.

The one command-line flag is -env, a path to a .env file. If it is omitted, or the file does not exist, the server starts on defaults and whatever is already in the environment. Full reference in the README.