SearXNG模型上下文协议服务器
用于将语言模型与SearXNG搜索引擎接口的模型上下文协议(MCP)服务器。
描述
该服务器使语言模型能够使用模型上下文协议标准通过SearXNG执行网络搜索。它为语言模型向SearXNG发送搜索查询并接收格式化结果提供了一个干净的界面。
安装
# Clone the repository
git clone https://github.com/aeon-seraph/searxng-mcp.git
cd searxng-mcp
# Install dependencies
npm install
# Build the project
npm run build需求
- Node.js 16+
- 正在运行的SearXNG实例(默认情况下位于http://localhost:8888)
用法
# Run the server
node build/index.js服务器将在stdio上运行,使其适合与MCP兼容的语言模型集成。
配置
可以使用环境变量配置服务器:
| 变量 | 描述 | 默认值 |
|---|---|---|
| SEARXNG_PROTOCOL | 要使用的协议(http/https) | http |
| SEARXNG_HOST | SEARXNG主机 | 本地主机 |
| SEARXNG_PORT | SEARXNG端口 | 8888 |
| CACHE_TTL | 缓存生存时间(毫秒) | 600000(10分钟) |
| MAX_CACHE_SIZE | 缓存查询的最大数量 | 100 |
例子:
SEARXNG_HOST=mysearx.example.com SEARXNG_PORT=443 SEARXNG_PROTOCOL=https node build/index.js码头工人
该项目包括一个易于部署的Dockerfile:
# Build the Docker image
docker build -t searxng-mcp .
# Run the container
docker run -e SEARXNG_HOST=mysearx.example.com -e SEARXNG_PROTOCOL=https searxng-mcp搜索参数
搜索功能支持以下参数:
query(必填):搜索查询字符串categories:以逗号分隔的搜索类别列表pageno:搜索页码(默认值:1)time_range:结果的时间范围(“日”、“周”、“月”、“年”)raw_json:返回原始JSON响应,而不是格式化文本(默认值:false)
许可证
麻省理工学院
