Logo vun SearxNG MCP Server

SearxNG MCP Server

Communautéit
Sacode

SearxNG MCP Server provides privacy-focused web search for AI assistants using SearxNG and the Model Context Protocol.

EditeurSacode
Repositorysearxng-simple-mcp
SproochPython
Forks
14
Stären
11
Disponibel Tools
0
Transporttypstdio
Kategorien
LizenzMIT
Linken
  • Tools mat KI-Workflows verbannen

    SearxNG MCP Server stellt MCP-Funktioune bereit, déi vu kompatibele KI-Clienten a KI-Agente kënne benotzt ginn.

  • 0 disponibel Tools

    Kuckt Iech déi opruffbar Aktiounen hei drënner un, mat Nimm a Beschreiwungen, wa se vum Server geliwwert ginn.

  • Konfiguratioun fir ze kopéieren

    Benotzt d'Installatiounsbeispiller, fir dëse Server an Ärem bevorzugte MCP-Client ze konfiguréieren.

  • Indicateure fir Open Source

    11 Stären an 14 Forks aus dem verlinkte Repository.

SearxNG MCP Server

A Model Context Protocol (MCP) server that provides web search capabilities using SearxNG, allowing AI assistants like Claude to search the web.

Created by AI with human supervision - because sometimes even artificial intelligence needs someone to tell it when to take a coffee break! 🤖☕

Overview

This project implements an MCP server that connects to SearxNG, a privacy-respecting metasearch engine. The server provides a simple and efficient way for Large Language Models to search the web without tracking users.

The server is specifically designed for LLMs and includes only essential features to minimize context window usage. This streamlined approach ensures efficient communication between LLMs and the search engine, preserving valuable context space for more important information.

Features

  • Privacy-focused web search through SearxNG
  • Simple API for LLM integration
  • Compatible with Claude Desktop and other MCP-compliant clients
  • Configurable search parameters
  • Clean, formatted search results optimized for LLMs

Integration with MCP-Compatible Applications

Integration Examples

Using pipx run (Recommended, no installation required)

Create a .clauderc file in your home directory:

json
{
  "mcpServers": {
    "searxng": {
      "command": "pipx",
      "args": [
        "run", "searxng-simple-mcp@latest"
      ],
      "env": {
        "SEARXNG_MCP_SEARXNG_URL": "https://your-instance.example.com"
      }
    }
  }
}

Using uvx run (No installation required)

json
{
  "mcpServers": {
    "searxng": {
      "command": "uvx",
      "args": [
        "run", "searxng-simple-mcp@latest"
      ],
      "env": {
        "SEARXNG_MCP_SEARXNG_URL": "https://your-instance.example.com"
      }
    }
  }
}

Using Python with pip (requires installation)

json
{
  "mcpServers": {
    "searxng": {
      "command": "python",
      "args": ["-m", "searxng_simple_mcp.server"],
      "env": {
        "SEARXNG_MCP_SEARXNG_URL": "https://your-instance.example.com"
      }
    }
  }
}

Using with Docker (No installation required)

json
{
  "mcpServers": {
    "searxng": {
      "command": "docker",
      "args": [
        "run", "--rm", "-i", "--network=host",
        "-e", "SEARXNG_MCP_SEARXNG_URL=http://localhost:8080",
        "ghcr.io/sacode/searxng-simple-mcp:latest"
      ]
    }
  }
}

Note: When using Docker with MCP servers:

  1. Environment variables must be passed directly using the -e flag in the args array, as the env object is not properly passed to the Docker container.
  2. If you need to access a SearxNG instance running on localhost (e.g., http://localhost:8080), you must use the --network=host flag to allow the container to access the host's network. Otherwise, "localhost" inside the container will refer to the container itself, not your host machine.
  3. When using --network=host, port mappings (-p) are not needed and will be ignored, as the container shares the host's network stack directly.

Configuration

Configure the server using environment variables:

Environment VariableDescriptionDefault Value
SEARXNG_MCP_SEARXNG_URLURL of the SearxNG instance to usehttps://paulgo.io/
SEARXNG_MCP_TIMEOUTHTTP request timeout in seconds10
SEARXNG_MCP_DEFAULT_RESULT_COUNTDefault number of results to return10
SEARXNG_MCP_DEFAULT_LANGUAGELanguage code for results (e.g., 'en', 'ru', 'all')all
SEARXNG_MCP_DEFAULT_FORMATDefault format for results ('text', 'json')text
SEARXNG_MCP_LOG_LEVELLogging level (e.g., 'DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL')ERROR
TRANSPORT_PROTOCOLTransport protocol ('stdio' or 'sse')stdio

Note: Setting log levels higher than ERROR (such as DEBUG or INFO) may break integration with some applications due to excessive output in the communication channel.

You can find a list of public SearxNG instances at https://searx.space if you don't want to host your own.

Installation & Usage

Prerequisites

  • Python 3.10 or higher
  • A SearxNG instance (public or self-hosted)

Option 1: Run Without Installation (Recommended)

The easiest way to use this server is with pipx or uvx, which allows you to run the package without installing it permanently:

bash
# Using pipx
pip install pipx  # Install pipx if you don't have it
pipx run searxng-simple-mcp

# OR using uvx
pip install uvx  # Install uvx if you don't have it
uvx run searxng-simple-mcp

You can pass configuration options directly:

bash
# Using pipx with custom SearxNG instance
pipx run searxng-simple-mcp --searxng-url https://your-instance.example.com

Option 2: Install from PyPI or Source

For more permanent installation:

bash
# From PyPI using pip
pip install searxng-simple-mcp

# OR using uv (faster installation)
pip install uv
uv pip install searxng-simple-mcp

# OR from source
git clone https://github.com/Sacode/searxng-simple-mcp.git
cd searxng-simple-mcp
pip install uv
uv pip install -e .

After installation, you can run the server with:

bash
# Run directly after installation
python -m searxng_simple_mcp.server

# OR with configuration options
python -m searxng_simple_mcp.server --searxng-url https://your-instance.example.com

Option 3: Docker

If you prefer using Docker:

bash
# Pull the Docker image
docker pull ghcr.io/sacode/searxng-simple-mcp:latest

# Run the container with default settings (stdio transport)
docker run --rm -i ghcr.io/sacode/searxng-simple-mcp:latest

# Run with environment file for configuration
docker run --rm -i --env-file .env ghcr.io/sacode/searxng-simple-mcp:latest

# Run with SSE transport (starts HTTP server on port 8000)
docker run -p 8000:8000 -e TRANSPORT_PROTOCOL=sse ghcr.io/sacode/searxng-simple-mcp:latest

# Building locally
docker build -t searxng-simple-mcp:local .
docker run --rm -i searxng-simple-mcp:local

# Using Docker Compose
docker-compose up -d

For complete Docker usage information, see the Docker Configuration section below.

Transport Protocols

The MCP server supports two transport protocols:

  • STDIO (default): For CLI applications and direct integration

    • Used by default in all examples
    • Suitable for integration with Claude Desktop and other MCP-compliant clients
    • No HTTP server is started
  • SSE (Server-Sent Events): For web-based clients and HTTP-based integrations

    • Starts an HTTP server that clients can connect to
    • Useful for web applications and services that need real-time updates
    • Requires port mapping when using Docker

Using SSE Transport

To use the SSE transport protocol:

  1. With direct execution:

    bash
    # Set the transport protocol to SSE
    TRANSPORT_PROTOCOL=sse python -m searxng_simple_mcp.server
    
    # Or with FastMCP
    fastmcp run src/searxng_simple_mcp/server.py --transport sse
  2. With Docker:

    bash
    # Run with SSE transport protocol
    docker run -p 8000:8000 -e TRANSPORT_PROTOCOL=sse -e SEARXNG_MCP_SEARXNG_URL=https://your-instance.example.com ghcr.io/sacode/searxng-simple-mcp:latest
  3. With Docker Compose (from the included docker-compose.yml):

    yaml
    environment:
      - SEARXNG_MCP_SEARXNG_URL=https://searx.info
      - SEARXNG_MCP_TIMEOUT=10
      - SEARXNG_MCP_MAX_RESULTS=20
      - SEARXNG_MCP_LANGUAGE=all
      - TRANSPORT_PROTOCOL=sse # Transport protocol: stdio or sse

When using SSE, the server will be accessible via HTTP at http://localhost:8000 by default.

To connect to the SSE server from an MCP client, use a configuration like:

json
{
  "mcpServers": {
    "searxng": {
      "url": "http://localhost:8000",
      "transport": "sse"
    }
  }
}

Note: Not all applications support the SSE transport protocol. Make sure your MCP client is compatible with SSE before using this transport method.

Development

For development and testing:

bash
# Install dependencies
uv pip install -e .

# Run linter and formatter
ruff check .
ruff check --fix .
ruff format .

# Run the server directly
python -m src.searxng_simple_mcp.server

# OR using FastMCP
fastmcp run src/searxng_simple_mcp/server.py  # Use stdio transport (default)
fastmcp run src/searxng_simple_mcp/server.py --transport sse  # Use sse transport

# Run in development mode (launches MCP Inspector)
fastmcp dev src/searxng_simple_mcp/server.py

Publishing to PyPI

For maintainers who need to publish new versions of the package to PyPI:

bash
# Install development dependencies
npm run install:deps

# Clean, build, and check the package
npm run build:package
npm run check:package

# Publish to PyPI (requires PyPI credentials)
npm run publish:pypi

# Alternatively, use the all-in-one commands to update version and publish
npm run publish:patch  # Increments patch version (1.0.1 -> 1.0.2)
npm run publish:minor  # Increments minor version (1.0.1 -> 1.1.0)
npm run publish:major  # Increments major version (1.0.1 -> 2.0.0)

These commands will:

  1. Update the version in both package.json and pyproject.toml
  2. Clean the dist directory to remove old builds
  3. Build the package (creating wheel and source distribution)
  4. Check the package for errors
  5. Upload the package to PyPI

You'll need to have a PyPI account and be authenticated with twine. You can set up authentication by:

  • Creating a .pypirc file in your home directory
  • Using environment variables (TWINE_USERNAME and TWINE_PASSWORD)
  • Using PyPI API tokens (recommended)

Docker Configuration

When using Docker with MCP servers, keep these points in mind:

  1. Integration with MCP clients: Use the configuration shown in the Using with Docker section for integrating with Claude Desktop or other MCP-compliant clients.

  2. Transport protocols:

    • By default, the Docker container uses the stdio transport protocol
    • For SSE transport, see the Using SSE Transport section
  3. Configuration options:

    • Use an environment file (.env) to configure the server: docker run --env-file .env ...
    • Pass individual environment variables with the -e flag: docker run -e SEARXNG_MCP_SEARXNG_URL=https://example.com ...
    • See the Configuration section for available environment variables
  4. Networking:

    • Use --network=host when you need to access services on your host machine
    • Use -p 8000:8000 when exposing the SSE server to your network

Package Structure

searxng-simple-mcp/
├── src/
│   ├── run_server.py         # Entry point script
│   └── searxng_simple_mcp/   # Main package
├── docker-compose.yml        # Docker Compose configuration
├── Dockerfile                # Docker configuration
└── pyproject.toml            # Python project configuration

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

SearxNG MCP Server MCP mat verschiddene KI-Modeller benotzen

TypingMind verbënnt MCP-Tools um Niveau vum Aarbechtsberäich. Soubal SearxNG MCP Server verbonnen ass, kënnt Dir et mat verschiddene KI-Modeller an TypingMind benotzen, amplaz et fir all Modell separat anzeriichten. Dës MCP-Integratioun leeft lokal iwwer den TypingMind-MCP-Connector op Ärem Apparat.

Ariichtungsuleedung fir de lokale Connector ze benotzen

Benotzt dës Optioun, wann den MCP-Server Zougrëff op lokal Fichieren, Appen oder privat Ressourcen op Ärem Computer brauch.

1

D'MCP-Astellungen opmaachen

Gitt an TypingMind op „Astellungen“, „Erweidert Astellungen“, dann op „Model Context Protocol“ a wielt „Connector ariichten“.

  1. Maacht TypingMind an Ärem Browser op.
  2. Klickt op d'Astellungssymbol.
  3. Gitt op „Erweidert Astellungen“.
  4. Maacht d'Sektioun „Model Context Protocol“ op.
  5. Klickt op „Connector ariichten“ a wielt „Dësen Apparat“.
Ariichtungsbildschierm vum TypingMind-MCP-Connector mat „Dësen Apparat“ ausgewielt
2

De Connector-Befeel ausféieren

Wielt „Dësen Apparat“, kopéiert de Befeel aus TypingMind a féiert en am Terminal aus. Loosst de Prozess lafen, wärend Dir MCP benotzt.

  1. Kopéiert den Ariichtungsbefeel, deen TypingMind uweist.
  2. Maacht Terminal op macOS oder Windows Terminal op Windows op.
  3. Pescht de Befeel an a féiert en aus.
  4. Bestätegt d'Installatioun vum Package, wann den Terminal Iech freet, ob Dir weiderfuere wëllt.
  5. Loosst den Terminal an de Prozess doranner lafen, wärend Dir MCP-Tools benotzt.
3

SearxNG MCP Server als Server derbäisetzen

Wann de Connector-Status „Prett“ ass, klickt op „Serveren änneren“ a pescht d'MCP-Serverkonfiguratioun an.

  1. Waart, bis de Connector-Status „Prett“ weist.
  2. Klickt op „Serveren änneren“.
  3. Pescht d'MCP-Serverkonfiguratioun vu SearxNG MCP Server an.
  4. Späichert d'Serverlëscht.
  5. Aktualiséiert, wann Dir kontrolléiere wëllt, ob de Connector nach ëmmer prett ass.
MCP-Astellunge vun TypingMind mat aktivem Server an dem Knäppchen „Serveren änneren“
{
  "mcpServers": {
    "searxng-simple-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

D'Verbindung mat verschiddene Modeller benotzen

Späichert d'Serverlëscht, maacht „Plugins“ op an aktivéiert d'MCP-Tools vu SearxNG MCP Server. Wielt dann e belibegen ënnerstëtzte KI-Modell an TypingMind a benotzt d'Tools am Chat oder weist se engem KI-Agent zou.

  1. Maacht d'Säit „Plugins“ an TypingMind op.
  2. Aktivéiert d'MCP-Tools vu SearxNG MCP Server.
  3. Start e Chat a wielt de KI-Modell, deen Dir benotze wëllt.
  4. Benotzt d'MCP-Tools am Chat oder weist se engem KI-Agent zou.
  5. Wiesselt bei Bedarf op en anere KI-Modell, ouni MCP nei ze verbannen.
TypingMind-Chat mat aktivéierte MCP-Tools an engem ausgewielte KI-Modell
Hëlleft Dir mir bei dëser Aufgab mat SearxNG MCP Server?
SearxNG MCP Server
Jo. Ech hunn et gelies.
Dat hunn ech mat SearxNG MCP Server fonnt.

Heefeg gestallte Froen

Fir wat gëtt de MCP-Server SearxNG MCP Server benotzt?

SearxNG MCP Server ass e MCP-Server, deen et kompatibele KI-Clienten erlaabt, sech mat externen Tools a Kontext ze verbannen. An TypingMind kënnt Dir dëse MCP-Server eemol derbäisetzen a seng Tools an Ärem KI-Aarbechtsberäich zur Verfügung stellen.

Kann ech SearxNG MCP Server MCP mat méi KI-Modeller an TypingMind benotzen?

Jo. TypingMind verbënnt MCP-Tools um Niveau vum Aarbechtsberäich. Sou kënnt Dir SearxNG MCP Server mat verschiddene KI-Modeller wéi Claude, ChatGPT, Gemini oder anere Modeller benotzen, déi Dir an TypingMind konfiguréiert hutt, ouni de MCP-Server fir all Modell separat anzeriichten.

Firwat SearxNG MCP Server MCP mat TypingMind benotzen?

TypingMind ass eng vun de beschte Benotzeruewerfläche fir LLM-Chat, well et méi KI-Modeller, Prompts, Plugins, KI-Agenten, API-Schlësselen a MCP-Tools an engem Aarbechtsberäich zesummebréngt. Wann SearxNG MCP Server verbonnen ass, kënnt Dir seng MCP-Tools mat Äre bevorzugte Modeller benotzen a gläichzäiteg Är Chataarbecht an TypingMind organiséieren.

Wéi verbannen ech SearxNG MCP Server MCP mat TypingMind?

SearxNG MCP Server leeft iwwer de lokale MCP-Connector vun TypingMind. Dat eegent sech am beschten, wann de MCP-Server Zougrëff op lokal Fichieren, Desktop-Apps, Kommandozeilen-Tools oder privat Ressourcen op Ärem Computer brauch.

Wéi eng Tools stellt SearxNG MCP Server MCP an TypingMind zur Verfügung?

SearxNG MCP Server stellt MCP-Funktiounen zur Verfügung, déi Dir op der Plugins-Säit vun TypingMind aktivéiere kënnt, fir se am Chat ze benotzen oder KI-Agenten zouzeweisen.

Muss ech meng API-Schlëssele mat TypingMind deelen, fir SearxNG MCP Server MCP ze benotzen?

Nee. TypingMind setzt op lokal Veraarbechtung a léisst Iech d'Kontroll iwwer Är Modellubidder, API-Schlësselen, Prompts a MCP-Konfiguratioun. Wann SearxNG MCP Server eng Authentifizéierung verlaangt, setzt déi néideg Headeren, OAuth-Astellungen oder lokal Konfiguratioun fir dee MCP-Server derbäi, wann Dir d'Verbindung erstallt.

Änlech MCP-Serveren

All weisen

Elo Ären eegene KI-Workspace ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇