SearXNG-MCP
Allows performing web searches through a SearXNG instance and returns summarized search result content.
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 FastMCP documentation"
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 SearXNG search MCP service implemented based on FastMCP, using Streamable HTTP transport, supporting local running and Docker deployment.
SearXNG related links:
Official documentation: https://docs.searxng.org/
Online example: https://searx.space/
Features
Exposes the MCP tool
search(query): calls the SearXNG instance based on keywords and returns a summary of search results.Provides the MCP service via the HTTP endpoint
http://<host>:<port>/mcp, making it easy for remote/cross-domain calls.Uses stateless Streamable HTTP mode; clients do not need to maintain
Mcp-Session-Idand can make concurrent calls directly.Supports customizing the SearXNG instance address via environment variables, making private deployment easy.
Related MCP server: searxng-mcp-server
Environment Variables
Variable Name | Default Value | Description |
|
| SearXNG instance root address (JSON must be enabled) |
|
| Service listening address |
|
| Service listening port |
Local Run
# 安装依赖(建议使用虚拟环境)
pip install -r requirements.txt
# 可选:自定义 SearXNG 实例(只需填根地址)
export SEARXNG_URL="https://your-searxng-instance"
# 启动服务
python Server.pyAfter startup, the MCP endpoint is:
http://localhost:9000/mcpDocker Deployment
Build Image
docker build -t searxng-mcp .Run Container
docker run -d \
--name searxng-mcp \
-p 9000:9000 \
-e SEARXNG_URL="https://searxng.abc.com" \
searxng-mcpTo change the port, you can override both the container's internal and external ports and PORT:
docker run -d \
--name searxng-mcp \
-p 8080:8080 \
-e PORT=8080 \
searxng-mcpUsing the online image
docker run -d \
--name searxng-mcp \
-p 9000:9000 \
-e SEARXNG_URL="https://searxng.abc.com" \
muzihuaner/searxng-mcp:latestAccess Address
After deployment, the MCP endpoint format is:
http://<你的服务器域名或IP>:<端口>/mcpFor example: http://localhost:9000/mcp or https://mcp.your-domain.com/mcp
Client Configuration
In an MCP client that supports Streamable HTTP, fill in the service address as the /mcp endpoint above, for example:
{
"mcpServers": {
"searxng": {
"url": "http://localhost:9000/mcp"
}
}
}Tool Description
search(query: str) -> str
Calls SearXNG search based on keywords and returns the content text of each result entry, joined by newlines.
query: search keyword.Returns: the text content of the search results; returns
Falseif the request fails.
Concurrency and Performance
测试结果示例(局域网 / 上游 `so.xxx.cn`):
总请求数 : 100 并发 worker : 50 成功 : 100 失败 : 0 总耗时(秒) : 67.68 吞吐(QPS) : 1.48 平均延迟(秒) : 27.284 最小延迟(秒) : 7.203 最大延迟(秒) : 44.418
> 注意:端到端延迟主要取决于 SearXNG 上游实例的响应速度(本例平均约 27s 来自上游 `so.xxx.cn` 较慢),服务本身可稳定承载并发且零失败。若需提升吞吐,可:
> - 换用响应更快 / 自托管的 SearXNG 实例(通过 `SEARXNG_URL` 指定);FAQ
Q: Client reports error Missing session ID?
A: This service has stateless_http=True enabled, so no session is needed. If the error persists, please confirm that the client points to the /mcp endpoint.
Q: How to tighten CORS in production?
A: Edit the CORSMiddleware in Server.py and change allow_origins=["*"] to a specific origin list, such as ["https://your-domain.com"].
This server cannot be deployed
Maintenance
Related MCP Connectors
Serper MCP — wraps the Serper Google Search API (serper.dev)
Live AI-native web search with citations. One tool for every MCP client. Flat per-request pricing.
Scrape, crawl and search the web for AI agents via MCP.
Related MCP Servers
- FlicenseBqualityDmaintenanceEnables web search capabilities through the Tavily API. Allows users to search the web for information using natural language queries via the MCP protocol.41-
- AlicenseNot gradedqualityDmaintenanceEnables privacy-focused web search via SearXNG for MCP clients, allowing users to perform searches with customizable parameters through natural language.MIT
- AlicenseNot gradedqualityDmaintenanceFree web search MCP server using SearXNG, supporting web search, news search, and search summaries.MIT
- FlicenseNot gradedqualityCmaintenanceProvides 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.-