searxng-mcp
Provides MCP tools for querying a SearXNG instance's search API, including web, image, news, and video search; autocomplete suggestions; category and engine discovery; instance information; and health checks.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
searxng-mcp
An MCP server (stdio) for the SearXNG search API. Connect your AI assistant to any SearXNG instance to search the web, images, news and video, discover categories and engines, and fetch autocomplete suggestions through natural language.
Single Python package, one HTTP client created at startup, configuration via
environment variables only. Built on the official
mcp SDK (high-level server API) and httpx.
Read-only by design. SearXNG exposes a search API, not a write API, so every tool is annotated read-only. Searches leave your instance and reach the upstream engines configured there; use a trusted instance and review its privacy policy. Raw search queries are never written to the server log — only correlation IDs, tool names and safe arguments.
Requirements
SearXNG disables its JSON API by default. Add json to search.formats in the
instance's settings.yml and restart SearXNG:
search:
formats:
- html
- jsonWithout it, search returns a JSON_DISABLED error with instructions.
Autocomplete and instance discovery depend on the instance's own configuration
and enabled engines.
Related MCP server: mcp-searxng
Configuration
Variable | Required | Default | Description |
| yes | — | Instance base URL, e.g. |
| no | — | Sent as |
| no |
| HTTP |
| no |
| HTTP request timeout, seconds |
| no |
|
|
| no | — | Default language when |
| no | — | Default safe-search level (0/1/2) when |
| no |
| Hard cap, 1–100, on results returned by |
SEARXNG_URL may include a subpath (for example
https://example.com/searxng). Missing or invalid required values abort
startup with a clear error. Booleans accept true/false/1/0/yes/no/on/off
(case-insensitive). .env.example is the canonical list.
Result shapes
search returns a normalized envelope. Results are trimmed to max_results
and to the configured cap; the rest of the SearXNG response is preserved:
{
"query": "rust async",
"page": 1,
"results": [
{
"title": "Async Rust",
"url": "https://example.com/async-rust",
"content": "...",
"engine": "google",
"category": "general"
}
],
"answers": [],
"infoboxes": [],
"suggestions": [],
"corrections": [],
"unresponsive_engines": [],
"number_of_results": 0,
"returned_count": 1,
"query_id": "abc123def456"
}page is forwarded to SearXNG as pageno. SearXNG does not expose a reliable
total or “has more” flag, so the envelope has no next_page/has_more.
unresponsive_engines lists engines that failed during the query. query_id is
the correlation ID written to stderr, so a tool call can be lined up with logs.
Discovery tools return compact summaries:
{"categories": ["general", "images", "news"], "count": 3, "query_id": "..."}{
"engines": [
{
"name": "google",
"categories": ["general"],
"enabled": true,
"shortcut": "go",
"paging": true,
"safe_search": true,
"time_range_support": true
}
],
"count": 1,
"query_id": "..."
}Failures are MCP tool errors with a code prefix: INVALID_INPUT, AUTH_FAILED,
FORBIDDEN, JSON_DISABLED, NOT_FOUND, RATE_LIMITED, UPSTREAM_ERROR,
BAD_RESPONSE, HTTP_ERROR, CONFIG_ERROR or INTERNAL_ERROR. Credentials are
redacted before any message reaches the model.
Tools
Tool | Description |
| Search the instance across web, image, news or video results |
| Get autocomplete suggestions for a partial query |
| List the search categories exposed by the instance |
| List engines with categories, shortcuts and capabilities |
| Get the version, name, defaults and engine/category counts |
| Check that the instance is reachable and healthy |
Typical flow: call list_categories and list_engines to discover valid names,
then pass them to search. Use engines to narrow a noisy query, categories
to switch to images/news/video, and max_results to keep the response small.
Example configuration
{
"mcpServers": {
"searxng": {
"command": "uvx",
"args": ["--from", "git+https://github.com/YOURNAME/searxng-mcp", "searxng-mcp"],
"env": {
"SEARXNG_URL": "https://searxng.example.com"
}
}
}
}With Docker, pass secrets through from your environment so they never appear in the config file:
{
"mcpServers": {
"searxng": {
"command": "docker",
"args": ["run", "-i", "--rm",
"-e", "SEARXNG_URL",
"-e", "SEARXNG_API_TOKEN",
"ghcr.io/YOURNAME/searxng-mcp:latest"]
}
}
}-e VAR without a value passes the variable through from your shell.
Self-signed certificates
Set SEARXNG_TLS_INSECURE=true only for a trusted instance with a self-signed
certificate. The flag is applied to the HTTP transport itself, which is what
httpx actually consults when a custom transport is supplied.
Development
uv sync --group dev # install deps into .venv
uv run ruff check .
uv run ruff format --check .
uv run pyright
uv run pytest -q # unit tests (httpx mocked, no network)
docker build -t searxng-mcp:dev .Entrypoint: python -m searxng_mcp (stdio transport only). Logs go to stderr;
stdout is MCP stdio only.
Live checks
The repository includes a compose fixture with a deterministic fixture engine,
so integration tests do not depend on live upstream search engines:
docker compose up -d --wait
$env:SEARXNG_URL = "http://localhost:8088"
$env:SEARXNG_INTEGRATION = "1"
uv run pytest -q -m integration
docker compose down -vTo check a real instance instead, point SEARXNG_URL at it and choose an
engine and query it can serve:
$env:SEARXNG_URL = "https://searxng.example.com"
$env:SEARXNG_TEST_ENGINE = "duckduckgo"
$env:SEARXNG_TEST_QUERY = "openai"
$env:SEARXNG_INTEGRATION = "1"
uv run pytest -q -m integrationSet SEARXNG_TEST_ENGINE to an empty string to let SearXNG choose engines. If
the instance uses a self-signed certificate chain, also set
SEARXNG_TLS_INSECURE=true for the trusted instance. Public instances may
rate-limit or block automated traffic; prefer a self-hosted instance.
Evaluations
evals/searxng.xml contains ten read-only questions over the deterministic
corpus served by the compose SearXNG instance. The MCP server connects to that
separate instance through SEARXNG_URL; no fake SearXNG is embedded in the
server. See evals/README.md for setup.
Releasing
Every push to main runs lint, typecheck, tests, a Docker build and the compose
integration suite, then publishes
ghcr.io/<owner>/<repo>:<version> + :latest, where <version> is read from
version in pyproject.toml. To release, bump the version and merge to main.
Git tags are not used.
License
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Provides AI assistants with access to Seltz's powerful Web Search capabilities.
Web search and page reading for AI agents, including JSON APIs, RSS feeds and YouTube.
Search Google straight from your AI agent. Web results, images, videos, news, products, scholarly ar
Search engine results and web data for AI agents, as structured JSON. One tool per Serpent API.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to perform privacy-respecting web searches through SearXNG, with support for multiple search engines, categories, and advanced filtering options.27ISC
- AlicenseAqualityDmaintenanceEnables AI assistants to perform web searches and read URL content via a SearXNG instance.222 npmMIT
- AlicenseNot gradedqualityDmaintenanceIntegrates SearXNG API to give AI assistants web search and URL reading capabilities.12 npmMIT
- AlicenseBqualityCmaintenanceExposes SearXNG web search and query autocomplete to AI clients, returning ranked results, instant answers, and suggestions with filters for category, language, time range, engines, page, and safe search. It is distributed via npx and requires a self-hosted SearXNG instance with the JSON format enabled.29 npmMIT