Supports configuration via .env files for setting SearXNG URL and optional authentication credentials
Provides search results in Markdown format for better readability and structure
Enables running as a Node.js-based MCP server that can be integrated with VSCode and other environments
Allows integration with Smolagents Python framework for building AI agents that can perform web searches
Provides search functionality through SearXNG instances, supporting multiple search engines, privacy-focused results, and customizable search parameters
SearXNG MCP Server
A Model Context Protocol (MCP) server that enables AI assistants to perform web searches using SearXNG, a privacy-respecting metasearch engine. Works out-of-the-box with zero additional deployment by automatically selecting a random instance from SearX.space, while also supporting private instances with basic authentication.
Features
- Zero-configuration setup: Works immediately by using a random public instance from SearX.space
- Private instance support: Connect to your own SearXNG instance with optional basic authentication
- Perform web searches with customizable parameters
- Support for multiple search engines
- Privacy-focused search results
- Markdown-formatted search results
- Sensible default values for all parameters
CAVEAT - Public Instances might be unavailabe for this purpose and return "Request failed with status code 429"
Installation
Prerequisites
- Node.js (v16 or higher)
- npm (v7 or higher)
- Access to a SearXNG instance (self-hosted or public)
Install from source
Configuration
The SearXNG MCP server can be configured with the following environment variables:
SEARXNG_URL
(optional): The URL of your SearXNG instance (e.g.,https://searx.example.com
). If not provided, a random public instance from SearX.space will be automatically selected, making the server usable with zero additional deployment.USE_RANDOM_INSTANCE
(optional): Set to "false" to disable random instance selection when no URL is provided. Default is "true".SEARXNG_USERNAME
(optional): Username for basic authentication when connecting to a private instanceSEARXNG_PASSWORD
(optional): Password for basic authentication when connecting to a private instance
You can set these environment variables in a .env
file in the root directory of the project:
Usage
Running the server
Integrating with Claude Desktop
- Open Claude Desktop
- Go to Settings > MCP Servers
- Add a new MCP server with the following configuration:
Integrating with Claude in VSCode
- Open VSCode
- Go to Settings > Extensions > Claude > MCP Settings
- Add a new MCP server with the following configuration:
Usage with Smolagents
SearXNG MCP can be easily integrated with Smolagents, a lightweight framework for building AI agents. This allows you to create powerful research agents that can search the web and process the results:
Available Tools
searxngsearch
Perform web searches using SearXNG, a privacy-respecting metasearch engine. Returns relevant web content with customizable parameters.
Parameters
Parameter | Type | Description | Default | Required |
---|---|---|---|---|
query | string | Search query | - | Yes |
language | string | Language code for search results (e.g., 'en', 'de', 'fr') | 'en' | No |
time_range | string | Time range for search results. Options: 'day', 'week', 'month', 'year' | null | No |
categories | array of strings | Categories to search in (e.g., 'general', 'images', 'news') | null | No |
engines | array of strings | Specific search engines to use | null | No |
safesearch | number | Safe search level: 0 (off), 1 (moderate), 2 (strict) | 1 | No |
pageno | number | Page number for results. Must be minimum 1 | 1 | No |
max_results | number | Maximum number of search results to return. Range: 1-50 | 10 | No |
Example
Development
Setup
Build
Watch mode (for development)
Testing with MCP Inspector
License
MIT
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
A Model Context Protocol server that enables AI assistants to perform web searches using SearXNG, a privacy-respecting metasearch engine.
Related MCP Servers
- -securityAlicense-qualityA server that enables language models to perform web searches through SearXNG using the Model Context Protocol standard.Last updated -TypeScriptMIT License
- -securityFlicense-qualityA Model Context Protocol server that enables AI assistants like Claude to perform real-time web searches using the Exa AI Search API in a safe and controlled manner.Last updated -2,167
- AsecurityFlicenseAqualityA Model Context Protocol server that enables AI assistants to perform real-time web searches, retrieving up-to-date information from the internet via a Crawler API.Last updated -1448JavaScript
- -securityAlicense-qualityA Model Context Protocol server that provides real-time web search capabilities to AI assistants through pluggable search providers, currently integrated with the Brave Search API.Last updated -3TypeScriptMIT License