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.
Inputs: url (required), max_chars. Returns: object
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.
Inputs: query (required), pageno, category, language, +2 more. Returns: object
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.
Inputs: query (required), pageno, language, safesearch, +1 more. Returns: object
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)
Web search API and MCP server for developers building AI agents.
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.
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.206 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 gradedqualityDmaintenanceEnables web search through a SearXNG instance via MCP, returning search result summaries.3MIT