To configure the SearXNG MCP server, provide an environment variable object within your MCP client configuration. The configuration includes several independent groups: Core settings, Authentication, Timeouts, Tool Schema, Search Defaults, Search Result Controls, Search Compatibility, URL Reader Controls, and User-Agent settings.
Important Dependencies:
- If you enable security hardening with
MCP_HTTP_HARDEN=true, you must also configure MCP_HTTP_AUTH_TOKEN and MCP_HTTP_ALLOWED_ORIGINS together. - Network/Proxy settings like
MCP_HTTP_ALLOWED_HOSTS and MCP_HTTP_TRUST_PROXY depend on your specific network topology. For example, MCP_HTTP_TRUST_PROXY=1 assumes exactly one trusted proxy hop. Without this, clients might be able to spoof X-Forwarded-For headers, affecting IP-based rate limiting.
{
"mcpServers": {
"searxng": {
"command": "npx",
"args": ["-y", "mcp-searxng"],
"env": {
"SEARXNG_URL": "https://searxng.example.com",
"AUTH_USERNAME": "legacy-fallback-user",
"AUTH_PASSWORD": "legacy-fallback-password",
"SEARXNG_FANOUT": "false",
"SEARXNG_TIMEOUT_MS": "10000",
"FETCH_TIMEOUT_MS": "10000",
"SEARXNG_LITE_TOOLS": "false",
"SEARXNG_DEFAULT_LANGUAGE": "en",
"SEARXNG_DEFAULT_SAFESEARCH": "0",
"SEARXNG_DEFAULT_RESPONSE_FORMAT": "text",
"SEARXNG_MAX_RESULTS": "10",
"SEARXNG_MAX_RESULT_CHARS": "500",
"SEARCH_CACHE_TTL_MS": "86400000",
"SEARCH_CACHE_MAX_ENTRIES": "200",
"SEARXNG_HTML_FALLBACK": "false",
"URL_READ_MAX_CHARS": "2000",
"URL_READ_MAX_CONTENT_LENGTH_BYTES": "5242880",
"FLARESOLVERR_URL": "http://flaresolverr:8191",
"FLARESOLVERR_TIMEOUT_MS": "60000",
"FLARESOLVERR_MAX_CONCURRENT_REQUESTS": "2",
"CACHE_TTL_MS": "86400000",
"CACHE_MAX_ENTRIES": "500",
"USER_AGENT": "MyBot/1.0",
"SEARCH_USER_AGENT": "MySearchBot/1.0",
"URL_READER_USER_AGENT": "Mozilla/5.0 (compatible; MyBot/1.0)",
"SEARCH_HTTP_PROXY": "http://search-proxy.company.com:8080",
"SEARCH_HTTPS_PROXY": "http://search-proxy.company.com:8080",
"URL_READER_HTTP_PROXY": "http://reader-proxy.company.com:8080",
"URL_READER_HTTPS_PROXY": "http://reader-proxy.company.com:8080",
"HTTP_PROXY": "http://global-proxy.company.com:8080",
"HTTPS_PROXY": "http://global-proxy.company.com:8080",
"NO_PROXY": "localhost,127.0.0.1,.local,.internal",
"MCP_HTTP_PORT": "3000",
"MCP_HTTP_HOST": "0.0.0.0",
"MCP_HTTP_TRUST_PROXY": "1",
"MCP_HTTP_STATELESS": "false",
"MCP_HTTP_STATELESS_MAX_IN_FLIGHT": "16",
"MCP_HTTP_STATELESS_MAX_IN_FLIGHT_PER_IP": "8",
"MCP_HTTP_STATELESS_REQUEST_TIMEOUT_MS": "900000",
"MCP_RATE_WINDOW_MS": "60000",
"MCP_RATE_INIT_MAX": "20",
"MCP_RATE_SESSION_MAX": "300",
"MCP_HTTP_HARDEN": "true",
"MCP_HTTP_AUTH_TOKEN": "replace-me",
"MCP_HTTP_ALLOWED_ORIGINS": "https://app.example.com",
"MCP_HTTP_ALLOWED_HOSTS": "app.example.com",
"MCP_HTTP_ALLOW_PRIVATE_URLS": "false",
"MCP_HTTP_EXPOSE_FULL_CONFIG": "false"
}
}
}
}