TA

the-ai-workshops/searxng-mcp-server

Developer tools

Эта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал

27 stars 9 forks Качество 56 Тренд 11

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

Обзор

An MCP sse implementation of the Model Context Protocol (MCP) server integrated with SearXNG for providing AI agents with powerful, privacy-respecting search capabilities. This project demonstrates how to build an MCP server that enables AI agents to perform web searches using a SearXNG instance. It serves as a practical template for creating your own MCP servers, using SearXNG as a backend. The implementation follows the best practices laid out by Anthropic for building MCP servers, allowing seamless integration with any MCP-compatible client. - 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) You must have a SearXNG server running and accessible. The recommended way is via Docker: - This will run SearXNG on port 32768 and persist configuration in /root/searxng.

README

Показан фрагмент оригинального README. Открыть оригинал.

SearXNG MCP Server

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


Overview

This project demonstrates how to build an MCP server that enables AI agents to perform web searches using a SearXNG instance. It serves as a practical template for creating your own MCP servers, using SearXNG as a backend.

The implementation follows the best practices laid out by Anthropic for building MCP servers, allowing seamless integration with any MCP-compatible client.


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)

SearXNG Server (Required)

You must have a SearXNG server running and accessible. The recommended way is via Docker:

docker run -d --name=searxng -p 32768:8080 -v "/root/searxng:/etc/searxng" \
  -e "BASE_URL=http://0.0.0.0:32768/" \
  -e "INSTANCE_NAME=home" \
  --restart always searxng/searxng
  • This will run SearXNG on port 32768 and persist configuration in /root/searxng.
  • The MCP server expects SearXNG to be available at http://172.17.0.1:32768 by default (see .env).

Installation

Using uv

Install uv if you don’t have it:

pip install uv

Clone this repository:

git clone https://github.com/The-AI-Workshops/searxng-mcp-server.git
cd searxng-mcp-server/dev/searXNG-mcp

Install dependencies:

uv pip install -r requirements.txt

Create a .env file based on the provided example:

nano .env
# Edit .env as needed

Configure your environment variables in the .env file (see Configuration section).


Build the Docker image:

docker build -t mcp/searxng-mcp .

Create a .env file and configure your environment variables.


Run the Docker image:

docker run -d --env-file ./.env -p 32769:32769 mcp/searxng-mcp

Using Smithery

Smithery is a command-line tool for managing AI agent tools and MCP servers.

Install Smithery if you don’t have it (see Smithery documentation for various installation methods, e.g., using pipx):

pipx install smithery

Install the SearXNG MCP server using Smithery:

smithery install @The-AI-Workshops/searxng-mcp-server

This will install the server and its dependencies into a dedicated environment managed by Smithery.

Открыть полный README на GitHub

Установка

docker run --rm -i -e TRANSPORT -e SEARXNG_BASE_URL -e HOST -e PORT mcp/searxng-mcp
Новичок в MCP? Начните с руководства на mcpskill.org →

Конфигурация

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