Aggregate Serper, Tavily, Exa and AnySearch behind one MCP-ready API with key rotation and quotas.
MCPpedia last refreshed this data
io.github.woodcoal/searchhub is an MCP server that aggregate Serper, Tavily, Exa and AnySearch behind one MCP-ready API with key rotation and quotas. Its tool list has not been published yet over stdio and http, requires no API key, and scores 84/100 on MCPpedia's security, maintenance and efficiency rubric.
Config is the same across clients - only the file and path differ.
{
"mcpServers": {
"searchhub": {
"args": [
"mcp"
],
"command": "searchhub"
}
}
}Are you the author?
Add this badge to your README to show your security score and help users find safe servers.
Aggregate Serper, Tavily, Exa and AnySearch behind one MCP-ready API with key rotation and quotas.
This server supports HTTP transport. Be the first to test it - help the community know if it works.
Five weighted categories - click any category to see the underlying evidence.
No known CVEs.
Checked searchhub against OSV.dev.
Be the first to review
Have you used this server?
Share your experience - it helps other developers decide.
Sign in to write a review.
Others in search
Unified real-time search engine skill for AI agents.
The official MCP server implementation for the Perplexity API Platform
MCP server for enterprise local codebase indexing, semantic search, and code dependency graphs.
Multi-engine web and platform search, news, Google Maps places, page reading, sitemaps, and trends.
MCP Security Weekly
Get CVE alerts and security updates for io.github.woodcoal/searchhub and similar servers.
Start a conversation
Ask a question, share a tip, or report an issue.
Sign in to join the discussion.
English README · npm · Issues
面向 AI Agent 的自托管搜索容灾网关
One protocol. Multiple search providers. Automatic key rotation and failover.
SearchHub 把 Serper、Tavily、Exa、AnySearch 等搜索 API 统一成一个协议,并集中处理 API Key 轮换、限流、配额、供应商故障切换和熔断。
它适合需要稳定联网搜索能力的 MCP 客户端、AI Agent、RAG 应用和内部自动化服务。
单个搜索供应商出问题时,Agent 不应该直接失明:
概览 —— 每个供应商一张卡片:熔断状态、可用密钥数、冷却 / 隔离数、能力标签与全局默认配额。

搜索调试 —— 一次真实调用。第一把 Exa 密钥返回配额耗尽(keyQuotaExhausted),系统自动换到第二把并成功返回;调用链路把两次尝试完整记录下来,一眼看清命中了谁、用了哪把 Key、有没有降级。

供应商配置 —— 按权重(优先级)排序。全局 QPS 与三级配额可作为兜底,密钥里留空的字段自动继承;超时、单供应商最大换 Key 次数、熔断阈值与冷却时长都可调。

用量统计 —— 按尝试次数统计,含最近 24 小时与 14 天趋势、分供应商与分密钥的成功率、平均耗时与最近错误。

API 接口 —— 内置接口文档:认证方式、请求格式,以及各供应商在分页上的能力差异。

要求 Node.js >= 22(推荐 24,Active LTS)。
npm install -g searchhub
searchhub start
打开 http://localhost:8787,使用启动日志中的管理密码登录后台。
生产环境务必固定管理密码和加密密钥。下面两条命令可以直接生成强随机值:
export SEARCHHUB_SECRET=$(openssl rand -hex 32)
export SEARCHHUB_ADMIN_PASSWORD=$(openssl rand -base64 18)
searchhub start
这两项保护的是你的上游供应商密钥和后台登录。示例里出现的
change-me只是占位符,直接沿用会让密钥加密形同虚设。 另外SEARCHHUB_SECRET一旦设置就不要再改——它是密钥的解密主密钥,改了之后已落盘的供应商密钥将无法解密。
npx searchhub start
curl -O https://raw.githubusercontent.com/woodcoal/SearchHub/main/docker-compose.yml
cat > .env <<EOF
SEARCHHUB_SECRET=$(node -e "console.log(require('crypto').randomBytes(32).toString('hex'))")
SEARCHHUB_ADMIN_PASSWORD=$(node -e "console.log(require('crypto').randomBytes(12).toString('base64url'))")
# 可选:启动时自动加入供应商密钥
# SERPER_KEYS=...
# TAVILY_KEYS=...
# EXA_KEYS=...
# ANYSEARCH_KEYS=...
EOF
docker compose up -d --build
打开 http://localhost:8787。数据和日志保存在 Docker 命名卷 searchhub-data 中。
注意 heredoc 用的是
<<EOF而不是<<'EOF'(不加引号),这样$(...)才会被 shell 展开。用 Node 生成是因为它本来就是本项目的运行前提,且跨平台一致。 生成的值请自行保管:SEARCHHUB_SECRET是供应商密钥的解密主密钥,设置之后不要再更改;改了已落盘的密钥将无法解密。
不要把
.env提交到 Git。生产环境请把SEARCHHUB_ADMIN_PASSWORD、SEARCHHUB_SECRET和供应商密钥放进安全的 Secret 管理系统。
searchhub keys add serper '<provider-key>' --label primary --qps 2
searchhub keys add tavily '<provider-key>' --label backup --monthly-quota 1000
searchhub apikey create my-agent
searchhub search "latest MCP servers" --size 5
供应商密钥和 SearchHub 调用方 API Key 是两套凭据:前者用于访问上游搜索服务,后者用于保护 SearchHub 接口。
适用于 Claude Desktop、Cursor、Cline 等支持本地 MCP 的客户端:
{
"mcpServers": {
"searchhub": {
"command": "searchhub",
"args": ["mcp"]
}
}
}
CLI 会从当前目录 .env 和环境变量读取配置。也可以指定数据目录:
{
"mcpServers": {
"searchhub": {
"command": "searchhub",
"args": ["mcp", "--home", "/path/to/searchhub-data"]
}
}
}
主服务启动后默认提供 /mcp:
{
"mcpServers": {
"searchhub": {
"url": "http://your-host:8787/mcp",
"headers": {
"x-api-key": "sh_xxxxxxxxxx"
}
}
}
}
也可以只启动 MCP HTTP 服务:
searchhub mcp --http --
... [View full README on GitHub](https://github.com/woodcoal/searchhub#readme)