Skip to main content
Glama
IceWreck

SearxNG MCP Server

by IceWreck

SearxNG MCP Server

A Model Context Protocol (MCP) server that provides search capabilities through SearxNG, the privacy-respecting metasearch engine.

PyPi: https://pypi.org/project/searxng-mcp-server/#description

Usage

Using uvx

You can also just pip install this but we recommend using uv.

# With command line argument (stdio transport)
uvx searxng-mcp-server --searxng-url https://searx.be

# With environment variable (stdio transport)
SEARXNG_URL=https://searx.be uvx searxng-mcp-server

# With HTTP transport on port 8080
uvx searxng-mcp-server --searxng-url https://searx.be --port 8080

# With HTTP transport using environment variable
SEARXNG_URL=https://searx.be MCP_PORT=8080 uvx searxng-mcp-server

Package link: https://pypi.org/project/searxng-mcp-server/

Using Docker/Podman

# With command line argument (stdio transport)
podman run --rm -i docker.io/icewreck/searxng-mcp-server:latest --searxng-url https://searx.be

# With environment variable (stdio transport)
podman run --rm -i -e SEARXNG_URL=https://searx.be docker.io/icewreck/searxng-mcp-server:latest

# With HTTP transport on port 8080
podman run --rm -i -e SEARXNG_URL=https://searx.be -p 8080:8080 docker.io/icewreck/searxng-mcp-server:latest --port 8080

Usage as Library

You can also use the SearxNG client directly in your Python projects. The client is fully async and requires async/await syntax.

For detailed examples, see the examples/client_example.py file in the repository.

The SearxNGClient can be easily integrated into custom AI agents as a search tool. All search methods are async and return structured response objects.

Related MCP server: SearXNG MCP Server

Available Tools

  • search_web: General web search with language and time filtering

  • search_images: Image search across multiple search engines

  • search_videos: Video search from various platforms

  • search_news: News search with time range filtering

  • fetch_url: Fetch content from a URL and convert it to markdown

Configuration

The server requires a SearxNG instance URL. You can provide it via:

  • Environment Variable: SEARXNG_URL=https://your-searxng-instance.com

  • Command Line Argument: --searxng-url https://your-searxng-instance.com

By default, the server uses stdio transport. To enable HTTP transport, set a port:

  • Environment Variable: MCP_PORT=8080

  • Command Line Argument: --port 8080

When a port is provided, the server listens on http://0.0.0.0:<port> using the streamable-http transport.

Optional: SEARXNG_TIMEOUT (default: 30), SEARXNG_USER_AGENT, LOG_LEVEL

Available Tools

5 tools
fetch_urlA

Fetch content from a URL (html, text or pdf) and convert it to markdown.

Args: url: The URL to fetch and convert to markdown

Returns: FetchUrlResponse with the markdown content and metadata

ParametersJSON Schema
NameRequiredDescriptionDefault
urlYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
errorNoError message if fetch failed
queryYesThe URL that was fetched
resultNoThe fetch result

TDQS

A3.6/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must carry the full burden. It only describes the basic action and return format but omits important behavioral traits such as rate limits, size constraints, redirect handling, error behavior, or that the operation is read-only.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise, listing Args and Returns without unnecessary details. It is front-loaded with the key action. A single sentence of added complexity would not harm, but it is already efficient.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is simple with one parameter and an output schema, and the description covers the core purpose and return type. However, it lacks completeness regarding behavioral aspects like error handling and content type limitations, which are not compensated by annotations.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, and the description adds minimal context: 'url: The URL to fetch and convert to markdown.' This clarifies the parameter's role but does not specify required formats or allowed protocols, providing only marginal value beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states the tool fetches content from a URL and converts to markdown. This distinct verb+resource pair differentiates it from sibling search tools that return lists instead of fetching a specific URL.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Context is clear: use this tool when you have a specific URL to retrieve. Sibling tools are search-oriented, implying no overlap. However, no explicit when-not-to-use instructions or alternatives are provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search_imagesB

Search for images using SearxNG.

Args: query: Image search query max_results: Maximum number of results to return (default: 10)

Returns: ImageSearchResponse with image search results

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYes
max_resultsNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
errorNoError message if search failed
queryYesThe search query that was executed
resultsYesList of image search results
total_resultsYesTotal number of results found

TDQS

B3.3/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, and the description only states it returns an ImageSearchResponse. Behavioral traits such as sorting, filtering, or performance characteristics are absent.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is very concise, using a structured format with Args and Returns sections. Every sentence adds value with no redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple search tool with an output schema, the description covers the key aspects. Minor gaps include lack of pagination details or clarification that this searches the web (implied by SearxNG, but not explicit).

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds meaning to both parameters (query and max_results) beyond the schema, explaining their purpose and default value. Schema coverage is 0%, so this is necessary and sufficient, though more detail on valid inputs would improve it.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool searches for images using SearxNG. However, it does not differentiate from sibling tools like search_web or search_videos, lacking explicit distinction.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives like search_web or search_news. No context about prerequisites, limitations, or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search_newsB

Search for news using SearxNG.

Args: query: News search query time_range: Time range filter ('day', 'week', 'month', 'year'). Use None for no time filtering. max_results: Maximum number of results to return (default: 10)

Returns: NewsSearchResponse with news search results

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYes
time_rangeNo
max_resultsNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
errorNoError message if search failed
queryYesThe search query that was executed
resultsYesList of news search results
total_resultsYesTotal number of results found

TDQS

B3.3/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description does not disclose behavioral traits beyond basic functionality. It implies a read-only search but doesn't elaborate on side effects or special behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with Args and Returns sections, but somewhat verbose. It could be more concise without losing clarity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the presence of sibling tools and an output schema, the description covers parameters and returns adequately. However, it lacks guidance on when to choose news search over other search types, reducing completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds meaning to all parameters beyond the schema: explains query, time_range with examples, and max_results with a default. Schema coverage is 0%, so the description fills the gap effectively.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Search for news using SearxNG', specifying the verb (search) and resource (news). While it doesn't explicitly differentiate from sibling tools, the name and description make the news focus clear.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

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 like search_web, search_images, or search_videos. It lacks explicit context for usage decisions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search_videosA

Search for videos using SearxNG.

Args: query: Video search query max_results: Maximum number of results to return (default: 10)

Returns: VideoSearchResponse with video search results

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYes
max_resultsNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
errorNoError message if search failed
queryYesThe search query that was executed
resultsYesList of video search results
total_resultsYesTotal number of results found

TDQS

A3.6/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, and the description does not disclose behavioral traits such as rate limits, authentication requirements, or limitations of the SearxNG service. It only mentions the return type.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise with a clear structure: a one-line purpose followed by Args and Returns sections. It is front-loaded and efficient, though could omit the redundant 'Args:' prefix.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (2 parameters, no annotations, output schema exists), the description covers the essential functionality. However, it lacks behavioral context and usage guidance, making it slightly incomplete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Although the schema has 0% description coverage, the description clearly explains both parameters: 'Video search query' for query and 'Maximum number of results to return (default: 10)' for max_results, adding meaningful context beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Search for videos using SearxNG', which is a specific verb and resource. It distinguishes the tool from siblings like search_web and search_images.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides parameter explanations but lacks explicit guidance on when to use this tool instead of alternatives like search_web. Usage context is implied but not stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search_webA

Search the web using SearxNG.

Args: query: Search query string language: Language code for results (e.g., 'en', 'en-US', 'fr', 'de'). Use None for no language preference. time_range: Time range filter ('day', 'week', 'month', 'year'). Use None for no time filtering. safesearch: Safe search filtering (True to enable, False to disable) max_results: Maximum number of results to return (default: 10)

Returns: WebSearchResponse with web search results

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYes
languageNo
safesearchNo
time_rangeNo
max_resultsNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
errorNoError message if search failed
queryYesThe search query that was executed
resultsYesList of web search results
total_resultsYesTotal number of results found

TDQS

A3.8/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It discloses the use of SearxNG and the return type (WebSearchResponse), but lacks details on potential behavioral traits like rate limits, authentication, or error handling. Adequate but not thorough.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise and well-structured with 'Args' and 'Returns' sections. Every sentence adds value, and the format is easy to scan. No wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the output schema (WebSearchResponse), the description need only indicate return type, which it does. It explains all parameters and their defaults. However, it does not mention any prerequisites or result pagination, which would be helpful in a complete context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Input schema has 0% description coverage, but the description compensates by explaining each parameter (e.g., language codes, time_range options, safesearch meaning). It adds value beyond the schema's raw types and defaults, though could clarify safesearch behavior more.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Search the web using SearxNG,' providing a specific verb and resource. It distinguishes from sibling tools like search_images and search_videos by focusing on general web search.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives. For example, no mention that search_web is for general web results while sibling tools handle images, videos, or news. The description only explains parameters.

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. 5 tool updatesv0.1.9
    • First observedfetch_url
    • First observedsearch_images
    • First observedsearch_news
    • First observedsearch_videos
    • First observedsearch_web

TDQS

A3.7/5.0

Scored across 5 tools

Disambiguation5/5

Each tool targets a distinct media type (web, images, videos, news) or action (fetch URL), with no overlap in purpose. Agents can clearly differentiate based on tool names and descriptions.

Naming Consistency4/5

The four search tools follow a consistent 'search_{media}' pattern, but 'fetch_url' uses a different verb, introducing a minor inconsistency. However, the naming is still intuitive and logical.

Tool Count5/5

With 5 tools covering the core search functionalities and URL fetching, the set is well-scoped for a search server. No tool feels unnecessary and no obvious missing categories for basic search.

Completeness4/5

The tool surface covers essential search types and URL fetching. However, some search tools lack optional filters (e.g., time_range or safesearch) that others have, creating slight feature gaps across the set.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables AI agents to perform privacy-respecting web searches through SearXNG, with support for multiple search engines, categories, and advanced filtering options.
    26
    -
  • 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
    1
    MIT
  • F
    license
    A
    quality
    D
    maintenance
    Enables web search capabilities via a SearXNG instance, allowing for filtered searches across categories like news, images, and science. It supports multi-language queries, time-range filtering, and safe search options to provide formatted results with metadata.
    1
    -
  • A
    license
    A
    quality
    D
    maintenance
    Enables AI assistants to perform web searches and read URL content via a SearXNG instance.
    2
    13 npm
    MIT