Skip to main content
Glama
SearXNG MCP Server

SearXNG MCP Server

🔍 SearXNG MCP Server

A privacy-focused Model Context Protocol (MCP) server that provides Claude with web search capabilities through SearXNG metasearch engine.

✨ Features

  • 🔒 Privacy-first - No tracking, no data collection via SearXNG

  • 🌐 Multi-engine - Aggregates results from Google, Bing, DuckDuckGo, Brave, and more

  • 🎯 Specialized search - Web, images, videos, and news search

  • ⚡ Fast - Optimized with minimal tool set (4 tools)

  • 🐳 Docker included - SearXNG instance setup included

  • 🛠️ Easy setup - Python-based with UV package manager

Related MCP server: MCP Deep Search

📦 Installation

Prerequisites

  • Python 3.10 or higher

  • Docker and Docker Compose

  • Git

Quick Install

1. Clone repository:

git clone https://github.com/netixc/SearxngMCP.git
cd SearxngMCP

2. Configure SearXNG:

Edit the following files with your settings:

  • docker-compose.yml - Replace YOUR_IP with your server's IP address

  • docker-compose.yml - Replace CHANGE_THIS_SECRET_KEY with a secret key

  • searxng/settings.yml - Replace CHANGE_THIS_TO_YOUR_OWN_SECRET_KEY with the same secret key

  • searxng-config/config.json - Replace YOUR_IP with your server's IP address

Generate a secret key:

openssl rand -hex 32

3. Start SearXNG instance:

docker compose up -d

SearXNG will be available at http://YOUR_IP:8080

4. Install MCP server (using UV - recommended):

# Create venv and install
uv venv
source .venv/bin/activate  # Linux/macOS
uv pip install -e ".[dev]"

5. Verify installation:

# Check SearXNG is running
curl http://YOUR_IP:8080

⚙️ Configuration

MCP Client Setup

Add to your MCP settings (e.g., Claude Desktop config):

{
  "mcpServers": {
    "searxng": {
      "command": "/absolute/path/to/SearxngMCP/run-server.sh"
    }
  }
}

SearXNG Configuration

The SearXNG instance is configured via searxng/settings.yml:

  • Default engines: Google, Bing, DuckDuckGo, Brave, Wikipedia, YouTube

  • JSON API enabled for MCP access

  • Privacy features enabled (no tracking)

  • Accessible on your LAN at YOUR_IP:8080

IMPORTANT: Before starting Docker, replace the following in your config files:

  1. docker-compose.yml: Replace YOUR_IP and CHANGE_THIS_SECRET_KEY

  2. searxng/settings.yml: Replace CHANGE_THIS_TO_YOUR_OWN_SECRET_KEY

  3. searxng-config/config.json: Replace YOUR_IP

Generate secret key: openssl rand -hex 32

MCP Server Configuration

Edit searxng-config/config.json (replace YOUR_IP with your server's IP):

{
  "searxng": {
    "url": "http://YOUR_IP:8080",
    "timeout": 10
  },
  "logging": {
    "level": "INFO",
    "format": "%(asctime)s - %(name)s - %(levelname)s - %(message)s",
    "file": null
  }
}

🔧 Available Tools

The server provides 3 optimized tools designed for efficient research:

Quick single search for web or news content.

Use when:

  • Need quick information or simple lookup

  • User asks for a basic web search

  • Looking for news on a topic

Parameters:

  • query* - What to search for

  • category - "general" (default) or "news"

  • engines - Optional: Specific engines (e.g., "google,bing")

  • max_results - Number of results (default: 10, max: 50)

Example:

User: What's the latest Python release?
Claude: [Calls search("latest Python release", category="general")]

2. search_media - Images & Videos

Search for images or videos.

Use when:

  • User wants to find images or photos

  • Looking for video content

  • "show me pictures of..." or "find videos about..."

Parameters:

  • query* - What to find

  • media_type - "images" (default) or "videos"

  • engines - Optional: Specific engines

  • max_results - Number of results (default: 10, max: 50)

Example:

User: Show me pictures of Northern Lights
Claude: [Calls search_media("Northern Lights", media_type="images")]

3. research_topic - Deep Research ⭐

Multi-search research with automatic analysis and synthesis.

Use when:

  • User wants comprehensive research or briefing

  • Need to validate information across multiple sources

  • User asks to "research", "investigate", or "analyze"

  • Creating detailed reports with cross-referenced sources

What it does:

  • Runs 2-6 searches automatically using different strategies

  • Searches multiple engines (Google, Bing, DuckDuckGo, Brave, Wikipedia)

  • Combines general web + news sources

  • Deduplicates results across all searches

  • Returns 15-50 UNIQUE sources

  • Instructs Claude to analyze and synthesize (not just list sources)

Critical behavior: After gathering sources, Claude is instructed to:

  1. Read and analyze ALL sources

  2. Cross-reference claims across sources

  3. Identify high-confidence facts (confirmed by many sources)

  4. Note contradictions or single-source claims

  5. Create comprehensive briefing with executive summary

  6. Assess source quality and credibility

Parameters:

  • query* - Research topic or question

  • depth - Research thoroughness:

    • "quick" - 2 searches, ~15 unique sources

    • "standard" - 4 searches, ~30 unique sources (recommended)

    • "deep" - 6 searches, ~50 unique sources

Example:

User: Research the latest AI developments and give me a briefing
Claude: [Calls research_topic("latest AI developments 2025", depth="standard")]

Claude receives 32 unique sources, then synthesizes:

"# AI Developments Briefing (2025)

## Executive Summary
Based on analysis of 32 sources from Google, Bing, DuckDuckGo, and Wikipedia...

## Key Findings
✓ Major development 1 (HIGH CONFIDENCE - confirmed by 12 sources)
✓ Emerging trend 2 (MEDIUM - reported by 5 sources)
⚠ Claim 3 (LOW - single source, needs verification)

## Contradictions
Source A says X, but Sources B, C, D report Y...

## Source Quality
Most reliable: Google News (8 sources), Wikipedia (3 sources)
..."

💡 Usage Examples

General search:

User: What is the latest news about AI?
Claude: [Calls search("latest AI news")]

Image search:

User: Show me pictures of Northern Lights
Claude: [Calls search_images("Northern Lights")]

Video search:

User: Find Python tutorial videos
Claude: [Calls search_videos("Python tutorial")]

News search:

User: What's happening with climate change?
Claude: [Calls search_news("climate change")]

🐳 Docker Management

Start SearXNG:

docker-compose up -d

Stop SearXNG:

docker-compose down

View logs:

docker-compose logs -f searxng

Rebuild:

docker-compose down
docker-compose up -d --build

🛠️ Development

Run tests:

pytest

Format code:

black .

Type checking:

mypy .

Lint:

ruff .

🎯 Why Only 4 Tools?

This MCP server is optimized for efficiency:

  1. Focused functionality - Each tool has a clear, distinct purpose

  2. LLM-friendly - Tool descriptions include "Use this when..." guidance

  3. Low context - Minimal tool set reduces token usage

  4. Privacy-first - SearXNG aggregates without tracking

Unlike direct search engine APIs, SearXNG provides:

  • Privacy protection (no tracking)

  • Multi-engine aggregation

  • Self-hosted control

  • No API keys needed

📁 Project Structure

SearxngMCP/
├── docker-compose.yml          # SearXNG Docker setup
├── searxng/
│   └── settings.yml            # SearXNG configuration
├── src/searxng_mcp/
│   ├── server.py               # Main MCP server
│   ├── config/                 # Configuration handling
│   │   ├── models.py
│   │   └── loader.py
│   └── tools/                  # Search tool implementations
│       └── search.py
├── searxng-config/
│   └── config.json             # MCP configuration
├── run-server.sh               # Server startup script
├── pyproject.toml              # Dependencies
└── README.md

📄 License

MIT License

🙏 Credits

Available Tools

3 tools
research_topicA

Deep research with multiple searches and source validation.

Use this when:

  • User wants comprehensive research or briefing

  • Need to validate information across multiple sources

  • Looking for in-depth analysis

  • User asks to "research", "investigate", or "give me a briefing"

This tool runs 2-6 searches automatically using different strategies:

  • Searches multiple engines (Google, Bing, DuckDuckGo, Brave, Wikipedia)

  • Searches both general web and news sources

  • Deduplicates results across all searches

  • Returns 15-50 UNIQUE sources depending on depth

Perfect for creating comprehensive briefings with validated information.

Parameters: query* - Research topic depth - Research thoroughness: • "quick" - 2 searches, ~15 unique sources • "standard" - 4 searches, ~30 unique sources (recommended) • "deep" - 6 searches, ~50 unique sources

CRITICAL - After receiving sources, you MUST:

  1. Read and analyze ALL sources provided (titles, URLs, content snippets)

  2. Cross-reference claims across multiple sources

  3. Identify facts confirmed by many sources (high confidence)

  4. Note contradictions or single-source claims (lower confidence)

  5. Synthesize findings into a comprehensive briefing with: • Executive summary of key findings • Main facts/developments (note how many sources confirm each) • Contradictions or uncertainties • Source quality assessment (which engines found what)

  6. DO NOT just list the sources - you must analyze, validate, and synthesize them into actionable intelligence

Returns: Research briefing with analyzed, validated, cross-referenced information

Inputs: query (required), depth.

search_mediaA

Search for images or videos.

Use this when:

  • User wants to find images or photos

  • Looking for video content

  • "show me pictures of..." or "find videos about..."

Parameters: query* - What to find media_type - "images" or "videos" (default: images) engines - Optional: Specific engines max_results - Number of results (default: 10, max: 50)

Returns: Media URLs with thumbnails and sources

Inputs: query (required), media_type, engines, max_results.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.5/5.0

    Scored across 3 tools

    Disambiguation5/5

    The three tools have clearly distinct purposes with no ambiguity. 'research_topic' is for comprehensive multi-source analysis, 'search' is for simple web/news lookups, and 'search_media' is specifically for images/videos. The descriptions explicitly differentiate them and guide when to use each tool.

    Naming Consistency4/5

    The naming is mostly consistent with a verb_noun pattern, but there's a minor deviation. 'research_topic' and 'search_media' follow a clear pattern, while 'search' is a single verb without a noun, which slightly breaks consistency. However, all names are readable and intuitive for their functions.

    Tool Count5/5

    With only 3 tools, this is well-scoped for a search-focused server. Each tool earns its place by covering distinct search use cases: deep research, simple queries, and media searches. This minimal set avoids bloat while providing complete coverage for the domain's core functionalities.

    Completeness5/5

    The tool surface is complete for a search server, covering all essential operations without gaps. It includes comprehensive research, basic search, and media search, which are the primary actions users would expect. There are no dead ends, and the tools support the full lifecycle of search tasks from quick lookups to in-depth analysis.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      Provides web search capabilities using SearxNG, allowing AI assistants like Claude to search the web with a privacy-respecting metasearch engine.
      1
      12
      MIT
    • A
      license
      B
      quality
      C
      maintenance
      Enables deep web search across multiple providers including Google, Bing, Brave, DuckDuckGo, and Perplexity, with support for comprehensive AI-powered research using intelligent multi-engine queries.
      2
      21 npm
      9
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      Enables web search, image search, and news search through a self-hosted SearXNG instance. Provides privacy-focused meta-search capabilities aggregating results from multiple search engines.
      3
      176 npm
      1
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      A privacy-focused search server built on SearXNG that provides unlimited, multi-source web searching across 100+ engines. It enables AI tools to perform advanced searches with specialized filters for time, language, and content categories without API costs or rate limits.
      2
      13
      MIT