searxng-mcp
Provides web search through a SearXNG instance, enabling general and vertical searches (news, science, IT, images, videos, etc.), news-specific searches with time filters, and extraction of web page content as clean plain text.
Click on "Deploy 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-mcpsearch for latest news on renewable energy"
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
An MCP (Model Context Protocol) server for web search backed by SearXNG — a self-hosted, privacy-focused metasearch engine.
No API keys, no vendor lock-in, no commercial quotas. Point it at any SearXNG instance and give your MCP client (Qwen Code, Claude, etc.) real web access.
Features
Tool | Description |
| General & vertical search (categories: |
| News-vertical search with time filtering. Same result shape as |
| Fetch a page and return its main content as clean plain text (scripts, navigation and boilerplate removed). Truncates to |
Related MCP server: searxng-mcp-server
How it works
MCP client ──stdio──> searxng-mcp ──HTTP JSON API──> your SearXNG instance ──> upstream enginesThe server queries the SearXNG JSON API (GET /search?format=json) and normalizes the response into a compact, LLM-friendly shape. Errors are actionable: if the instance hasn't enabled the JSON format, the tool tells you exactly what to add to settings.yml.
Quick start
1. Run a SearXNG instance (skip if you already have one)
cd examples
docker compose up -d # or: podman run -d --name searxng -p 8080:8080 \
# -v $PWD/searxng-settings.yml:/etc/searxng/settings.yml:ro \
# searxng/searxng:latestThe instance runs at http://localhost:8080. The example settings enable the JSON API — required for this server:
search:
formats:
- html
- json2. Install
git clone https://github.com/BG-Titan/searxng-mcp.git
cd searxng-mcp
uv sync # or: python -m venv .venv && .venv/bin/pip install -e .3. Run
SEARXNG_URL=http://localhost:8080 uv run searxng-mcp
# stdio transport by default; set SEARXNG_MCP_TRANSPORT=streamable-http to switch4. Register with your MCP client
See examples/mcp-client.example.json (Claude Desktop / Qwen Code / Claude Code compatible .mcp.json format). Replace the path placeholder with your checkout:
{
"mcpServers": {
"searxng": {
"command": "uv",
"args": ["run", "--directory", "/abs/path/to/searxng-mcp", "searxng-mcp"],
"env": { "SEARXNG_URL": "http://localhost:8080" }
}
}
}Without uv, point command at the installed entry point (e.g. /path/to/.venv/bin/searxng-mcp).
5. Verify
uv run pytest # unit tests, schema checks and a stdio end-to-end testConfiguration
Environment variables read at startup:
Variable | Default | Description |
|
| Base URL of your SearXNG instance. |
|
| Per-request timeout in seconds. |
|
| MCP transport: |
Project layout
searxng-mcp/
├── .github/workflows/ci.yml # GitHub Actions: uv sync + pytest
├── examples/
│ ├── docker-compose.yml # one-shot local SearXNG
│ ├── mcp-client.example.json # MCP client config example
│ └── searxng-settings.yml # SearXNG settings with JSON API enabled
├── src/searxng_mcp/
│ ├── client.py # SearXNG JSON API client (httpx)
│ ├── extract.py # page fetch + readable-text extraction
│ ├── server.py # MCPServer (mcp SDK 2.x) & tool registration
│ └── __main__.py
├── tests/
│ ├── test_client.py # parsing, params, error paths (MockTransport)
│ ├── test_extract.py # HTML -> text
│ ├── test_server.py # tool schemas & invocation
│ └── test_smoke.py # stdio handshake + real-HTTP e2e test
└── pyproject.tomlDevelopment
uv sync # create .venv, install deps + dev group
uv run pytest -q # run the test suiteTroubleshooting
SearXNG returned HTML instead of JSON— the instance has the JSON format disabled. Addsearch.formats: [html, json]to itssettings.ymland restart.HTTP 429 — the instance limiter is active; set
server.limiter.on: falseinsettings.ymlfor local use.Cannot connect to SearXNG— check the instance is up andSEARXNG_URLpoints to it.Few/empty results — SearXNG results depend on its enabled upstream engines and languages; try a different
languageor thegeneralcategory.
Contributing
Issues and pull requests are welcome. Run uv run pytest before submitting.
License
BSD-3-Clause © BG-Titan
Available Tools
3 toolsweb_extractA
Fetch a web page and return its main content as clean plain text (scripts, navigation and boilerplate removed). Use after web_search / web_search_news to read a result in full. The text is truncated to max_chars.
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | ||
| max_chars | No |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description discloses key behavioral traits: it removes scripts/navigation/boilerplate, returns plain text, and truncates to max_chars. Since no annotations are provided, the description carries the full burden, and it does a good job of setting expectations about output format and limits. It doesn't mention potential failures (e.g., paywalls, JS-heavy pages) but covers the main behavior.
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?
Two sentences with no fluff. The core action and output format are front-loaded, and the usage context and truncation behavior are stated efficiently. Every sentence earns its place.
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 simplicity (2 params, no nested objects) and the presence of an output schema, the description covers the essential context: what it does, what it returns, and when to use it. It could mention error cases or content-type limitations, but for a straightforward fetch-and-extract tool, it is largely complete.
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 0%, so the description must compensate. It explains the purpose of max_chars (truncation) and implies url is the target page, but it doesn't add detail about URL format, required scheme, or how max_chars interacts with the output beyond truncation. The description adds some meaning but not enough to fully compensate for the lack of schema descriptions.
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's function: fetching a web page and returning main content as clean plain text. It explicitly mentions what is removed (scripts, navigation, boilerplate), which distinguishes it from the sibling search tools. The verb 'Fetch' and resource 'web page' are specific and unambiguous.
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 explicitly says to use this tool after web_search / web_search_news to read a result in full, which provides clear context for when to use it. It doesn't explicitly state when not to use it or name alternatives, but the sibling context and the 'after search' guidance make the intended workflow clear.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
web_searchA
Search the web through a self-hosted SearXNG metasearch instance. Returns ranked results (title, URL, snippet, source engines) plus direct answers, corrections and suggestions when SearXNG provides them. Use category for verticals such as science, it, files, images, videos, music, map or 'social media'; use web_search_news for time-filtered news.
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| pageno | No | ||
| category | No | general | |
| language | No | all | |
| safesearch | No | ||
| time_range | No |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the behavioral disclosure burden. It does a good job by stating that results are ranked, listing the returned fields (title, URL, snippet, source engines), and noting that direct answers, corrections, and suggestions appear when SearXNG provides them. It omits failure modes or rate limits, but these are minor for a read-only search tool.
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?
Three sentences, each earning its place: the main function, the output payload, and usage guidance. It is front-loaded with the core action and avoids restating schema titles or defaults. The category examples are slightly verbose but directly useful.
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?
The description covers the main behavior, output contents, category usage, and the news alternative; the output schema handles return detail. However, with 6 parameters and no schema descriptions, several parameters (safesearch, language, pageno, time_range) remain effectively undocumentedaine, and the sibling web_extract is not mentioned. Adequate for basic use but not fully complete.
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 0%, so the description must compensate for the 6 parameters. It only adds meaning for category with concrete examples and indirectly points to web_search_news for time-filtered news. Query is obvious, but pageno, language, safesearch, and time_range are left to name-based inference with no behavioral detail.
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 opens with a specific verb and resource: 'Search the web through a self-hosted SearXNG metasearch instance.' It also describes what is returned (ranked results, direct answers, corrections, suggestions) and explicitly names web_search_news as a sibling for news, so an agent can distinguish it from related tools.
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 gives concrete usage guidance: 'Use category for verticals such as science, it, files, images, videos, music, map or social media' and 'use web_search_news for time-filtered news.' This explicitly routes the agent to the news sibling. It does not mention web_extract as an alternative, but the search-vs-extract distinction is inferable.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
web_search_newsA
Search news articles via SearXNG's news vertical. Supports a freshness filter (day/week/month/year) and an optional language code. Returns the same result shape as web_search.
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| pageno | No | ||
| language | No | all | |
| safesearch | No | ||
| time_range | No |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the burden. It discloses the freshness filter and language code, and notes the result shape matches web_search. However, it doesn't disclose pagination behavior, safesearch semantics, or any rate limits/errors. The description adds some behavioral context but not rich detail.
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?
Three sentences with no waste. The core purpose is front-loaded, the key filters are mentioned, and the result-shape reference to web_search is a useful pointer. Every sentence earns its place.
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?
The tool has an output schema, so return values are covered elsewhere. The description covers the news vertical, freshness filter, language, and result shape. It doesn't mention pagination or safesearch, but those are in the schema with defaults. For a search tool with an output schema, this is nearly complete.
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 0%, so the description must compensate. It mentions time_range and language, but not pageno or safesearch. The description adds meaning for two of five parameters, but the schema already provides titles and defaults for all. Baseline 3 is appropriate because the description adds some value but doesn't fully compensate for the 0% coverage.
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?
States a specific verb ('Search'), resource ('news articles'), and engine vertical ('SearXNG's news vertical'), and distinguishes itself from the sibling web_search by naming the news vertical and the freshness filter. An agent can tell this apart from web_search without opening the schema.
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 implies when to use this tool: when news articles are needed, and it references the sibling web_search for the result shape. It doesn't explicitly state when not to use it or name alternatives beyond the shape reference, but the news-vertical framing gives clear context.
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.
3 tool updates
v0.1.0- First observed
web_extract - First observed
web_search - First observed
web_search_news
TDQS
Scored across 3 tools
web_search and web_search_news overlap somewhat, but web_search_news is clearly scoped to time-filtered news while web_search covers general/vertical search. web_extract is completely distinct, so an agent should be able to choose correctly with the descriptions.
web_search and web_search_news follow a clear web_search[_modifier] pattern, and web_extract is also snake_case and readable. The slight inconsistency is that web_extract uses a different verb style than the web_search* tools, but the overall naming is predictable.
Three tools is a well-scoped set for a search-focused MCP server: general search, news search, and page extraction. Each tool serves a distinct need without unnecessary bloat.
The server covers the core search workflow: searching the web, searching news with time filters, and extracting page content for deeper reading. SearXNG categories are exposed via web_search, so verticals like images or videos are also reachable, leaving no obvious dead ends.
Maintenance
Related MCP Connectors
Serper MCP — wraps the Serper Google Search API (serper.dev)
Free web search for AI agents. No API key required. Hosted MCP in active development.
Docs: https://docs.keenable.ai/mcp-server Keenable is a free, remote MCP server that gives agents access to the web index. Search the web with ranked results and date/site filters, then fetch any indexed page as clean markdown. Works out of the box with no account or API key.
Scrape, crawl and search the web for AI agents via MCP.
Related MCP Servers
- AlicenseAqualityDmaintenanceIntegrates with SearXNG metasearch engine to provide powerful web search capabilities across multiple search engines with filtering options for categories, languages, time ranges, and safe search levels. Enables comprehensive web searches, autocomplete suggestions, and search engine configuration access through MCP-compatible applications.41MIT
- AlicenseNot gradedqualityDmaintenanceEnables privacy-focused web search via SearXNG for MCP clients, allowing users to perform searches with customizable parameters through natural language.1,791 npmMIT
- FlicenseNot gradedqualityDmaintenanceProvides a free web search tool to MCP clients by connecting to a self-hosted SearXNG metasearch instance, enabling users to search the web with customizable parameters like categories and time range.-
- AlicenseNot gradedqualityBmaintenanceEnables web search through a SearXNG instance via MCP, returning search result summaries.4MIT