Prototype · Preview: every server in the official registry, synced every 30 minutes. Sign in with Google to write reviews.Prototype · updated every 30 min
PopNx MCPMCP servers for people who use AI · explained in plain words

SearchHub

by woodcoalversion 0.1.10i★ 3iRuns on your computerRepository ↗
Registry nameio.github.woodcoal/searchhub

How to install

What it does

Aggregate Serper, Tavily, Exa and AnySearch behind one MCP-ready API with key rotation and quotas.

  • Connects Runs on your computer
  • Account or key Needs SEARCHHUB_SECRET
  • Category Search & AI memory

Use together with

Skills that teach the AI this kind of work; they work alongside this one

timesfm

TimesFM (Time Series Foundation Model) is a pretrained time-series foundation model developed by Google Research for time-series forecasting.

by google-research★ 35,6381 skills

Skill · How-to guide

Shadowbroker

Open-source intelligence for the global theater. Track everything from the corporate/private jets of the wealthy, and spy satellites, to seismic events in one unified interface. Hook an AI agent up to have it parse through data and find previously unseen correlations. The knowledge is available to…

by BigBodyCobain★ 11,6051 skills

Skill · How-to guide

google-maps-scraper

scrape data from Google Maps. Extracts data such as the name, address, phone number, website URL, rating, reviews number, latitude and longitude, reviews,email and more for each place

by gosom★ 8,2361 skills

Skill · How-to guide

Why it ranks here

Lists are ordered by a usage score (out of 100) built from these parts

Popularity7/80GitHub stars or weekly downloads: the larger counts 60, the smaller 20
Freshness7/12Full marks for a release or code change within 30 days
Still answering0/8The cloud endpoint answered at the last check
Usage score14/100

Quality: Passed 3/3 basic checks (shown, not used for ordering) · Momentum: No data yet (Used only on the Trending tab)

Install

Pick the AI app you use, then copy the settings.

Let your AI install it with one sentence

Please install SearchHub. Follow https://mcp.popnx.com/i/woodcoal-searchhub.md, show me the commands and wait for my OK before running them.

Paste it into an AI that can work on your computer (such as Claude Code or Cursor). It reads our steps, shows you the commands and waits for your OK. No key, no sign-up. · See the full text your AI reads

Passed 3/3 checks · Runs on your computer · ✓ Commands checked Nov 14, 2026

First: which AI do you use?

Pick your app and the steps appear below.

Works with Claude, with some setup first

You need a SearchHub key (create it on the maker’s site) · Install Node.js on your computer first (one time) · Only the Claude desktop app (Windows or Mac), not the web or phone

Let AI install it

Copy this message into a Claude chat. The AI checks your computer, tells you which file it will change, and waits for your OK every time.

Please install the MCP server SearchHub for Claude on this computer, in this order: 1) Check Node.js with node -v. If it is missing, tell me to install it from https://nodejs.org/en/download; do not install it yourself. 2) Use only this config (already checked by PopNx MCP): { "mcpServers": { "searchhub": { "command": "npx", "args": [ "-y", "searchhub", "mcp" ], "env": { "SEARCHHUB_SECRET": "your-value" } } } } 3) Tell me the full path of the file you will change, or the command you will run, and wait for my OK. 4) For SEARCHHUB_SECRET, leave "your-value" in place and tell me to paste the real value myself into the file or the app’s field. Never ask me to type a key in chat. 5) Do what we agreed, then check that the SearchHub tools really show up.

This message has no key in it. If a key is needed, the AI will ask you to paste it yourself into the file or the app’s field.

  1. Install Node.js (if you don’t have it)

    Already installed? Check first · Open Terminal, type this command and press Enter

    node -v
    • A version number such as v26.13.1 = installed, skip this step
    • "command not found" (on Windows: "is not recognized") = not installed yet, or installed but Terminal needs to be closed and reopened
    How to open Terminal

    Mac: press ⌘ + Space, type Terminal, press Enter

    Windows: open Start, type Windows PowerShell, then Open

    Not installed: Open the official download page, pick the LTS version and the click-through installer: .pkg on Mac · .msi on Windows. Double-click and follow it to the end. No curl command needed

    Open the Node.js download page ↗

    When it’s done, close Terminal, open it again and run the same command. You should see a version number: node -v

    Install once; it works for everything that needs Node.js

  2. Sign up and create a SearchHub key

    Open the maker’s site, sign up and create an API key for the next step. Check the maker’s site for pricing and free plans.

    Open the SearchHub site ↗

  3. Open the Claude desktop app’s settings file

    SettingsDeveloperEdit Config

  4. Paste these settings and save the file

    {
      "mcpServers": {
        "searchhub": {
          "command": "npx",
          "args": [
            "-y",
            "searchhub",
            "mcp"
          ],
          "env": {
            "SEARCHHUB_SECRET": "your-value"
          }
        }
      }
    }

    Paste the key only into the app’s field, never into a chat or to anyone

  5. Quit Claude and open it again

  6. Try it

    Use SearchHub and tell me what you can do for me, then show me one thing

    ✓ If Claude says it is using SearchHub or shows a SearchHub tool in the answer, you are connected

1 optional setting(s) (works without them)

The command above works without these. Add them only if you want to change something, following the maker’s description.

  • SEARCHHUB_HOME Directory holding store.json, settings.json and logs. Defaults to ~/.search-hub. Set this if you keep provider keys somewhere other than the default location.

Descriptions are as written by the maker.

Menu names checked against Anthropic’s help page on Nov 11, 2026 · your screen may differ slightly by app version

ChatGPT cannot connect SearchHub yet

SearchHub runs on your computer, but ChatGPT can only connect servers that run on the web

What you can do instead

A · Use an app that can connect SearchHub

  • You need a SearchHub key (create it on the maker’s site) · Install Node.js on your computer first (one time) · Only the Claude desktop app (Windows or Mac), not the web or phone
  • You need a SearchHub key (create it on the maker’s site) · Install Node.js on your computer first (one time)
  • You need a SearchHub key (create it on the maker’s site) · Install Node.js on your computer first (one time)
  • You need a SearchHub key (create it on the maker’s site) · Install Node.js on your computer first (one time)

B · Others in Search & AI memory that work with ChatGPT

Picked from the most used in the same category, only ones that connect by address with no key

Works with Claude Code, with some setup first

You need a SearchHub key (create it on the maker’s site) · Install Node.js on your computer first (one time)

Let AI install it

Copy this message into a Claude Code chat. The AI checks your computer, tells you which file it will change, and waits for your OK every time.

Please install the MCP server SearchHub for Claude Code on this computer, in this order: 1) Check Node.js with node -v. If it is missing, tell me to install it from https://nodejs.org/en/download; do not install it yourself. 2) Use only this config (already checked by PopNx MCP): claude mcp add --scope user searchhub --env SEARCHHUB_SECRET=your-value -- npx -y searchhub mcp 3) Tell me the full path of the file you will change, or the command you will run, and wait for my OK. 4) For SEARCHHUB_SECRET, leave "your-value" in place and tell me to paste the real value myself into the file or the app’s field. Never ask me to type a key in chat. 5) Do what we agreed, then check that the SearchHub tools really show up.

This message has no key in it. If a key is needed, the AI will ask you to paste it yourself into the file or the app’s field.

  1. Install Node.js (if you don’t have it)

    Already installed? Check first · Open Terminal, type this command and press Enter

    node -v
    • A version number such as v26.13.1 = installed, skip this step
    • "command not found" (on Windows: "is not recognized") = not installed yet, or installed but Terminal needs to be closed and reopened
    How to open Terminal

    Mac: press ⌘ + Space, type Terminal, press Enter

    Windows: open Start, type Windows PowerShell, then Open

    Not installed: Open the official download page, pick the LTS version and the click-through installer: .pkg on Mac · .msi on Windows. Double-click and follow it to the end. No curl command needed

    Open the Node.js download page ↗

    When it’s done, close Terminal, open it again and run the same command. You should see a version number: node -v

    Install once; it works for everything that needs Node.js

  2. Sign up and create a SearchHub key

    Open the maker’s site, sign up and create an API key for the next step. Check the maker’s site for pricing and free plans.

    Open the SearchHub site ↗

  3. Open Terminal

    Mac: press Command+Space and type Terminal · Windows: open PowerShell

  4. Paste this command and press Enter

    claude mcp add --scope user searchhub --env SEARCHHUB_SECRET=your-value -- npx -y searchhub mcp

    Replace “your-value” with your key before pressing Enter

    Paste the key only into the app’s field, never into a chat or to anyone

  5. Type /mcp in Claude Code

    You should see SearchHub listed as connected

  6. Try it

    Use SearchHub and tell me what you can do for me, then show me one thing

    ✓ If Claude Code says it is using SearchHub or shows a SearchHub tool in the answer, you are connected

1 optional setting(s) (works without them)

The command above works without these. Add them only if you want to change something, following the maker’s description.

  • SEARCHHUB_HOME Directory holding store.json, settings.json and logs. Defaults to ~/.search-hub. Set this if you keep provider keys somewhere other than the default location.

Descriptions are as written by the maker.

Menu names checked against Anthropic’s help page on Nov 11, 2026 · your screen may differ slightly by app version

Works with Cursor, with some setup first

You need a SearchHub key (create it on the maker’s site) · Install Node.js on your computer first (one time)

Let AI install it

Copy this message into a Cursor chat. The AI checks your computer, tells you which file it will change, and waits for your OK every time.

Please install the MCP server SearchHub for Cursor on this computer, in this order: 1) Check Node.js with node -v. If it is missing, tell me to install it from https://nodejs.org/en/download; do not install it yourself. 2) Use only this config (already checked by PopNx MCP): { "mcpServers": { "searchhub": { "command": "npx", "args": [ "-y", "searchhub", "mcp" ], "env": { "SEARCHHUB_SECRET": "your-value" } } } } 3) Tell me the full path of the file you will change, or the command you will run, and wait for my OK. 4) For SEARCHHUB_SECRET, leave "your-value" in place and tell me to paste the real value myself into the file or the app’s field. Never ask me to type a key in chat. 5) Do what we agreed, then check that the SearchHub tools really show up.

This message has no key in it. If a key is needed, the AI will ask you to paste it yourself into the file or the app’s field.

  1. Install Node.js (if you don’t have it)

    Already installed? Check first · Open Terminal, type this command and press Enter

    node -v
    • A version number such as v26.13.1 = installed, skip this step
    • "command not found" (on Windows: "is not recognized") = not installed yet, or installed but Terminal needs to be closed and reopened
    How to open Terminal

    Mac: press ⌘ + Space, type Terminal, press Enter

    Windows: open Start, type Windows PowerShell, then Open

    Not installed: Open the official download page, pick the LTS version and the click-through installer: .pkg on Mac · .msi on Windows. Double-click and follow it to the end. No curl command needed

    Open the Node.js download page ↗

    When it’s done, close Terminal, open it again and run the same command. You should see a version number: node -v

    Install once; it works for everything that needs Node.js

  2. Sign up and create a SearchHub key

    Open the maker’s site, sign up and create an API key for the next step. Check the maker’s site for pricing and free plans.

    Open the SearchHub site ↗

  3. Click this button to open Cursor

    Open in Cursor

    Cursor asks you to confirm; click Install

  4. Fill in your key

    In the SearchHub settings, SEARCHHUB_SECRET is empty; add your key and save

    Paste the key only into the app’s field, never into a chat or to anyone

  5. Open the AI chat in Cursor in Agent mode

  6. Try it

    Use SearchHub and tell me what you can do for me, then show me one thing

    ✓ If Cursor says it is using SearchHub or shows a SearchHub tool in the answer, you are connected

1 optional setting(s) (works without them)

The command above works without these. Add them only if you want to change something, following the maker’s description.

  • SEARCHHUB_HOME Directory holding store.json, settings.json and logs. Defaults to ~/.search-hub. Set this if you keep provider keys somewhere other than the default location.

Descriptions are as written by the maker.

Menu names checked against Cursor’s help page on Nov 11, 2026 · your screen may differ slightly by app version

Works with VS Code, with some setup first

You need a SearchHub key (create it on the maker’s site) · Install Node.js on your computer first (one time)

Let AI install it

Copy this message into a VS Code chat. The AI checks your computer, tells you which file it will change, and waits for your OK every time.

Please install the MCP server SearchHub for VS Code on this computer, in this order: 1) Check Node.js with node -v. If it is missing, tell me to install it from https://nodejs.org/en/download; do not install it yourself. 2) Use only this config (already checked by PopNx MCP): { "servers": { "searchhub": { "type": "stdio", "command": "npx", "args": [ "-y", "searchhub", "mcp" ], "env": { "SEARCHHUB_SECRET": "your-value" } } } } 3) Tell me the full path of the file you will change, or the command you will run, and wait for my OK. 4) For SEARCHHUB_SECRET, leave "your-value" in place and tell me to paste the real value myself into the file or the app’s field. Never ask me to type a key in chat. 5) Do what we agreed, then check that the SearchHub tools really show up.

This message has no key in it. If a key is needed, the AI will ask you to paste it yourself into the file or the app’s field.

  1. Install Node.js (if you don’t have it)

    Already installed? Check first · Open Terminal, type this command and press Enter

    node -v
    • A version number such as v26.13.1 = installed, skip this step
    • "command not found" (on Windows: "is not recognized") = not installed yet, or installed but Terminal needs to be closed and reopened
    How to open Terminal

    Mac: press ⌘ + Space, type Terminal, press Enter

    Windows: open Start, type Windows PowerShell, then Open

    Not installed: Open the official download page, pick the LTS version and the click-through installer: .pkg on Mac · .msi on Windows. Double-click and follow it to the end. No curl command needed

    Open the Node.js download page ↗

    When it’s done, close Terminal, open it again and run the same command. You should see a version number: node -v

    Install once; it works for everything that needs Node.js

  2. Sign up and create a SearchHub key

    Open the maker’s site, sign up and create an API key for the next step. Check the maker’s site for pricing and free plans.

    Open the SearchHub site ↗

  3. Click this button to open VS Code

    Open in VS Code

    VS Code asks you to confirm; click Install

  4. Fill in your key

    In the SearchHub settings, SEARCHHUB_SECRET is empty; add your key and save

    Paste the key only into the app’s field, never into a chat or to anyone

  5. Open the AI chat in VS Code in Agent mode

  6. Try it

    Use SearchHub and tell me what you can do for me, then show me one thing

    ✓ If VS Code says it is using SearchHub or shows a SearchHub tool in the answer, you are connected

1 optional setting(s) (works without them)

The command above works without these. Add them only if you want to change something, following the maker’s description.

  • SEARCHHUB_HOME Directory holding store.json, settings.json and logs. Defaults to ~/.search-hub. Set this if you keep provider keys somewhere other than the default location.

Descriptions are as written by the maker.

Menu names checked against VS Code’s help page on Nov 11, 2026 · your screen may differ slightly by app version

Other apps that use MCP, such as Windsurf, Zed or Gemini CLI, each add servers differently. See how in the app list.

See every app that uses MCP →

JSON settings are under “For developers” below

Stuck? Ask people who use SearchHub💬 Discussion →
For developers: Terminal commands and JSON settings

Installed on your computer

Claude Code

claude mcp add --scope user searchhub --env SEARCHHUB_SECRET=your-value -- npx -y searchhub mcp

Claude Desktop (claude_desktop_config.json)

{
  "mcpServers": {
    "searchhub": {
      "command": "npx",
      "args": [
        "-y",
        "searchhub",
        "mcp"
      ],
      "env": {
        "SEARCHHUB_SECRET": "your-value"
      }
    }
  }
}

Cursor (~/.cursor/mcp.json)

{
  "mcpServers": {
    "searchhub": {
      "command": "npx",
      "args": [
        "-y",
        "searchhub",
        "mcp"
      ],
      "env": {
        "SEARCHHUB_SECRET": "your-value"
      }
    }
  }
}

VS Code (mcp.json)

{
  "servers": {
    "searchhub": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "searchhub",
        "mcp"
      ],
      "env": {
        "SEARCHHUB_SECRET": "your-value"
      }
    }
  }
}

Values you fill in

  • SEARCHHUB_HOME env
    Directory holding store.json, settings.json and logs. Defaults to ~/.search-hub. Set this if you keep provider keys somewhere other than the default location.
  • SEARCHHUB_SECRET secret required env
    Master key used to decrypt stored provider keys. Must match the value that was in effect when the keys were saved.

Descriptions are as written by the maker.

These settings are generated from the maker’s registry entry. If the README says otherwise, follow the README.

At a glance

Downloads per weeki
67/wk
Connection
Runs on your computer
Latest versioni
0.1.10
Published to registryi
Sep 22, 2026
Code last changedi
Sep 22, 2026
Maker
woodcoal
Packages
npm: searchhub
Website
github.com
Registry status
Active

Which apps can use it

Based on how this server connects and on each app’s own docs, checked Nov 10, 2026.

Run on your computer in

ClaudeGooseLM StudioMsty StudioCherry StudioCursorVS Code + GitHub CopilotVisual StudioWindsurf (Devin Desktop)ZedKiroClineContinueJetBrains AI AssistantClaude CodeCodex CLIGemini CLIOpenCodenodecodeWarpLibreChatRaycast

All apps, with pros and cons →

Related guides

What it can do

Runs on your computer; the tool list appears in your AI app after you install it.

Basic checksi

We check information anyone can see; we have not read the code. Checks that do not apply are left out of the count. · Checked Nov 19, 2026

  • ✓ Pass

    Maker matches the repo

    The registry name was verified with the GitHub account woodcoal, which owns the repo

  • ✓ Pass

    Still maintained

    Code last changed 2 months ago

  • ✓ Pass

    Has a licence

    Uses MIT

  • – Not applicable

    Endpoint responds

    This one runs on your computer; there is no internet endpoint

  • – Not applicable

    Sign-in with OAuth

    Runs on your computer and uses local settings instead

  • … Not checked yet

    No hidden instructions in tool descriptions

    Runs on your computer; we can only read tool lists from internet endpoints

Published vulnerabilities (OSV.dev)

No entries on OSV.dev for searchhub@0.1.10

Checks only this package version, not every dependency · checked Nov 15, 2026

What we check → · JSON

Makers: ask for a re-check or report wrong info
For makers: add a badge to your README

If you made this, paste this code into your README. The badge links back to this page.

[![Featured on PopNx MCP](https://mcp.popnx.com/badge/woodcoal-searchhub.svg)](https://mcp.popnx.com/en/servers/woodcoal-searchhub)

Discussion

Ask, share a tip or report that it does not work. Sorted by what people marked helpful.

No posts yet. Be the first to ask or share.

Posts here are written by users, not the PopNx team.

Sign in to post

User reviews

No reviews yet

Sign in to write a review

Compared with others in Search & AI memoryi

  • More stars than 86% of the other 6416 servers in this category
  • Published to the registry more recently than 38% of the other 6416 servers in this category
  • Basic checks equal to or better than 99% of the other 6416 servers in this category

Compared with every active server in this category in the registry. Stars count only when the publisher owns the repo.

Common questions

Is SearchHub safe?

It passed 3 of 3 applicable basic checks. We have not read the code. Before adding a key or token, see what access the server asks for and use a key with only the permissions you need.

What keys or codes does it need?

You need to fill in: SEARCHHUB_SECRET

Does it run on my computer or in the cloud?

It runs on your computer. Your AI app starts it when needed, and data does not pass through the maker’s servers (unless it calls an online service itself).

Is it still maintained?

The GitHub repo last changed 2 months ago, and the latest version (0.1.10) reached the registry 2 months ago.

Which apps can use it?

Apps that support MCP, such as Claude Desktop, Claude Code, Cursor and VS Code. You also need Node.js on your computer.

What can I use instead?

In the same category: OpenSEO, Exa, Microsoft Learn MCP, Docs, COTAL actions (cotal.ai)

Similar alternatives

Same category, other makers, commands already checked. Official ones first, then by stars.

Reading a card:↓ Downloads per weeki★ GitHub starsiThree pillars: reviews · checks · usageiUpdated = latest version published to the registryi

OpenSEO

Keyword research, site audits, rank tracking and AI visibility for your AI agent.

by every-appWidely used★ 28.3KUpdated 5 days ago

Runs in the cloud✓ everyapp.com

Exa

Connect AI agents to Exa for web search, content fetching, and multi-step research.

by exa-labsWidely used★ 5.2KUpdated 2 months ago

Runs in the cloud✓ service owner · exa.aiTried by the PopNx team

Microsoft Learn MCP

Official Microsoft Learn MCP Server – real-time, trusted docs & code samples for AI and LLMs.

by MicrosoftDocsWidely used★ 2KUpdated 12 months ago

Runs in the cloud✓ service owner · microsoft.comTried by the PopNx team

Docs

Search and read Empryo's documentation. Read-only, no auth, no local access.

by proxysoulGrowing★ 1.6KUpdated 2 months ago

Runs in the cloud✓ empryo.com
Compared with similar ones
This one
SearchHub
OpenSEOExaMicrosoft Learn MCPDocsCOTAL actions (cotal.ai)
Runs whereInstalls on your computerRuns in the cloud, nothing to installRuns in the cloud, nothing to installRuns in the cloud, nothing to installRuns in the cloud, nothing to installRuns in the cloud, nothing to install
Needs a keyYesNoNoNoNoNo
Add with + in ClaudeNoYesYesYesNoNo
Basic checks3/35/52/44/44/44/4
LicenseMITMITMITCC-BY-4.0NOASSERTIONApache-2.0
PriceNo cost listed in the registryNo cost listed in the registryNo cost listed in the registryNo cost listed in the registryNo cost listed in the registryNo cost listed in the registry

README from the maker

Open the README

Copied from the maker’s repo as written. PopNx MCP has not reviewed or endorsed it. HTML, images and scripts are removed. Links lead off this site.

SearchHub

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 应用和内部自动化服务。

为什么用 SearchHub?

单个搜索供应商出问题时,Agent 不应该直接失明:

  • 一个 Key 失效或被限流:自动换下一个 Key
  • 一个供应商故障或超时:自动切换供应商
  • 连续失败:熔断,冷却后半开探测
  • 每个 Key 独立设置 QPS、日/月/总配额
  • HTTP API、CLI、MCP 和管理后台统一提供
  • 自托管,密钥和调用日志留在自己的机器上

界面预览

概览 —— 每个供应商一张卡片:熔断状态、可用密钥数、冷却 / 隔离数、能力标签与全局默认配额。

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

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

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

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

30 秒启动

npm 全局安装

要求 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 试用
npx searchhub start
Docker Compose
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 用的是 < 生成的值请自行保管:SEARCHHUB_SECRET` 是供应商密钥的解密主密钥,设置之后不要再更改;改了已落盘的密钥将无法解密。

不要把 .env 提交到 Git。生产环境请把 SEARCHHUB_ADMIN_PASSWORD、SEARCHHUB_SECRET 和供应商密钥放进安全的 Secret 管理系统。

第一次配置

  1. 登录管理后台。
  2. 进入「供应商」或「密钥管理」,添加 Serper / Tavily / Exa / AnySearch 的 API Key。
  3. 进入「API 授权」,创建一个调用方 API Key。
  4. 用调试台或 CLI 发起第一次搜索。
searchhub keys add serper '<provider-key>' --label primary --qps 2

searchhub keys add tavily ' ' --label backup --monthly-quota 1000 searchhub apikey create my-agent searchhub search "latest MCP servers" --size 5

供应商密钥和 SearchHub 调用方 API Key 是两套凭据:前者用于访问上游搜索服务,后者用于保护 SearchHub 接口。

MCP 接入

本地 stdio

适用于 Claude Desktop、Cursor、Cline 等支持本地 MCP 的客户端:

{

"mcpServers": { "searchhub": { "command": "searchhub", "args": ["mcp"] } } }

CLI 会从当前目录 .env 和环境变量读取配置。也可以指定数据目录:

{

"mcpServers": { "searchhub": { "command": "searchhub", "args": ["mcp", "--home", "/path/to/searchhub-data"] } } }

Streamable HTTP

主服务启动后默认提供 /mcp:

{

"mcpServers": { "searchhub": { "url": "http://your-host:8787/mcp", "headers": { "x-api-key": "sh_xxxxxxxxxx" } } } }

也可以只启动 MCP HTTP 服务:

searchhub mcp --http --port 8788

内置工具:

工具用途
searchhub_search执行统一搜索
searchhub_status查看供应商健康度、熔断状态和密钥数量
searchhub_providers查看供应商及其能力

HTTP API

健康检查无需认证:

curl http://localhost:8787/api/health

搜索接口使用管理后台「API 授权」生成的 Key,或 SEARCHHUB_API_TOKEN:

curl -X POST http://localhost:8787/api/search \

-H 'content-type: application/json' \ -H 'x-api-key: sh_xxxxxxxxxx' \ -d '{"q":"MCP server","pageSize":10,"timeRange":"week","site":"github.com"}'

返回结果统一为:

{

"query": { "q": "MCP server", "pageSize": 10 }, "results": [ { "title": "...", "url": "https://...", "snippet": "...", "provider": "serper" } ], "meta": { "provider": "serper", "tookMs": 842, "degraded": false, "ignoredParams": [], "attempts": [{ "provider": "serper", "ok": true, "tookMs": 842 }] } }

meta.attempts 会记录本次请求尝试过的 Key 和供应商,便于排障和观察降级。

接口概览:

接口认证说明
GET /api/health无健康检查和供应商健康度
GET/POST /api/searchAPI Key统一搜索
POST /api/admin/login管理密码登录后台
/api/admin/*管理会话密钥、供应商、日志、用量和 API Key 管理
POST /mcpAPI KeyStreamable HTTP MCP

内置供应商

ID定位主要能力
serperGoogle SERP 原始结果翻页、时间范围、站内、地域、语言
tavily面向 Agent 的实时搜索时间范围、站内、地域、语言、安全搜索
exa语义搜索时间范围、站内
anysearch统一实时搜索语言、地域;支持匿名降级

SearchHub 会将各供应商不同的返回结构和错误码归一化。新增供应商只需实现适配器、错误分类并注册到 src/providers/index.ts。

容灾与配额

故障处理
Key 无效(401/403)隔离该 Key,切换下一个 Key
Key 限流(429)按 Retry-After 冷却,切换下一个 Key
配额耗尽冷却到下一重置周期,切换下一个 Key
供应商故障(5xx/超时)不惩罚 Key,累计熔断计数并切换供应商
参数错误(400)不重复请求当前供应商,直接返回或换下一家

每个供应商和每把 Key 都可以设置:

  • QPS
  • 日配额
  • 月配额
  • 总配额
  • 优先级和超时
  • 单供应商最大换 Key 次数
  • 熔断阈值和冷却时长

内置默认配额(按各家免费额度预设)、供应商级继承规则与三级配额的完整说明见 docs/quotas.md; 故障分类的完整判定表与熔断状态机见 docs/providers.md。

CLI

searchhub start                         # 启动 API 和管理后台

searchhub search "openai" --size 5 # 直接搜索 searchhub status # 查看健康度 searchhub keys list # 列出密钥状态 searchhub keys test serper primary # 测试某把 Key searchhub usage --json # 查看用量 searchhub logs --prune # 清理过期日志 searchhub apikey create my-agent # 创建调用方 API Key searchhub mcp # 启动 stdio MCP searchhub mcp --http --port 8788 # 启动 HTTP MCP

数据、日志与安全

默认目录:

~/.search-hub/

├── settings.json ├── store.json └── log/ ├── searchhub-YYYY-MM-DD.log └── calls.jsonl

  • 供应商密钥使用 SEARCHHUB_SECRET 进行 AES-256-GCM 加密存储;未配置时会告警。
  • 管理密码只保存 scrypt 哈希。
  • API Key 只保存 SHA-256 哈希,明文只在创建时显示一次。
  • 日志中的 API Key、管理令牌和密钥原文会脱敏。
  • SEARCHHUB_LOG_RETENTION_DAYS 默认保留 14 天,设为 0 表示永久保留。
  • 运行时冷却状态、统计和用量在内存中,重启会清零;多实例部署需要 Redis 化改造。

完整环境变量见 .env.example。 目录结构、后台密码优先级与找回、数据目录迁移、认证体系细节见 docs/data-and-settings.md; 日志切分与保留策略、调用日志、用量统计口径见 docs/logging.md。

从源码开发

npm install

npm run typecheck npm run build npm start

前端开发服务器:

npm run dev       # 后端

npm run dev:web # Vite 前端,默认 http://localhost:5173

Docker 部署

项目提供多阶段 Dockerfile 和 docker-compose.yml:

docker build -t searchhub:local .

docker run --rm -p 8787:8787 \ -e SEARCHHUB_SECRET="$(node -e "console.log(require('crypto').randomBytes(32).toString('hex'))")" \ -e SEARCHHUB_ADMIN_PASSWORD="$(node -e "console.log(require('crypto').randomBytes(12).toString('base64url'))")" \ -v searchhub-data:/data \ searchhub:local

容器内默认:

  • 基于 Node.js 24(Active LTS)
  • 监听 0.0.0.0:8787
  • SEARCHHUB_HOME=/data
  • 使用非 root 用户 searchhub(uid 10001)
  • GET /api/health 作为 Docker healthcheck
  • /data 保存配置、密钥密文和日志

文档

文档内容
docs/quotas.md三级配额、QPS 令牌桶、内置默认配额表、供应商级继承规则
docs/logging.md日志按天切分与保留策略、调用日志、用量统计口径
docs/data-and-settings.md数据目录、系统设置、后台密码优先级与找回、数据迁移
docs/providers.md供应商能力矩阵、故障分类与熔断、如何扩展新供应商
docs/limitations.md已知限制与适用边界——部署前请先读这一篇

许可

MIT License。第三方搜索服务的使用仍需遵守各自的服务条款和计费规则。

Copyright (c) 2026 木炭