mcp-searxng is an MCP server that connects the SearXNG search API with AI assistants, giving MCP-enabled clients (such as Claude and Cursor) web search capabilities. Its positioning is "privacy-friendly web search for AI assistants," using a SearXNG instance operated or trusted by the user.
Purpose and Prerequisites This project is only responsible for connecting MCP clients to SearXNG; it does not install SearXNG itself. Before use, a SearXNG instance with JSON search enabled is required. Users can choose a self-hosted instance or use a trusted public instance; the degree of privacy depends on how SearXNG is deployed: a self-controlled instance avoids trusting a third-party search operator, while a public instance will receive queries and may log them. The project explicitly states that SearXNG and this MCP integration themselves do not provide anonymity.
Main Capabilities The project provides search functionality, supporting pagination, filters, direct answers, and full or compact text/JSON output. It can read HTML, structured text, and bounded PDF text, and can view titles or selected sections. It supports discovering instance capabilities and obtaining query suggestions. It also provides optional replica failover/fan-out, HTML fallback, caching, proxying, and a browser solver. Transport methods support local STDIO or Streamable HTTP, and provide a static bearer and optional OAuth protection.
Usage For clients that use mcpServers JSON configuration (such as Claude Desktop), add the corresponding entry in the configuration and replace the example URL with your own SearXNG base URL. In the local STDIO scenario, do not set MCP_HTTP_PORT. The Docker scenario also requires forwarding environment variables into the container. After configuration is complete, reload the client, check its MCP tool list, and then have it search the SearXNG documentation. A simple tool call is searxng_web_search with the parameter {"query":"SearXNG"}. Merely discovering the tool does not test SearXNG connectivity; if the call fails, consult troubleshooting first. For Docker, a prebuilt image is provided; the image signature can be verified via Cosign. If you need to pass additional environment variables, add -e VAR_NAME in args, and in env List the corresponding variables. Browser solver integration can pass in FLARESOLVERR_URL, BYPARR_URL, or both, and ensure the configured service is reachable from that container. Dual mode uses a fixed FlareSolverr-first order, with no automatic reverse failover.
Architecture and Transport The call chain is: MCP client → mcp-searxng → SearXNG → search engine. The client either starts its own STDIO process or connects to the HTTP service. SEARXNG_URL identifies the SearXNG service, not the MCP endpoint. URL reading directly fetches the selected website. A semicolon-separated list of replicas is supported for interchangeable SearXNG deployments. STDIO is the default. Legacy Streamable HTTP sessions are stateful by default: the client should send DELETE /mcp when finished; if subsequent requests receive HTTP 404 (session terminated), reinitialization is required. Modern HTTP requests and legacy mode with MCP_HTTP_STATELESS=true are sessionless.
Resource Requirements and Deployment When installing with NPX and npm, Node.js 22 or later is required. The Docker image includes the Node.js runtime. The Compose file tracked in the project intentionally supports only STDIO and does not publish any network ports; MCP clients need to use the absolute Compose file path and start it via docker compose run --rm -T, not docker compose up; -T prevents allocating a pseudo-TTY, keeping MCP JSON-RPC on raw standard input/output. Unless the MCP client provides SEARXNG_URL, Compose will fail before startup. If the file was previously used as an HTTP service on port 8080, the HTTP settings can be placed in an untracked docker-compose.override.yml. This override method has no authentication and is only a temporary single-host migration path.
Optional OAuth and Common Issues HTTP deployments can use OAuth, together with an external authorization provider. Static bearer authentication and SearXNG Basic Auth protect different connections. Common failures include SearXNG returning403 Forbidden, possibly because JSON output is not enabled, or the access control layer rejected the request; being able to browse web pages normally does not prove that the JSON API is available. If JSON cannot be enabled, you can set SEARXNG_HTML_FALLBACK=true to retry 403/404/non-JSON search responses as HTML, but parsing is best-effort, metadata is limited, and compact output omits the fallback marker. When submitting bug reports, collect a minimal reproduction and the relevant error.
Other Information This project is listed in the GitHub MCP Registry. The project provides guidance by task, with links pointing to the current main branch documentation; unreleased behavior is marked, and when troubleshooting older versions, refer to the corresponding Git tag. The license is MIT.