使用说明
SearXNG MCP服务器
一个最小化的模型上下文协议(MCP)服务器,将AI应用程序连接到SearXNG搜索实例。
为什么使用这个?
在没有API成本的情况下,为您的本地LLM和MCP客户提供网络搜索功能!
此服务器将您的自托管SearXNG实例转换为AI应用程序的私有web搜索后端。不必为昂贵的搜索API密钥(OpenAI、Google、Bing)付费,您可以获得:
- API零成本 -通过您自己的基础设施搜索网络
- 完全隐私 -所有搜索都通过您的SearXNG实例运行
- 无供应商锁定 -您可以控制整个搜索堆栈
- MCP兼容 -适用于Claude Code、Droid、Kilocode和其他MCP客户端
- 无限制搜索 -无费率限制或每次查询收费
非常适合:
- 部署内部人工智能助理的组织
- 开发人员通过网络搜索构建本地AI工具
- 注重隐私的用户避免使用大型技术API
- 任何想要免费搜索人工智能应用程序的人
快速设置(单线)
克劳德代码
claude mcp add searxng-mcp npx @viperblackskull/searxng-mcp@latest --env SEARXNG_URL=http://your-searxng-instance:8080
机器人
droid mcp add searxng-mcp npx @viperblackskull/searxng-mcp@latest --env SEARXNG_URL=http://your-searxng-instance:8080
公里码
kilocode import-mcp searxng-mcp npx @viperblackskull/searxng-mcp@latest --env SEARXNG_URL=http://your-searxng-instance:8080
就是这样!重新启动MCP客户端并使用:
Search for "anything" using web_search
📖 完整客户端设置指南 -所有MCP客户端的详细说明
替代设置
SEARXNG_URL=http://your-searxng-instance:8080 claude mcp add searxng-mcp npx @viperblackskull/searxng-mcp@latest
本地测试(发布前)
# Test locally
git clone https://github.com/ViperBlackSkull/searxng-mcp.git
cd searxng-mcp
npm install
export SEARXNG_URL="http://your-searxng-instance:8080"
claude mcp add searxng-mcp-local node src/index.js
特性
- 🔍 网页搜索 -完整的SearXNG搜索功能
- 🛡️ 稳健验证 -全面的输入验证
- 🌍 多语言 -支持多种搜索语言
- ⚡ 轻量级 -最小的资源占用
- 🔧 可配置的 -基于环境的配置
用法示例
基本搜索
Search for "machine learning tutorials" using web_search
高级搜索
Search for "AI news" from the last week using web_search with categories "news" and time_range "week"
输出示例
基本搜索结果
Search results for "machine learning tutorials":
1. Machine Learning Tutorial - Machine Learning Mastery
URL: https://machinelearningmastery.com/machine-learning-tutorials/
Engine: google
Snippet: Machine learning tutorials covering algorithms, neural networks, and deep learning with Python code examples...
2. Introduction to Machine Learning - Coursera
URL: https://www.coursera.org/learn/machine-learning
Engine: duckduckgo
Snippet: This course provides a broad introduction to machine learning, datamining, and statistical pattern recognition...
3. Machine Learning Basics - TensorFlow
URL: https://www.tensorflow.org/learn
Engine: bing
Snippet: Get started with machine learning and neural networks using TensorFlow with comprehensive tutorials...
Total results: 10
Search time: 1.234 seconds
错误处理
Validation error: Missing required parameter: query
可用参数
| 参数 | 类型 | 默认值 | 说明 |
|---|---|---|---|
query |
string | -- | 必需 -搜索查询 |
categories |
阵列 | ['general'] |
搜索类别 |
language |
字符串 | 'en' |
搜索语言 |
time_range |
string | -- | 按时间筛选(day, week, month, year) |
safesearch |
整数 | 1 |
安全搜索级别(0-2) |
page |
整数 | 1 |
页码 |
engines |
array | -- | 特定搜索引擎 |
安装
来自NPM
npm install -g @viperblackskull/searxng-mcp
来源
git clone https://github.com/ViperBlackSkull/searxng-mcp.git
cd searxng-mcp
npm install
npm link
发展
# Run tests
npm test
# Learn MCP
npm run learn
# Create your own MCP server
npm run create-package
测试覆盖率
- ✅ 核心功能 -100%通过率
- ✅ MCP协议 -完全合规
- ✅ 搜索功能 -所有搜索选项都有效
- ✅ 错误处理 -全面验证
- ✅ 配置 -灵活的部署选项
总体而言:97%的测试成功率
建筑
searxng-mcp/
├── src/
│ ├── index.js # Main entry point
│ ├── server/MCPServer.js # MCP server implementation
│ ├── search/SearchEngine.js # SearXNG integration
│ ├── tools/ToolRegistry.js # Tool management
│ └── config/ConfigManager.js # Configuration
├── bin/searxng-mcp.js # CLI executable
├── test/ # Test suites
└── examples/ # Learning examples
需求
- Node.js >= 18
- SearXNG 实例(本地或远程)
许可证
MIT© 毒蛇头骨