基本能力
产品定位
mcp_server_searXNG 是一个隐私友好的网络搜索服务器,旨在提供高效、可定制的网络搜索功能。
核心功能
- 通过多个搜索引擎进行网络搜索
- 支持多种搜索类别(一般、图片、新闻等)
- 自定义搜索引擎选择
- 语言筛选
- 时间范围过滤
- 搜索结果数量控制
适用场景
- 需要隐私保护的网络搜索
- 多搜索引擎聚合搜索
- 特定语言或时间范围的搜索需求
工具列表
web_search
- 使用 SearXNG 执行网络搜索- 必需参数:
query
(string): 搜索查询内容
- 可选参数:
categories
(array): 搜索类别,例如 ['general', 'images', 'news']engines
(array): 搜索引擎,例如 ['google', 'bing', 'duckduckgo']language
(string): 搜索语言代码,默认为 "zh"max_results
(integer): 最大结果数量,默认为 10time_range
(string): 时间范围过滤 ('day', 'week', 'month', 'year')
常见问题解答
-
如何自定义搜索引擎?
在调用web_search
工具时,通过engines
参数指定所需的搜索引擎列表。 -
如何限制搜索结果的语言?
通过language
参数指定搜索语言代码。 -
如何控制搜索结果的数量?
通过max_results
参数指定最大结果数量。
使用教程
使用依赖
确保已安装 Python 和 pip。
安装教程
```bash
安装
pip install mcp-server-searxng==0.2
获取最新版本
pip install --upgrade mcp_server_searxng
```
配置为 MCP 服务
在您的 MCP 配置中添加:
json
"mcpServers": {
"searxng": {
"command": "python",
"args": ["-m", "mcp_server_searxng", "--instance-url=https://your-searxng-instance.com"]
}
}
调用示例
json
{
"name": "web_search",
"arguments": {
"query": "气候变化研究",
"categories": ["general"],
"engines": ["google"],
"language": "zh",
"max_results": 15,
"time_range": "month"
}
}
调试方式
使用 MCP inspector 来调试服务器:
bash
npx @modelcontextprotocol/inspector python -m mcp_server_searxng