IS

ihor-sokoliuk/mcp-searxng

Developer tools
1.3K stars 168 forks Quality 89 Trend 46MIT

Private web search for AI assistants via SearXNG — supports Claude, Cursor, and any MCP client

Overview

An MCP server that integrates the SearXNG API, giving AI assistants web search capabilities. Add to your MCP client configuration (e.g. claude_desktop_config.json): Replace YOUR_SEARXNG_INSTANCE_URL with the URL of your SearXNG instance (e.g. https://searxng.example.com). You can also provide interchangeable replicas as a semicolon-separated list, e.g. https://one.example.com;https://two.example.com. - : General queries, news, articles, with pagination. - : Configure multiple interchangeable SearXNG replicas in SEARXNG_URL; searches fail over by default and can optionally fan out in parallel. - : Choose formatted text or raw SearXNG-shaped JSON with response_format. - : Text results surface SearXNG answers, corrections, suggestions, and infoboxes before result lists. - : Query autocomplete via SearXNG's /autocompleter endpoint. - : Inspect configured categories, engines, defaults, locales, and plugins from /config.

README

Quick Start

You need an existing SearXNG instance with JSON search enabled. This project connects an MCP client to SearXNG; it does not install SearXNG. Use an instance you operate or trust. Start with the self-hosted or public-instance guide if needed.

Choose how to connect:

Your setup Start here
Client starts the server locally Install Node.js 22 or later, then use the NPX example below or your client recipe.
Client starts a Docker container Use the Docker/STDIO recipe in Installation.
You have an independently running HTTP service Use your client’s HTTP recipe with the full /mcp URL.
You need to operate an HTTP service Follow the HTTP server guide.

For clients using mcpServers JSON (such as Claude Desktop), add:

{
  "mcpServers": {
    "searxng": {
      "command": "npx",
      "args": ["-y", "mcp-searxng"],
      "env": { "SEARXNG_URL": "https://search.example.com" }
    }
  }
}

Replace the example URL with your SearXNG base URL. Other clients use different configuration shapes: choose your client recipe. Leave MCP_HTTP_PORT unset for local STDIO. Docker also needs environment forwarding into the container.

Reload the client, inspect its MCP tool inventory, then ask it to search for SearXNG documentation. A simple tool call is searxng_web_search with {"query":"SearXNG"}. Discovery alone does not test SearXNG connectivity. If the call fails, start with troubleshooting.

Features

  • Search with pagination, filters, direct answers and full or compact text/JSON output.
  • Read HTML, structured text and bounded PDF text; inspect headings or selected sections.
  • Discover instance capabilities and get query suggestions.
  • Optional replica failover/fan-out, HTML fallback, caching, proxies and browser solvers.
  • Local STDIO or Streamable HTTP, with static bearer and optional OAuth protection.

See the tool guide for capabilities and limits, configuration reference for settings, and historical deployment measurements for bounded resource-planning evidence.

Why mcp-searxng?

Privacy depends on the SearXNG deployment. An operator-controlled instance can avoid trusting a third-party search operator, while a public instance receives the query and may log it. SearXNG and this MCP integration do not by themselves provide anonymity.

How It Works

MCP client → mcp-searxng → SearXNG → search engines

The client either starts its own STDIO process or connects to an HTTP service. SEARXNG_URL identifies the SearXNG service, not the MCP endpoint. URL reading fetches the selected website directly. A semicolon-separated replica list is supported for interchangeable SearXNG deployments; see replica configuration.

STDIO is the default. Legacy Streamable HTTP sessions are stateful by default: clients should send DELETE /mcp when finished, then reinitialize if a later request receives HTTP 404 for the terminated session. Modern HTTP requests and the MCP_HTTP_STATELESS=true legacy mode are sessionless; see HTTP transport configuration.

Tools

Tool Use it to
searxng_web_search Find sources and refine results
searxng_search_suggestions Complete or refine a query
searxng_instance_info Inspect categories, engines and defaults
web_url_read Read a known URL as text/Markdown

The tool guide contains examples and the full parameter reference. The optional research workflow explains how to inspect sources and cite evidence.

Installation

The project-maintained distribution methods are npm (including npx) and Docker. Additional package formats, including Nix, can be maintained separately by the community.

For NPX and npm installs, Node.js 22 or later is required. The Docker image includes its Node.js runtime.

HTTP Transport

Run HTTP independently, then connect the client. See the HTTP server guide for local checks, static bearer authentication, OAuth requirements and deployment verification.

Configuration

For the default local setup, SEARXNG_URL is the required setting. Optional modes such as hardened HTTP and OAuth have companion requirements. Use the configuration reference for environment variables, defaults, caching, timeouts, proxies, TLS, and limits.

Optional MCP OAuth

An HTTP deployment can use OAuth with an external authorization provider. See authentication choices. Static bearer authentication and SearXNG Basic Auth protect different connections.

Troubleshooting

Symptom Next check
Server absent or disconnected Client/process startup
HTTP auth, session or proxy error HTTP connection
Tools appear but search fails SearXNG connection
Empty, poor or stale results Filters, upstream metadata and cache
URL/PDF failure or timeout URL reading

403 Forbidden from SearXNG

JSON output may be disabled, or an access-control layer may have denied the request. Follow the direct checks before changing settings. A working browser page does not prove the JSON API works.

Can’t enable JSON? (HTML fallback)

SEARXNG_HTML_FALLBACK=true can retry 403/404/non-JSON search responses as HTML. Parsing is best-effort and metadata is limited; compact output omits fallback markers. Read the public-instance guidance before enabling it on a service you do not control.

For a bug report, collect a minimal reproduction and relevant errors.

Documentation

Configure search for useful coverage with tested upstream settings, specialist engine routes and MCP output controls. The deployment recipe includes a private Compose stack and optional browser providers, with dated results and known failures.

Find a guide by task. These links open current main-branch documentation. Unreleased behavior is labeled; consult the matching Git tag when investigating an older version.

Contributing

See CONTRIBUTING.md.

License

MIT — see LICENSE for details.

View the full README on GitHub

Install

npx -y mcp-searxng
New to MCP? Start with the mcpskill.org guide →

Configuration

{ "mcpServers": { "searxng": { "command": "npx", "args": ["-y", "mcp-searxng"], "env": { "SEARXNG_URL": "https://search.example.com" } } } }