Skip to content

Backing Platform — SearXNG

searxng-mcp is a client of a SearXNG metasearch instance. This page provides a Docker recipe for deploying one locally to serve as the target of SEARXNG_URL. For production topologies, follow the upstream SearXNG documentation.

Backing-system recipe

Each connector in the ecosystem follows the same convention — a docs/platform.md recipe for the system it integrates with, accompanied by a sample Compose stack that mirrors services/. Systems offered only as a managed service have no local recipe.

Single-node deployment (Compose)

SearXNG publishes the searxng/searxng image. The following stack runs one instance on :8080 with a persistent config and result cache:

# docker/searxng.compose.yml
services:
  searxng:
    image: docker.io/searxng/searxng:latest
    container_name: searxng
    hostname: searxng
    restart: unless-stopped
    ports:
      - "8080:8080"
    environment:
      - SEARXNG_BASE_URL=http://localhost:8080/
      - UWSGI_WORKERS=6
      - UWSGI_THREADS=6
    volumes:
      - searxng_config:/etc/searxng:rw
      - searxng_data:/var/cache/searxng:rw
    cap_drop:
      - ALL
    cap_add:
      - CHOWN
      - SETGID
      - SETUID
    healthcheck:
      test: ["CMD", "wget", "-q", "--spider", "http://localhost:8080/healthz"]
      interval: 30s
      timeout: 10s
      retries: 5
      start_period: 20s

volumes:
  searxng_config:
  searxng_data:
docker compose -f docker/searxng.compose.yml up -d

# Confirm the instance answers
curl -s "http://localhost:8080/search?q=test&format=json" | head -c 200

Enable the JSON API

SearXNG must permit the json response format for searxng-mcp to read results. In the generated searxng_config/settings.yml, ensure json is listed under search.formats.

Connect searxng-mcp

export SEARXNG_URL=http://localhost:8080
searxng-mcp --transport streamable-http --host 0.0.0.0 --port 8000

Combined deployment

A combined stack places SearXNG and the MCP server on one Docker network, so the server reaches SearXNG by container name:

# docker/stack.compose.yml
services:
  searxng:
    image: docker.io/searxng/searxng:latest
    hostname: searxng
    ports: ["8080:8080"]
    environment:
      - SEARXNG_BASE_URL=http://localhost:8080/
    volumes:
      - searxng_config:/etc/searxng:rw
      - searxng_data:/var/cache/searxng:rw

  searxng-mcp:
    image: knucklessg1/searxng-mcp:latest
    depends_on: [searxng]
    environment:
      - SEARXNG_URL=http://searxng:8080
      - TRANSPORT=streamable-http
      - HOST=0.0.0.0
      - PORT=8000
    ports: ["8000:8000"]

volumes:
  searxng_config:
  searxng_data:
docker compose -f docker/stack.compose.yml up -d