
Searxng Mcp
io.github.aicraftedPublished by GitHub account aicraftedv1.0.0Updated Oct 24, 2026
MCP server for SearXNG aggregator — web search across multiple engines via Model Context Protocol
Overview
A local MCP server that connects an assistant to a SearXNG instance so it can run aggregated web searches across many engines.
- What you can do
- Run aggregated web searches across multiple engines, filtered by category, engine, language, page and time range, with safe-search control and a choice of general, images, videos, news, map, IT, science, files or social media categories. Retrieve the categories and engines enabled on the connected SearXNG instance. Serve results over stdio, stateless HTTP or SSE, with configurable host, port and DNS-rebinding allowlists.
- When to use it
- Use it when you already run or can run a SearXNG instance and want an assistant to search the web privately through your own aggregator rather than a hosted search API, including news, IT, science or image lookups.
- Requirements
- A running SearXNG instance reachable from the server, with JSON output enabled in its settings. The SEARXNG_URL environment variable (default For running from source, Python 3.10+ and pip dependencies; a container image is also published. Optional MCP_HOST, MCP_PORT, MCP_TRANSPORT, MCP_ALLOWED_HOSTS, MCP_ALLOWED_ORIGINS and MCP_DISABLE_DNS_REBINDING_PROTECTION settings.
Installation
In SourceWeft
- Open Searxng Mcp in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
SearXNG MCP Server
A Model Context Protocol (MCP) server that provides web search capabilities by integrating with a SearXNG instance.
Features
- Web Search: Perform powerful aggregated searches across multiple engines.
- Discovery: Programmatically retrieve available categories and engines.
- Stateless HTTP: Compatible with any standard JSON-RPC client.
- Flexible Configuration: Supports environment variables and command-line arguments.
Example of compose.yml to run SearXNG with MCP server
Important: Enable JSON responses in your SearXNG
settings.yml, otherwise the MCP server cannot read search results:
Example .env
MCP client config
HTTP transport (recommended)
SSE transport
Note: SSE transport uses the
/sseendpoint, not/mcp. HTTP transport uses/mcp.
Prerequisites for run from sources
- Python 3.10+
- A running SearXNG instance.
Installation
- Clone the repository and navigate to the directory.
- Install dependencies:
- Set up your
.envfile (optional).
Configuration
The server reads configuration from command-line arguments and environment variables. Command-line arguments override the corresponding defaults used at startup.
Usage
Run the server using uv or standard python:
Run with Docker
-
Build the image:
-
Run the container:
Transport Options
stdio: Standard input/output (default for some MCP clients).http: Stateless HTTP (streamable-http).sse: Server-Sent Events.
DNS Rebinding Protection
Recent versions of the MCP Python SDK validate Host and Origin headers for HTTP/SSE transports to protect local servers from DNS rebinding attacks. If you expose the server through Docker, a reverse proxy, or a custom domain and receive 421 Invalid Host Header, configure the allowlist explicitly:
For trusted local development or when this validation is handled by another infrastructure layer, you can disable the SDK protection:
Use disabling sparingly; setting MCP_ALLOWED_HOSTS and MCP_ALLOWED_ORIGINS is the recommended option.
Search Abilities Guide
SearXNG aggregates results from various sources. This guide outlines the capabilities available through the web_search tool.
Search Categories
Categories help refine your search by content type. Use these in the categories parameter (comma-separated).
Supported Engines
SearXNG can query over 130 engines. Configured engines typically include:
- Web: Google, Brave, DuckDuckGo, Qwant, Startpage
- Knowledge: Wikipedia, Wikidata
- Development: GitHub, StackOverflow, PyPI
- Social: Reddit, Twitter/X
Advanced Search Parameters
categories: Filter by specific types (e.g.,news,it).engines: Force specific engines (e.g.,google,wikipedia).language: Specify search language (e.g.,en,es,fr).pageno: Navigate through multiple pages of results.time_range: Filter by date (day,month,year).safesearch: Control content filtering (0=None, 1=Moderate, 2=Strict).
Programmatic Discovery
Use the web_search_info tool to dynamically retrieve the list of enabled categories and engines from your instance.
Windows Troubleshooting
localhost not reachable while Docker container is running
Symptom: http://localhost:<port>/ returns connection refused or hits the wrong service,
but curl from inside the container works fine.
Root cause: WSL2 port relay ghost
WSL2 automatically forwards ports from the Linux VM to the Windows host using wslrelay.exe.
When a process inside WSL listens on a port, WSL creates a relay bound to [::1]:<port>
(IPv6 loopback) on the Windows side.
When that WSL process stops, wslrelay.exe often does not release the port. The relay
entry stays alive as a zombie listener on [::1]:<port>.
Later, when Docker maps a container to the same host port, it binds correctly to
0.0.0.0:<port> — but [::1]:<port> is already taken by the stale relay.
On Windows, localhost resolves to ::1 (IPv6) first. So browser and curl requests to
localhost:<port> hit the dead wslrelay.exe entry instead of the Docker container,
resulting in a connection error or unexpected response.
Connecting via the explicit IPv4 address 127.0.0.1:<port> bypasses the relay and reaches
Docker correctly.
How to diagnose:
If you see two entries for the same port — one owned by com.docker.backend and another
by wslrelay — this is the problem.
Workarounds:
Permanent fix:
After wsl --shutdown, restart the Docker container. The relay will no longer exist and
localhost:<port> will work normally until the same port is reused inside WSL again.
Prevention:
If you regularly run services on the same port both in WSL and in Docker, prefer one of:
- Always use Docker for that service, never WSL directly
- Use different ports for WSL dev and Docker prod instances
- Add
127.0.0.1:<port>:<port>explicit binding indocker-compose.ymlto force IPv4
Related
- WSL2 networking documentation
- WSL GitHub issue tracker: search
wslrelay port leak
Source: README.md at commit 8ecbbd3
Tools
0Version history
1- v1.0.0LatestSep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts