Get the FREE Ultimate OpenClaw Setup Guide →

searxng

An MCP sse implementation of the Model Context Protocol (MCP) server integrated with SearXNG for providing AI agents with powerful, privacy-respecting search capabilities.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio the-ai-workshops-searxng-mcp-server python dev/searXNG-mcp/server.py \
  --env HOST="0.0.0.0" \
  --env PORT="32769" \
  --env TRANSPORT="sse" \
  --env SEARXNG_BASE_URL="http://localhost:32768"

How to use

This MCP server provides an interface for AI agents to perform privacy-respecting web searches through a SearXNG backend. The server exposes an MCP-compliant endpoint (via SSE by default) that agents can connect to and issue search-related actions. When connected, the agent can request search results, which are retrieved from the configured SearXNG instance and returned in a structured MCP payload. The setup supports both SSE transport for live streaming results and stdio transport when embedded within an MCP client that manages its own server lifecycle. To use SSE, configure the client to point at the server URL (for example, http://localhost:32769/sse) and ensure the SEARXNG_BASE_URL points to your SearXNG deployment. If you prefer stdio, the MCP client can launch the server process directly using the provided command and arguments. The server relies on a running SearXNG instance (local or remote) and translates search queries into SearXNG requests, returning results suitable for agent consumption.

How to install

Prerequisites:

  • Python 3.9+
  • Access to a running SearXNG instance (local or remote)
  • Docker (optional for containerized deployment)
  • uv (optional, for fast Python dependency management)
  • Smithery (optional, for MCP server management)

Install steps:

  1. Install Python tooling (if using uv):
pip install uv
  1. Clone the repository and navigate to the MCP server folder:
git clone https://github.com/The-AI-Workshops/searxng-mcp-server.git
cd searxng-mcp-server/dev/searXNG-mcp
  1. Install dependencies:
uv pip install -r requirements.txt
  1. Create and configure your environment file (.env) as needed (SEARXNG_BASE_URL, HOST, PORT, TRANSPORT, etc.).
nano .env
  1. Run the server (example using uv with the Python script):
uv run dev/searXNG-mcp/server.py

Alternative: Docker-based deployment

  1. Build the image:
docker build -t mcp/searxng-mcp .
  1. Run with environment variables from a .env file:
docker run -d --env-file ./.env -p 32769:32769 mcp/searxng-mcp

Smithery-based setup (optional):

  1. Install Smithery
pipx install smithery
  1. Install the MCP server via Smithery
smithery install @The-AI-Workshops/searxng-mcp-server
  1. Follow Smithery output to locate the installed tool path and create a .env in that directory, then run according to Smithery instructions.

Note: Ensure the SearXNG instance is reachable at SEARXNG_BASE_URL and that the MCP server has network access to it.

Additional notes

Tips and common issues:

  • Ensure SEARXNG_BASE_URL is reachable from the MCP server. If running Docker, consider using the container's network bridge or host networking depending on your setup.
  • If you change the default port, update your MCP client configuration accordingly (e.g., /sse path and port).
  • For Windsurf/n8n clients, remember to use the correct field names (serverUrl vs url) when configuring the MCP server endpoint.
  • If you encounter SSL or CORS issues accessing SearXNG, verify TLS settings and that the SEARXNG_BASE_URL uses the correct protocol and host accessible by the MCP server.
  • When using Smithery, environment management is handled by the tool; ensure you activate the appropriate venv before running the server in stdio mode.
  • In stdio mode, the MCP client may spawn the server; ensure the args point to the correct Python script within the Smithery-managed environment.
  • If the SearXNG instance is remote, ensure network routes and firewalls allow traffic from the MCP server to the SearXNG port.

Related MCP Servers

Sponsor this space

Reach thousands of developers