searxng-mcp — Claude Code MCP server: what it does, how to install
Connects a SearXNG meta-search instance to AI assistants via MCP. Delivers aggregated web results across search engines directly to coding agents.
claude mcp add --env SEARXNG_URL=<SEARXNG_URL> --transport stdio searxng-mcp -- docker run -i --rm -e SEARXNG_URL ghcr.io/aicrafted/searxng-mcp:latestWhat searxng-mcp does
The server exposes a web_search tool so that coding assistants can retrieve aggregated answers across numerous providers. It routes queries through your SearXNG setup, gathering links from Google, DuckDuckGo, Brave, GitHub, StackOverflow, or ArXiv. Inquiries can target specific categories such as news, science, or it.
Running from source requires Python 3.10 and an active SearXNG endpoint. It handles stdio, stateless http, and sse communication modes. The prebuilt Docker container on GitHub Container Registry simplifies deployment alongside Docker Compose, configured via the SEARXNG_URL variable.
Without enabling json inside search.formats within SearXNG's settings.yml, the server cannot read any search responses. When exposing HTTP or SSE endpoints across custom domains, specify MCP_ALLOWED_HOSTS and MCP_ALLOWED_ORIGINS to satisfy SDK DNS rebinding verification checks.
What it helps with
- gather technical answers across GitHub, StackOverflow, and PyPI simultaneously
- search the web without relying on proprietary search API keys
- filter query results by content categories such as science or news
- aggregate search outputs from multiple providers into structured agent context
Example prompts for the agent
- Search via SearXNG for issues related to MCP DNS rebinding
- Query the it category for Docker compose examples running SearXNG
- Find recent ArXiv papers discussing large context windows
How to install searxng-mcp
Platform CLI
claude mcp add --env SEARXNG_URL=<SEARXNG_URL> --transport stdio searxng-mcp -- docker run -i --rm -e SEARXNG_URL ghcr.io/aicrafted/searxng-mcp:latestReplace <…> with your own values
Platform CLI
codex mcp add searxng-mcp --env SEARXNG_URL=<SEARXNG_URL> -- docker run -i --rm -e SEARXNG_URL ghcr.io/aicrafted/searxng-mcp:latestReplace <…> with your own values
Config file
{
"mcpServers": {
"searxng-mcp": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"SEARXNG_URL",
"ghcr.io/aicrafted/searxng-mcp:latest"
],
"env": {
"SEARXNG_URL": "<SEARXNG_URL>"
}
}
}
}Replace <…> with your own values
Config file
{
"servers": {
"searxng-mcp": {
"type": "stdio",
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"SEARXNG_URL",
"ghcr.io/aicrafted/searxng-mcp:latest"
],
"env": {
"SEARXNG_URL": "<SEARXNG_URL>"
}
}
}
}Replace <…> with your own values
Platform CLI
gemini mcp add -e SEARXNG_URL=<SEARXNG_URL> searxng-mcp docker run -i --rm -e SEARXNG_URL ghcr.io/aicrafted/searxng-mcp:latestReplace <…> with your own values
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about searxng-mcp
How do I install searxng-mcp in Claude Code?
Run claude mcp add --env SEARXNG_URL=<SEARXNG_URL> --transport stdio searxng-mcp -- docker run -i --rm -e SEARXNG_URL ghcr.io/aicrafted/searxng-mcp:latest, replacing <SEARXNG_URL> with your SearXNG address.
What does searxng-mcp do?
It bridges the Model Context Protocol to a SearXNG instance, enabling agents to query search engines and parse answers into structured JSON.
Why does searxng-mcp fail to read search results?
Your SearXNG settings.yml must include json under search.formats. If JSON output remains disabled, SearXNG serves HTML that the MCP tool cannot parse.