Skip to main content

PyPI Version License PyPI Downloads

searXNG

A network search server based on MCP technology, providing privacy-friendly web search functionality using the SearXNG search engine.

Features

This server provides the following main features:

  • Web search via multiple search engines
  • Supports various search categories (general, images, news, etc.)
  • Customizable search engine selection
  • Language filtering
  • Time range filtering
  • Control over the number of search results

Available Tools

  • web_search - Perform web search using SearXNG
    • Required parameters:
      • query (string): The search query
    • Optional parameters:
      • categories (array): Search categories, e.g. ['general', 'images', 'news']
      • engines (array): Search engines, e.g. ['google', 'bing', 'duckduckgo']
      • language (string): Language code for search, default is "en"
      • max_results (integer): Maximum number of results, default is 10 (1-100)
      • time_range (string): Time range filter ('day', 'week', 'month', 'year')

If a search cannot be completed (the instance is unreachable, rate-limits the request, or returns a malformed response), the tool returns an error result describing the failure rather than an empty result list.

Search limits

Each server process admits up to eight concurrent searches. Further calls return an error immediately and can be retried later. --timeout bounds the complete network operation, including streaming the response; cancellation closes the active request. Responses are limited to 2 MiB before JSON parsing.

The configured instance must serve /search directly: redirects are rejected. The client requests Accept-Encoding: identity and rejects compressed responses to prevent unbounded decompression. Result fields are also truncated to their existing limits. Missing or non-list results and upstream error objects are reported as failures, while a valid empty list remains a successful search.

Application logs omit search queries and upstream exception text. The CLI keeps HTTP dependency logging at WARNING even when --log-level=DEBUG is selected.

Command Line Options

Option Default Description
--instance-url https://searx.party SearXNG instance to query. Must be an absolute http(s) URL.
--timeout 30 Total search network timeout, in seconds.
--log-level WARNING Logging verbosity: DEBUG, INFO, WARNING, ERROR, CRITICAL. Logs are written to stderr.
--transport stdio Transport to serve on: stdio or http.
--host 127.0.0.1 Host to bind when --transport=http.
--port 8000 Port to bind when --transport=http.

Transports

By default the server speaks stdio, which is what local MCP clients (Claude Desktop, IDE integrations, uvx) launch it with.

For remote access, --transport http serves the Streamable HTTP transport at /mcp:

searxng --transport http --host 127.0.0.1 --port 8000
# endpoint: http://127.0.0.1:8000/mcp

The legacy SSE transport is intentionally not implemented. It was superseded by Streamable HTTP in the 2025-03-26 MCP protocol revision and should not be used for new deployments.

Security: the server performs no authentication, so it binds to 127.0.0.1 by default. Only pass --host 0.0.0.0 on a trusted network, or put an authenticating reverse proxy in front of it.

Binding to a non-loopback host also disables the MCP SDK's DNS-rebinding protection, which it can only enable automatically for 127.0.0.1, localhost, and ::1. On a loopback bind a forged Host header is rejected with 421 Misdirected Request; on a public bind any Host is accepted. The server logs a warning at startup when this applies.

Usage Example

Configure as an MCP Service

To set up SearXNG as an MCP server, add one of the following to your MCP configuration file:

UVX setup:

"mcpServers": {
  "searxng": {
    "command": "uvx",
    "args": ["searxng", "--instance-url=https://searx.party"]
  }
}

This launches the server over stdio, which is the right choice for a local client.

Remote setup (Streamable HTTP):

Start the server as a long-running process:

searxng --transport http --host 0.0.0.0 --port 8000 \
        --instance-url=https://searx.party

Then point the client at its /mcp endpoint:

"mcpServers": {
  "searxng": {
    "url": "http://your-host:8000/mcp"
  }
}

Note the --host 0.0.0.0 needed to accept connections from other machines, and the security caveat above: the server is unauthenticated, so restrict it to a trusted network or front it with an authenticating reverse proxy.

Example Invocation

{
  "name": "web_search",
  "arguments": {
    "query": "climate change research",
    "categories": ["general"],
    "engines": ["google"],
    "language": "en",
    "max_results": 15,
    "time_range": "month"
  }
}

Debugging

You can use the MCP inspector to debug the server:

npx @modelcontextprotocol/inspector uvx searxng

License

AGPLv3+ License - see LICENSE for details.

Release files for searXNG 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for searXNG 0.1.2
File Size Uploaded
searxng-0.1.2.tar.gz 26.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for searXNG 0.1.2
File Interpreter ABI Platform
searxng-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size:52.6 kB

Release files / searxng-0.1.2.tar.gz

Download URL searxng-0.1.2.tar.gz
Size 26.2 kB
Tags Source
SHA-256 checksum
How to use checksums
9b44d9d647c4a6d5d046f95ea496f46110c84daf7ffd50a2744f90e8c37441ad
BLAKE2b-256 checksum
How to use checksums
ab4c28252aa3011a8a58fb3a6c16c609a53591922a40235b24129ff907db68aa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.2 {"installer":{"name":"uv","version":"0.12.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"openSUSE Tumbleweed","version":"20260904","id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / searxng-0.1.2-py3-none-any.whl

Download URL searxng-0.1.2-py3-none-any.whl
Size 26.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6a0289579aef192330d0c7cce25b1e5aefb8efaa82860ddd10cf51143c351a1c
BLAKE2b-256 checksum
How to use checksums
22c02406e9b95bf8ab8ec9a4b1cc22740adf1fe55e4fd405bad981037c840180
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.2 {"installer":{"name":"uv","version":"0.12.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"openSUSE Tumbleweed","version":"20260904","id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page