SearXNG MCP Server
This server enables AI assistants to perform privacy-respecting web searches through SearXNG, a metasearch engine, with customizable parameters and support for both public and private instances. Note: This project is deprecated in favor of searxNcrawl.
Core capabilities:
Perform web searches using the
searxngsearchtool with customizable queriesCustomize search parameters including language (e.g., 'en', 'de', 'fr'), time range (day, week, month, year), categories (general, images, news), specific search engines, safesearch level (0-2), page number, and result count (1-50, default 10)
Zero-configuration setup by automatically selecting random public instances from SearX.space
Connect to private instances with optional basic authentication via environment variables
Integrate with AI platforms including Claude Desktop, Claude in VSCode, and Smolagents framework
Receive markdown-formatted results for easy consumption by AI assistants
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
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@SearXNG MCP Serverfind recent news about quantum computing breakthroughs"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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.
This project is deprecated. Its successor is searxNcrawl at https://github.com/DasDigitaleMomentum/searxNcrawl
Related MCP server: OneSearch MCP Server
Deprecated
This repository is deprecated in favor of searxNcrawl. The successor currently does not include round-robin instance selection (it is usually unreliable). If you file a suitable defect report, it can be added.
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
# Clone the repository
git clone https://github.com/tisDDM/searxng-mcp.git
cd searxng-mcp
# Install dependencies
npm install
# Build the project
npm run buildConfiguration
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:
SEARXNG_URL=https://searx.example.com
SEARXNG_USERNAME=your_username
SEARXNG_PASSWORD=your_passwordUsage
Running the server
# If installed globally
searxngmcp
# If installed from source
node build/index.jsIntegrating with Claude Desktop
Open Claude Desktop
Go to Settings > MCP Servers
Add a new MCP server with the following configuration:
{ "mcpServers": { "searxngmcp": { "command": "searxngmcp", "env": { // Optional: If not provided, a random public instance will be used "SEARXNG_URL": "https://searx.example.com", // Optional: Only needed for private instances with authentication "SEARXNG_USERNAME": "your_username", "SEARXNG_PASSWORD": "your_password" }, "disabled": false, "autoApprove": [] } } }
Integrating with Claude in VSCode
Open VSCode
Go to Settings > Extensions > Claude > MCP Settings
Add a new MCP server with the following configuration:
{ "mcpServers": { "searxngmcp": { "command": "node", "args": ["/path/to/searxng-mcp/build/index.js"], "env": { // Optional: If not provided, a random public instance will be used "SEARXNG_URL": "https://searx.example.com", // Optional: Only needed for private instances with authentication "SEARXNG_USERNAME": "your_username", "SEARXNG_PASSWORD": "your_password" }, "disabled": false, "autoApprove": [] } } }
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:
from smolagents import CodeAgent, LiteLLMModel, ToolCollection
from mcp import StdioServerParameters
# Configure the SearXNG MCP server
server_parameters = StdioServerParameters(
command="node",
args=["path/to/searxng-mcp/build/index.js"],
env={
"SEARXNG_URL": "https://your-searxng-instance.com",
"SEARXNG_USERNAME": "your_username", # Optional
"SEARXNG_PASSWORD": "your_password" # Optional
}
)
# Create a tool collection from the MCP server
with ToolCollection.from_mcp(server_parameters) as tool_collection:
# Initialize your LLM model
model = LiteLLMModel(
model_id="your-model-id",
api_key="your-api-key",
temperature=0.7
)
# Create an agent with the search tools
search_agent = CodeAgent(
name="search_agent",
tools=tool_collection.tools,
model=model
)
# Run the agent with a search prompt
result = search_agent.run(
"Perform a search about: 'climate change solutions' and summarize the top 5 results."
)
print(result)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
// Example request
const result = await client.callTool('searxngsearch', {
query: 'climate change solutions',
language: 'en',
time_range: 'year',
categories: ['general', 'news'],
safesearch: 1,
max_results: 5
});Development
Setup
# Clone the repository
git clone https://github.com/tisDDM/searxng-mcp.git
cd searxng-mcp
# Install dependencies
npm installBuild
npm run buildWatch mode (for development)
npm run watchTesting with MCP Inspector
npm run inspectorLicense
MIT
Available Tools
1 toolsearxngsearchC
Perform web searches using SearXNG, a privacy-respecting metasearch engine. Returns relevant web content with customizable parameters.
| Name | Required | Description | Default |
|---|---|---|---|
| categories | No | Categories to search in (e.g., 'general', 'images', 'news'). Default: null (all categories). | |
| engines | No | Specific search engines to use. Default: null (all available engines). | |
| language | No | Language code for search results (e.g., 'en', 'de', 'fr'). Default: 'en' | en |
| max_results | No | Maximum number of search results to return. Range: 1-50. Default: 10. | |
| pageno | No | Page number for results. Must be minimum 1. Default: 1. | |
| query | Yes | Search query | |
| safesearch | No | Safe search level: 0 (off), 1 (moderate), 2 (strict). Default: 1 (moderate). | |
| time_range | No | Time range for search results. Options: 'day', 'week', 'month', 'year'. Default: null (no time restriction). |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It mentions 'privacy-respecting' and 'returns relevant web content,' but doesn't disclose key behavioral traits like rate limits, authentication needs, error handling, or what 'relevant' entails (e.g., ranking, source diversity). For a search tool with no annotation coverage, this is a significant gap.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise and front-loaded, stating the core purpose in the first sentence. The second sentence adds useful context about returns and parameters without redundancy. It could be slightly more structured (e.g., bullet points), but it's efficient with zero waste.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's moderate complexity (8 parameters, no output schema, no annotations), the description is adequate but incomplete. It covers the basic purpose and hints at behavior, but lacks details on output format, error cases, or operational constraints. Without annotations or output schema, more context would help the agent.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema fully documents all 8 parameters. The description adds minimal value beyond the schema by mentioning 'customizable parameters' but doesn't provide additional semantics or context for parameter usage. Baseline 3 is appropriate when the schema does the heavy lifting.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool performs web searches using SearXNG, specifying it's a privacy-respecting metasearch engine. It distinguishes the tool by mentioning its privacy focus and customizable parameters, though without siblings, differentiation isn't needed. However, it could be more specific about the exact verb and resource (e.g., 'search the web' rather than 'perform web searches').
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives, prerequisites, or contextual constraints. It mentions 'customizable parameters' but doesn't explain when specific settings are appropriate. Without siblings, this is less critical, but it still lacks usage context for the agent.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
With only one tool, there is no possibility of confusion or overlap between tools. The tool's purpose is clearly defined as performing web searches using SearXNG, making it distinct by default.
Since there is only one tool, naming consistency is inherently perfect. The tool name 'searxngsearch' follows a single pattern without any deviations or mixing of conventions.
A single tool is too few for a server that appears to handle web searches, as it lacks operations for refining searches, managing results, or handling other aspects of a search engine's functionality. This feels thin and incomplete for the domain.
The tool surface is severely incomplete for a search engine server. It only provides a basic search function, with no tools for filtering results, handling pagination, accessing advanced search features, or managing search history, leading to significant gaps in coverage.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
MCP server for Google search results via SERP API
A Model Context Protocol server for Wix AI tools
Serper MCP — wraps the Serper Google Search API (serper.dev)
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA server that enables language models to perform web searches through SearXNG using the Model Context Protocol standard.2411MIT
- AlicenseAqualityAmaintenanceA Model Context Protocol server that enables web search, scraping, crawling, and content extraction through multiple engines including SearXNG, Firecrawl, and Tavily.4190139MIT
- AlicenseAqualityBmaintenanceA 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.516MIT
- FlicenseCqualityBmaintenanceA Model Context Protocol server that enables LLMs to perform Google searches via the Serper API, allowing models to retrieve current information from the web.1338
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/tisDDM/searxng-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server