SearXNG MCP Server
Servidor MCP de SearXNG
Un servidor de Protocolo de Contexto de Modelo (MCP) que permite a los asistentes de IA realizar búsquedas web mediante SearXNG , un metabuscador que respeta la privacidad. Funciona de inmediato, sin necesidad de implementación adicional, seleccionando automáticamente una instancia aleatoria de SearX.space y, a la vez, admite instancias privadas con autenticación básica.
Características
Configuración sin necesidad de configuración : funciona inmediatamente mediante el uso de una instancia pública aleatoria de SearX.space
Compatibilidad con instancias privadas : conéctese a su propia instancia de SearXNG con autenticación básica opcional
Realizar búsquedas web con parámetros personalizables
Compatibilidad con múltiples motores de búsqueda
Resultados de búsqueda centrados en la privacidad
Resultados de búsqueda con formato Markdown
Valores predeterminados razonables para todos los parámetros
ADVERTENCIA: Es posible que las instancias públicas no estén disponibles para este propósito y devuelvan "Solicitud fallida con código de estado 429".
Related MCP server: OneSearch MCP Server
Instalación
Prerrequisitos
Node.js (v16 o superior)
npm (v7 o superior)
Acceso a una instancia de SearXNG (autoalojada o pública)
Instalar desde la fuente
# Clone the repository
git clone https://github.com/tisDDM/searxng-mcp.git
cd searxng-mcp
# Install dependencies
npm install
# Build the project
npm run buildConfiguración
El servidor SearXNG MCP se puede configurar con las siguientes variables de entorno:
SEARXNG_URL(opcional): La URL de su instancia de SearXNG (p. ej.,https://searx.example.com). Si no se proporciona, se seleccionará automáticamente una instancia pública aleatoria de SearX.space , lo que permitirá el uso del servidor sin necesidad de implementarlo.USE_RANDOM_INSTANCE(opcional): Establézcalo en "false" para deshabilitar la selección aleatoria de instancias cuando no se proporciona una URL. El valor predeterminado es "true".SEARXNG_USERNAME(opcional): Nombre de usuario para la autenticación básica al conectarse a una instancia privadaSEARXNG_PASSWORD(opcional): Contraseña para la autenticación básica al conectarse a una instancia privada
Puede configurar estas variables de entorno en un archivo .env en el directorio raíz del proyecto:
SEARXNG_URL=https://searx.example.com
SEARXNG_USERNAME=your_username
SEARXNG_PASSWORD=your_passwordUso
Ejecutando el servidor
# If installed globally
searxngmcp
# If installed from source
node build/index.jsIntegración con Claude Desktop
Abra Claude Desktop
Vaya a Configuración > Servidores MCP
Agregue un nuevo servidor MCP con la siguiente configuración:
{ "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": [] } } }
Integración con Claude en VSCode
Abrir VSCode
Vaya a Configuración > Extensiones > Claude > Configuración de MCP
Agregue un nuevo servidor MCP con la siguiente configuración:
{ "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": [] } } }
Uso con Smolagents
SearXNG MCP se integra fácilmente con Smolagents, un framework ligero para crear agentes de IA. Esto permite crear potentes agentes de investigación que pueden buscar en la web y procesar los resultados:
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)Herramientas disponibles
búsqueda de búsqueda
Realice búsquedas web con SearXNG, un metabuscador que respeta la privacidad. Ofrece contenido web relevante con parámetros personalizables.
Parámetros
Parámetro | Tipo | Descripción | Por defecto | Requerido |
consulta | cadena | Consulta de búsqueda | - | Sí |
idioma | cadena | Código de idioma para los resultados de búsqueda (por ejemplo, 'en', 'de', 'fr') | 'en' | No |
rango de tiempo | cadena | Intervalo de tiempo para los resultados de búsqueda. Opciones: día, semana, mes, año. | nulo | No |
categorías | matriz de cadenas | Categorías para buscar (por ejemplo, 'general', 'imágenes', 'noticias') | nulo | No |
motores | matriz de cadenas | Motores de búsqueda específicos para utilizar | nulo | No |
búsqueda segura | número | Nivel de búsqueda segura: 0 (desactivado), 1 (moderado), 2 (estricto) | 1 | No |
pageno | número | Número de página de resultados. Debe ser mínimo 1. | 1 | No |
resultados máximos | número | Número máximo de resultados de búsqueda. Rango: 1-50 | 10 | No |
Ejemplo
// 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
});Desarrollo
Configuración
# Clone the repository
git clone https://github.com/tisDDM/searxng-mcp.git
cd searxng-mcp
# Install dependencies
npm installConstruir
npm run buildModo de observación (para desarrollo)
npm run watchPruebas con MCP Inspector
npm run inspectorLicencia
Instituto Tecnológico de Massachusetts (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.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
1 tool update
v1.0.0- First observed
searxngsearch
TDQS
Scored across 1 tool
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
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
MCP server for Firecrawl — web search, scraping, and biomedical/arXiv paper search.
Free web search for AI agents. No API key required. Hosted MCP in active development.
MCP server for Google search results via SERP API
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA server that enables language models to perform web searches through SearXNG using the Model Context Protocol standard.143 npm1MIT
- AlicenseAqualityCmaintenanceA Model Context Protocol server that enables web search, scraping, crawling, and content extraction through multiple engines including SearXNG, Firecrawl, and Tavily.4338 npm143MIT
- AlicenseAqualityCmaintenanceA 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
- FlicenseCqualityCmaintenanceA Model Context Protocol server that enables LLMs to perform Google searches via the Serper API, allowing models to retrieve current information from the web.1339-