Purpose
mcp-search is a self-hosted MCP server for web search scenarios. The core problem it addresses is this: search tools often fail in ways that look exactly like success—an engine returns content on someone else's topic, a page actually returns anti-bot shield text, sixteen sources are actually two engines counted eight times over. None of these cases throw an error, and downstream models keep building on that content. This server's job is to make these cases distinguishable and land them in fields that can be used for branching decisions. It runs on your own machine, based on your own metasearch instance, using your own model keys, or with no model keys at all.
Main capabilities
- Web search, page reading, image search, screenshots, and multi-turn deep research, with a confidence level given for each answer.
- Reports which engines were queried, and which content should be questioned.
- Distinguishes failure from success through branchable fields: engine failure has multiple modes, reading also has seven different outcomes, and pages that return an anti-bot shield are marked as stub rather than empty text.
- The engine list maintains itself: a prober continuously asks each known engine questions with known correct answers, and the engine pool takes the best several by citation hit rate and recalculates on its own. Before enough observations accumulate, the pool is a seed list, and every answer states this (by default trouble.pool_unmeasured, under verbose it shows pool_source).
- Controllable cost: a single parameter can make answer size differ by an order of magnitude; read: false is suitable for sorting out what content exists or working under a narrow context limit, and read_top: 0 means "no preference" rather than "do not read".
How to use
Deployed with Docker Compose, multiple environment variables need to be configured:
- SEARXNG_SECRET is required, otherwise the up command will refuse to execute; when you do not have your own key, metasearch will silently start with a publicly known key from the image template.
- BROWSER_WS_SECRET is the secret path for the browser sidecar endpoint, and up likewise refuses when it is missing; when the path is guessable, any container or page that can open a WebSocket can get its own browser.
- Two paths mounted by compose for caller authentication and TLS need to be created, both disabled by default; nonexistent paths will be created by Docker as root-owned directories.
- The override file only applies on the loopback addressPublishing port.
MCP has two access methods: HTTP is for servers already running somewhere; stdio is the protocol default, where the client starts the server as a process and communicates through pipes, one JSON-RPC object per line, one response per line. The mode must be chosen explicitly, never guessed from whether a terminal is connected. In stdio mode, stdout carries only protocol content, logs go to stderr, and any extra line will break the client's reading.
On the search engine side, SEARXNG_URL must be reachable, otherwise all searches are rejected with cause: upstream. The browser path reports not_wired_up when not connected, and carries pool_unmeasured on exceptions.
Applicable scenarios
- MCP clients and desktop tools that need web search and content reading in a self-hosted, controllable environment.
- Automated workflows that need to make branching judgments about the credibility of search results.
- Scenarios that need deep multi-round research, image search, and screenshot capabilities.
- Users who want search and reading not to consume model tokens, and only call the model during deep search and recognition of scanned PDFs.
Limitations
- The metasearch instance must be reachable, otherwise all searches fail.
- Without a model key, web_deep_search and recognition of PDFs without a text layer are unavailable; web_search does not call the model behind the scenes.
- When observations are insufficient, the engine pool is a seed list, and results are marked as unmeasured.
- An unreadable token file and an empty token file are not the same thing: an unreadable list rejects everyone in on mode and serves everyone in warn mode; a missing path is worse, Docker will create it as a directory.
- Secret files must be owned by uid 10001 with permissions 600; chmod 644 makes tokens and private keys readable by all users on the host.
- There is a failure that does not appear in regular monitoring: the browser sidecar accumulates processes, and when the number of headless_shell instances reaches thousands, the container runtime can no longer start processes, and all health checks report errors at the same time. The mitigation is to force-recreate browser; starting from 0.3.1 the image uses a real init to reap zombie processes.
Other information
For the complete parameter reference, response structure, and failure modes, see HOWTO-CALL.md. For the field mapping table, see contracts/ag.search.v3.md and contracts/ag.images.v3.md. The README documents the upgrade steps and variable changes for 0.3.3, 0.3.4, and 0.3.5.