SearXNG MCP

SearXNG MCP

検索
ihor-sokoliuk
claudecursorvscodecodexgeneric
FreeOpen Source

このサーバーについて

SearXNG メタ検索エンジンを介して AI アシスタントにプライベートウェブ検索を提供する MCP サーバー。Claude、Cursor などをサポートし、複数の検索エンジンから結果を集約しながらユーザーのプライバシーを保護します。

インストール

npx -y mcp-searxng
公式 README インストールガイド(英語原文)

Requires Node.js 20 or later.

<details>

<summary>NPM (global install)</summary>

bash
npm install -g mcp-searxng
json
{
  "mcpServers": {
    "searxng": {
      "command": "mcp-searxng",
      "env": {
        "SEARXNG_URL": "YOUR_SEARXNG_INSTANCE_URL"
      }
    }
  }
}

</details>

<details>

<summary>Docker</summary>

Pre-built image:

bash
docker pull isokoliuk/mcp-searxng:latest

Image signatures can be verified with Cosign — see SECURITY.md for instructions.

json
{
  "mcpServers": {
    "searxng": {
      "command": "docker",
      "args": [
        "run", "-i", "--rm",
        "-e", "SEARXNG_URL",
        "isokoliuk/mcp-searxng:latest"
      ],
      "env": {
        "SEARXNG_URL": "YOUR_SEARXNG_INSTANCE_URL"
      }
    }
  }
}

To pass additional env vars, add -e VAR_NAME to args and the variable to env.

For browser-solver integration, pass FLARESOLVERR_URL, BYPARR_URL, or both

and make the configured services reachable from this container. Dual mode has

a fixed FlareSolverr-first order and no automatic reverse failover. See

URL Reader Controls for the complete

behavior and Docker Compose example.

Build locally:

bash
docker build -t mcp-searxng:latest -f Dockerfile .

Use the same config above, replacing isokoliuk/mcp-searxng:latest with mcp-searxng:latest.

</details>

<details>

<summary>Docker Compose</summary>

docker-compose.yml:

yaml
services:
  mcp-searxng:
    image: isokoliuk/mcp-searxng:latest
    stdin_open: true
    environment:
      - SEARXNG_URL=${SEARXNG_URL:?Set SEARXNG_URL in the environment}
      # Add optional variables as needed — see CONFIGURATION.md

The tracked Compose file is intentionally STDIO-only and publishes no network ports; MCP clients launch it with an absolute Compose-file path and docker compose run --rm -T, not docker compose up. The -T flag prevents pseudo-TTY allocation so MCP JSON-RPC stays on raw standard input and output. Compose fails before launch unless the MCP client supplies SEARXNG_URL.

MCP client config:

json
{
  "mcpServers": {
    "searxng": {
      "command": "docker",
      "args": [
        "compose",
        "-f", "/absolute/path/to/docker-compose.yml",
        "run", "--rm", "-T", "mcp-searxng"
      ],
      "env": {
        "SEARXNG_URL": "YOUR_SEARXNG_INSTANCE_URL"
      }
    }
  }
}

If you previously used the tracked file as an HTTP service on port 8080, put the HTTP settings in an untracked docker-compose.override.yml:

yaml
services:
  mcp-searxng:
    ports:
      - "127.0.0.1:8080:8080"
    environment:
      - MCP_HTTP_PORT=8080
      - MCP_HTTP_HOST=0.0.0.0

Here 0.0.0.0 is the container-side bind address; the host-side port remains loopback-only. This override has no authentication and is only a temporary single-host migration path. Before adding co-located containers or exposing the service beyond the local machine, follow the hardened deployment guidance.

</details>

<details>

<summary>HTTP Transport</summary>

By default the server uses STDIO, launched by your MCP client. To use HTTP instead, run mcp-searxng as a standalone process with MCP_HTTP_PORT set. In this mode it serves the MCP protocol over HTTP and does not speak STDIO, so your client connects to it by URL rather than spawning it.

Start the server:

bash
MCP_HTTP_PORT=3000 SEARXNG_URL=http://localhost:8080 mcp-searxng

Or with Docker (bind to all interfaces so the port is reachable from the host):

bash
docker run --rm -p 3000:3000 \
  --add-host=host.docker.internal:host-gateway \
  -e MCP_HTTP_PORT=3000 -e MCP_HTTP_HOST=0.0.0.0 \
  -e SEARXNG_URL=http://host.docker.internal:8080 \
  isokoliuk/mcp-searxng:latest

The --add-host mapping lets the container reach a SearXNG instance on the host via host.docker.internal; it resolves automatically on Docker Desktop but needs this flag on native Linux. Point SEARXNG_URL at your actual instance if it runs elsewhere.

Connect an HTTP-capable MCP client to the /mcp endpoint by URL:

json
{
  "mcpServers": {
    "searxng-http": {
      "type": "streamable-http",
      "url": "http://localhost:3000/mcp"
    }
  }
}

Endpoints: POST/GET/DELETE /mcp (stateful MCP protocol), GET /health (health check)

Stateful sessions remain the default. Set MCP_HTTP_STATELESS=true when a deployment cannot preserve in-memory sessions between requests. Every stateless POST creates a fresh MCP server and transport, ignores any incoming session ID, and returns negotiated JSON or an SSE stream within that same POST. Stateless mode is POST-only: GET /mcp and DELETE /mcp return HTTP 405 with Allow: POST, and no cross-request subscriptions, resumability, or server-to-client notifications are preserved.

Stateless requests are bounded by global and per-client-IP in-flight limits plus a request lifetime. See CONFIGURATION.md for defaults, overload and timeout responses, proxy-aware fairness, and the complete compatibility contract.

Test it:

bash
curl http://localhost:3000/health

The server binds to 127.0.0.1 by default; set MCP_HTTP_HOST=0.0.0.0 for remote or containerized deployments. Before exposing it on a network, enable hardened mode (MCP_HTTP_HARDEN) and see CONFIGURATION.md for MCP_HTTP_TRUST_PROXY so rate limiting and logs use the correct client IP.

</details>

よくある質問

SearXNG MCP と DuckDuckGo MCP の違いは?

SearXNG はメタ検索エンジンで、Google、Bing、DuckDuckGo など複数のエンジンから結果を集約し、より包括的な検索結果を提供します。ただし、独自の SearXNG インスタンス(Docker デプロイ可能)を実行する必要があり、設定がやや複雑です。DuckDuckGo MCP は追加設定不要ですぐに使えます。

SearXNG MCP はセルフホスティングが必要ですか?

はい、独自の SearXNG インスタンスを実行する必要があります。Docker のワンライナーが推奨です:docker run -d --name searxng -p 8888:8080 searxng/searxng。デプロイ後にインスタンス URL を設定します。公開 SearXNG インスタンスも使用できますが、プライバシーは低下します。

SearXNG MCP は無料ですか?

完全無料・オープンソースです。SearXNG 自体もオープンソースプロジェクトです。セルフホスティングのコスト(ある場合)のみで、MCP サーバー自体に費用や API キーは一切必要ありません。