Skip to main content

SearXNG metasearch engine MCP server

Project description

A self-contained MCP server that wraps SearXNG — a free, privacy-respecting metasearch engine that aggregates results from 200+ search engines.


🚀 Quick Start

Server mode — deploy once, connect from any client:

docker run -d --name searxng-mcp --restart unless-stopped \
  -p YOUR_PORT:8888 --memory=512m --cpus=1 \
  ghcr.io/whw23/searxng-http-mcp:latest

Then connect your client to http://YOUR_HOST:YOUR_PORT/mcp/. To enable API key auth, see Authentication.

Local mode — no server needed, run directly in your client:

docker run --rm -i --memory=512m --cpus=1 ghcr.io/whw23/searxng-http-mcp:latest --stdio

Add this as a stdio MCP server in your client — see Client Configuration for details.

uvx mode — if you already have SearXNG running (install guide):

uvx searxng-http-mcp

Set SEARXNG_URL to point to your SearXNG instance (default: http://127.0.0.1:8080).

✨ Features

Search

  • 🔍 200+ search engines — Google, Bing, DuckDuckGo, Brave, and more via SearXNG
  • 📂 30+ categories — news, images, videos, science, IT, and more
  • 📄 Multi-page fanout — up to 5 pages per call
  • 💡 Autocomplete suggestions — discover relevant search terms
  • 🗂 Engine discovery — query available engines grouped by category
  • 🎯 Token-efficient — results trimmed to essentials

Infrastructure

  • 📦 Self-contained — SearXNG built into Docker image
  • 🔄 Dual transport — HTTP (Streamable HTTP) and stdio
  • 🔐 Authentication — x-api-key + HTTP Basic Auth
  • 🌐 Reverse proxy — SearXNG Web UI on the same port
  • ⚡ Dynamic tool descriptions — live category lists injected at startup
  • 📐 Rich JSON Schema — enum constraints, range limits, and descriptions on every parameter
  • 🧩 Claude Code Plugin — self-hosted marketplace

🏛 Architecture

graph LR
  Client(["client:YOUR_PORT"]) --> Expose(":8888")

  subgraph Container["🐳 Docker Container"]
    direction LR
    Expose --> Auth{Auth}
    Auth -->|/mcp| MCP[FastMCP Server]
    Auth -->|/*| Proxy[Reverse Proxy]
    MCP --> SearXNG[SearXNG :8080]
    Proxy --> SearXNG
  end

  style Expose fill:none,stroke:#2496ed,stroke-dasharray:5 5,color:#2496ed

  style Client fill:#4a90d9,color:#fff,stroke:#3a7bc8
  style Container fill:#f0f4f8,stroke:#2496ed,stroke-width:2px,color:#2496ed
  style Auth fill:#f5a623,color:#fff,stroke:#d4900e
  style MCP fill:#50c878,color:#fff,stroke:#3da85e
  style Proxy fill:#9b59b6,color:#fff,stroke:#8344a5
  style SearXNG fill:#e74c3c,color:#fff,stroke:#c0392b

📊 Comparison with Alternatives

Why these five?

There are 20+ SearXNG MCP servers and many more general-purpose search MCPs. Most SearXNG wrappers only expose a basic search tool, leaving SearXNG's categories, autocomplete, and engine metadata unused. We picked five alternatives that each represent a distinct category:

  • 88plug/searxng-mcp — richest tool surface among SearXNG MCPs (7 tools: rendered fetch, research mode, parallel queries)
  • ihor/mcp-searxng — most GitHub stars among SearXNG MCPs
  • open-webSearch — top free multi-engine alternative outside the SearXNG ecosystem (Bing, Baidu, DuckDuckGo, Brave, etc.)
  • exa-mcp-server — most popular commercial search API MCP
  • Perplexity MCP — commercial AI-powered search, highest star count in the search MCP space
Feature ✨ This project 88plug/searxng-mcp ihor/mcp-searxng open-webSearch exa-mcp-server Perplexity MCP
Search
200+ engines via SearXNG
30+ search categories
Multi-page fanout
Autocomplete suggestions
Engine discovery tool
Dynamic tool descriptions
Infrastructure
Self-contained (built-in search)N/AN/A
Zero-install Docker deploy
HTTP + stdio transport
Authentication
Web UI reverse proxy
Claude Code Plugin
General
Free & open source❌ (paid API)❌ (paid API)
Privacy (self-hosted)
LanguagePythonPythonNode.jsTypeScriptTypeScriptTypeScript
GitHub Starsstarsstarsstarsstarsstarsstars
Why fewer tools?

MCP is designed for composition — clients connect multiple specialized servers, each doing one thing well. Some alternatives bundle URL fetching, rendered page extraction, multi-query fan-out, or research modes into the search server. We keep the tool surface to three (search, autocomplete, engine discovery) by design:

  • URL fetching is a separate concern. MCP clients already ship dedicated tools (WebFetch, Playwright MCP, Jina Reader). Bundling fetch into a search server mixes responsibilities and duplicates the client ecosystem.
  • Multi-query parallel search is client-side orchestration. LLM clients can fire multiple search calls in parallel — a search_many tool only adds token overhead for tool selection with no real benefit.
  • Research / synthesis belongs in the LLM layer. The model is the best synthesizer. Pushing multi-step research logic into the MCP server couples application concerns to infrastructure.

Instead we invest in what the alternatives above lack: complete SearXNG API coverage (categories, autocomplete, engine metadata — capabilities most wrappers leave on the table), self-contained deployment, authentication, Web UI reverse proxy, and Claude Code plugin integration.

📖 Usage

🌐 HTTP Mode (default)

# Without authentication
docker run -d --name searxng-mcp --restart unless-stopped \
  -p YOUR_PORT:8888 --memory=512m --cpus=1 \
  ghcr.io/whw23/searxng-http-mcp:latest

# With authentication
docker run -d --name searxng-mcp --restart unless-stopped \
  -p YOUR_PORT:8888 --memory=512m --cpus=1 \
  -e API_KEY=your-secret-key \
  ghcr.io/whw23/searxng-http-mcp:latest
🔗 MCP Endpointhttp://YOUR_HOST:YOUR_PORT/mcp/
🖥 SearXNG Web UIhttp://YOUR_HOST:YOUR_PORT/

📡 stdio Mode

docker run --rm -i --memory=512m --cpus=1 \
  ghcr.io/whw23/searxng-http-mcp:latest --stdio

No ports exposed. Communication via stdin/stdout. SearXNG runs internally for the MCP tools.

🐍 uvx Mode

# Connect to a local SearXNG instance (default: http://127.0.0.1:8080)
uvx searxng-http-mcp

# Connect to a remote SearXNG instance
SEARXNG_URL=http://YOUR_SEARXNG_HOST:YOUR_SEARXNG_PORT uvx searxng-http-mcp

Requires Python 3.14+ and an existing SearXNG instance. No Docker needed.

⚙️ Environment Variables

VariableDefaultDescription
API_KEY(empty, no auth)API key for authentication
SEARXNG_URLhttp://127.0.0.1:8080SearXNG instance URL (for uvx/standalone mode)

🔐 Authentication

When API_KEY is set, all requests require one of:

  • x-api-key header — for MCP clients: x-api-key: your-key
  • HTTP Basic Auth — for browsers

[!TIP] Browser Login: When accessing the Web UI with API_KEY enabled, the browser will show a login dialog. Leave the username empty and enter your API key as the password.

Browser Login Dialog

When API_KEY is not set, all requests are open.


🔧 MCP Tools Reference

🔍 search — Search the web using SearXNG

Aggregates results from 200+ search engines with privacy.

ParameterTypeRequiredDefaultDescription
querystringyesThe search query to use
categoriesstringno""Comma-separated category names (e.g., general,news,science)
enginesstringno""Comma-separated engine names (e.g., google,arxiv,wikipedia)
languagestringno""Search language code (e.g., en, zh, ja)
time_rangeenumnonullday, week, month, year
safesearchenumno00=off, 1=moderate, 2=strict
pagenoint ≥1no1Starting page number
pagesint 1–5no1Number of pages to fetch in parallel
max_resultsint 1–100no10Maximum number of results to return
formatenumnocompactcompact (title/url/content) or full (+ engines/score/category/date)

Returns: results, answers, suggestions, corrections, infoboxes.

💡 autocomplete — Get search query suggestions
ParameterTypeRequiredDescription
querystringyesPartial query string to get suggestions for
🗂 engine_info — Discover available engines and categories

No parameters. Returns the list of enabled engines grouped by category.

Returns:

{
  "categories": ["general", "images", "videos", "news", ...],
  "engines": ["google", "bing", "duckduckgo", ...],
  "category_engines": {
    "general": ["google", "bing", "duckduckgo", "brave", ...],
    "science": ["arxiv", "google scholar", "pubmed", ...],
    ...
  }
}

Use this to discover what engines are available before calling search with specific engines or categories filters.


🔌 Client Configuration

Claude Claude Desktop

Server mode — edit ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "searxng": {
      "url": "http://YOUR_HOST:YOUR_PORT/mcp/",
      "headers": {
        "x-api-key": "your-secret-key"
      }
    }
  }
}

Local mode:

{
  "mcpServers": {
    "searxng": {
      "command": "docker",
      "args": ["run", "--rm", "-i", "--memory=512m", "--cpus=1", "ghcr.io/whw23/searxng-http-mcp:latest", "--stdio"]
    }
  }
}

uvx mode:

{
  "mcpServers": {
    "searxng": {
      "command": "uvx",
      "args": ["searxng-http-mcp"],
      "env": { "SEARXNG_URL": "http://YOUR_SEARXNG_HOST:YOUR_SEARXNG_PORT" }
    }
  }
}
Claude Claude Code

Server mode:

claude mcp add --transport http --header "x-api-key: your-secret-key" searxng http://YOUR_HOST:YOUR_PORT/mcp/

Local mode:

claude mcp add --transport stdio searxng -- docker run --rm -i --memory=512m --cpus=1 ghcr.io/whw23/searxng-http-mcp:latest --stdio

uvx mode:

claude mcp add --transport stdio searxng -- uvx searxng-http-mcp
Codex Codex

Server mode — add to ~/.codex/config.toml:

[mcp_servers.searxng]
url = "http://YOUR_HOST:YOUR_PORT/mcp/"
http_headers = { "x-api-key" = "your-secret-key" }

Local mode:

[mcp_servers.searxng]
command = "docker"
args = ["run", "--rm", "-i", "--memory=512m", "--cpus=1", "ghcr.io/whw23/searxng-http-mcp:latest", "--stdio"]

uvx mode:

[mcp_servers.searxng]
command = "uvx"
args = ["searxng-http-mcp"]
Cursor Cursor

Server mode — edit .cursor/mcp.json:

{
  "mcpServers": {
    "searxng": {
      "url": "http://YOUR_HOST:YOUR_PORT/mcp/",
      "headers": {
        "x-api-key": "your-secret-key"
      }
    }
  }
}

Local mode:

{
  "mcpServers": {
    "searxng": {
      "command": "docker",
      "args": ["run", "--rm", "-i", "--memory=512m", "--cpus=1", "ghcr.io/whw23/searxng-http-mcp:latest", "--stdio"]
    }
  }
}

uvx mode:

{
  "mcpServers": {
    "searxng": {
      "command": "uvx",
      "args": ["searxng-http-mcp"],
      "env": { "SEARXNG_URL": "http://YOUR_SEARXNG_HOST:YOUR_SEARXNG_PORT" }
    }
  }
}
Copilot VS Code Copilot

Server mode — add to .vscode/mcp.json:

{
  "servers": {
    "searxng": {
      "type": "http",
      "url": "http://YOUR_HOST:YOUR_PORT/mcp/",
      "headers": {
        "x-api-key": "your-secret-key"
      }
    }
  }
}

Local mode:

{
  "servers": {
    "searxng": {
      "type": "stdio",
      "command": "docker",
      "args": ["run", "--rm", "-i", "--memory=512m", "--cpus=1", "ghcr.io/whw23/searxng-http-mcp:latest", "--stdio"]
    }
  }
}

uvx mode:

{
  "servers": {
    "searxng": {
      "type": "stdio",
      "command": "uvx",
      "args": ["searxng-http-mcp"],
      "env": { "SEARXNG_URL": "http://YOUR_SEARXNG_HOST:YOUR_SEARXNG_PORT" }
    }
  }
}
Windsurf Windsurf

Server mode — add to ~/.codeium/windsurf/mcp_config.json:

{
  "mcpServers": {
    "searxng": {
      "serverUrl": "http://YOUR_HOST:YOUR_PORT/mcp/",
      "headers": {
        "x-api-key": "your-secret-key"
      }
    }
  }
}

Local mode:

{
  "mcpServers": {
    "searxng": {
      "command": "docker",
      "args": ["run", "--rm", "-i", "--memory=512m", "--cpus=1", "ghcr.io/whw23/searxng-http-mcp:latest", "--stdio"]
    }
  }
}

uvx mode:

{
  "mcpServers": {
    "searxng": {
      "command": "uvx",
      "args": ["searxng-http-mcp"],
      "env": { "SEARXNG_URL": "http://YOUR_SEARXNG_HOST:YOUR_SEARXNG_PORT" }
    }
  }
}
Cline Cline

Configure via Cline's MCP settings panel in VS Code (Cline > MCP Servers > Add).

Server mode:

{
  "mcpServers": {
    "searxng": {
      "url": "http://YOUR_HOST:YOUR_PORT/mcp/",
      "headers": {
        "x-api-key": "your-secret-key"
      }
    }
  }
}

Local mode:

{
  "mcpServers": {
    "searxng": {
      "command": "docker",
      "args": ["run", "--rm", "-i", "--memory=512m", "--cpus=1", "ghcr.io/whw23/searxng-http-mcp:latest", "--stdio"]
    }
  }
}

uvx mode:

{
  "mcpServers": {
    "searxng": {
      "command": "uvx",
      "args": ["searxng-http-mcp"],
      "env": { "SEARXNG_URL": "http://YOUR_SEARXNG_HOST:YOUR_SEARXNG_PORT" }
    }
  }
}
OpenCode OpenCode

Server mode — edit opencode.json:

{
  "mcp": {
    "searxng": {
      "type": "remote",
      "url": "http://YOUR_HOST:YOUR_PORT/mcp/",
      "headers": {
        "x-api-key": "your-secret-key"
      }
    }
  }
}

Local mode:

{
  "mcp": {
    "searxng": {
      "type": "local",
      "command": ["docker", "run", "--rm", "-i", "--memory=512m", "--cpus=1", "ghcr.io/whw23/searxng-http-mcp:latest", "--stdio"]
    }
  }
}

uvx mode:

{
  "mcp": {
    "searxng": {
      "type": "local",
      "command": ["uvx", "searxng-http-mcp"]
    }
  }
}
Hermes Hermes Agent

Server mode — edit ~/.hermes/config.yaml:

mcp_servers:
  searxng:
    url: "http://YOUR_HOST:YOUR_PORT/mcp/"
    headers:
      x-api-key: "your-secret-key"

Local mode:

mcp_servers:
  searxng:
    command: "docker"
    args: ["run", "--rm", "-i", "--memory=512m", "--cpus=1", "ghcr.io/whw23/searxng-http-mcp:latest", "--stdio"]

uvx mode:

mcp_servers:
  searxng:
    command: "uvx"
    args: ["searxng-http-mcp"]

🧩 Claude Code Plugin

Add the marketplace, then install the plugin that fits your setup:

/plugin marketplace add whw23/searxng_http_mcp

All plugins include the 🔍 /web-search-via-searxng skill for web search.

🐍 Standalone mode — uvx, no Docker, bring your own SearXNG
/plugin install searxng-http-mcp@searxng-http-mcp-standalone

Runs via uvx. Requires Python 3.14+ and an existing SearXNG instance. Set SEARXNG_URL in ~/.claude/settings.json:

{
  "env": {
    "SEARXNG_URL": "http://YOUR_SEARXNG_HOST:YOUR_SEARXNG_PORT"
  }
}
🐳 Local mode — Docker stdio, zero config
/plugin install searxng-http-mcp@searxng-http-mcp

Runs SearXNG in a local Docker container via stdio. Requires Docker installed.

🌐 Remote mode — connect to a deployed server via HTTP
/plugin install searxng-http-mcp@searxng-http-mcp-remote

Connects to a deployed SearXNG MCP server. Requires env vars SEARXNG_MCP_URL and SEARXNG_API_KEY.

Add to ~/.claude/settings.json under the env field:

{
  "env": {
    "SEARXNG_MCP_URL": "http://YOUR_HOST:YOUR_PORT/mcp/",
    "SEARXNG_API_KEY": "your-api-key"
  }
}

Then restart Claude Code.


🛠 SearXNG Configuration

🖥 Via Web UI

Access the SearXNG Web UI at http://YOUR_HOST:YOUR_PORT/ to configure search engines, languages, and other settings. Changes persist during the container's lifetime.

💾 Via Volume Mount — persistent configuration

Mount the SearXNG config directory for persistent configuration:

docker run -d --name searxng-mcp --restart unless-stopped \
  -p YOUR_PORT:8888 --memory=512m --cpus=1 \
  -v /path/to/searxng-config:/etc/searxng \
  ghcr.io/whw23/searxng-http-mcp:latest

SearXNG generates settings.yml on first startup. The container automatically enables JSON format output required by MCP tools.


🏗 Build from Source

git clone https://github.com/whw23/searxng_http_mcp.git
cd searxng_http_mcp
docker build -t searxng-http-mcp:local .
docker run -d --name searxng-mcp --restart unless-stopped \
  -p YOUR_PORT:8888 --memory=512m --cpus=1 \
  searxng-http-mcp:local

🤝 Contributing

See CONTRIBUTING.md for the full workflow, CI requirements, and development setup.

  1. 🍴 Fork the repository and enable GitHub Actions in your fork
  2. 🌿 Create a feature branch from dev
  3. ✍️ Make your changes
  4. ✅ Run tests: pytest tests/ -v — CI must pass in your fork before opening a PR
  5. 📬 Submit a PR to dev

Development happens on the dev branch. Merges to main trigger image builds.

📄 License

MIT — MCP server code.

SearXNG itself is licensed under AGPL-3.0-or-later.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

searxng_http_mcp-1.1.0.tar.gz (81.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

searxng_http_mcp-1.1.0-py3-none-any.whl (16.2 kB view details)

Uploaded Python 3

File details

Details for the file searxng_http_mcp-1.1.0.tar.gz.

File metadata

  • Download URL: searxng_http_mcp-1.1.0.tar.gz
  • Upload date:
  • Size: 81.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for searxng_http_mcp-1.1.0.tar.gz
Algorithm Hash digest
SHA256 4fe43ee8c3dd0e79f5163e32789687f25ca55baa4a2b6618d89f06392071f732
MD5 035a9b4503ef422f64c908fea40e64e7
BLAKE2b-256 6a12956f0dc38ac9c95c89399f3e4e37c6ff1fae8c33be2895167047bd969e27

See more details on using hashes here.

Provenance

The following attestation bundles were made for searxng_http_mcp-1.1.0.tar.gz:

Publisher: build.yml on whw23/searxng_http_mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file searxng_http_mcp-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for searxng_http_mcp-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9ee46cbe6da62d6827f712a6737aea65800cb8b4b0c7b8f286fefcf1728f823d
MD5 d66b201ededa5243ea9caa3a5f2c8d17
BLAKE2b-256 aa413be2f1794affed7fb859b69472f12d973cc03cb823aebf576aa2725336a3

See more details on using hashes here.

Provenance

The following attestation bundles were made for searxng_http_mcp-1.1.0-py3-none-any.whl:

Publisher: build.yml on whw23/searxng_http_mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page