colaboy519/search-router
Smart search routing for AI agents — routes queries to the best provider based on language, query type, and provider capabilities
Platform-specific configuration:
{
"mcpServers": {
"search-router": {
"command": "npx",
"args": [
"-y",
"search-router"
]
}
}
}Add the config above to .claude/settings.json under the mcpServers key.
Smart search routing for AI agents — automatically picks the best search provider based on query language, type, and provider availability.
Search Router is a lightweight HTTP service that sits between your AI agent and multiple search APIs. When a query arrives, it classifies the language and query type, then routes to the most appropriate provider (Google via Serper, Bocha for Chinese-language search, Baidu via SearchAPI.io, or Parallel Search). If a provider fails or lacks an API key, it automatically falls back to the next best option. The result is a single, stable /search endpoint your agent can call regardless of which underlying providers you have configured.
Install:
pip install search-routerConfigure API keys:
mkdir -p ~/.search-router
cat > ~/.search-router/config.yaml << 'EOF'
api_keys:
google: "" # Serper API key — https://serper.dev
parallel_search: "" # Parallel Search API key
bocha: "" # Bocha API key — https://bochaai.com
baidu: "" # SearchAPI.io key for Baidu — https://www.searchapi.io
telemetry: false
host: "127.0.0.1"
port: 8100
EOFFill in the keys for the providers you want to use. At least one key is required.
Run:
search-routerThe server starts at http://localhost:8100.
~/.search-router/config.yaml:
api_keys:
google: "your-serper-api-key"
parallel_search: "your-parallel-search-key"
bocha: "your-bocha-api-key"
baidu: "your-searchapi-io-key"
telemetry: false # set true to opt in to anonymous usage stats
host: "127.0.0.1" # bind address
port: 8100 # portYou only need to provide keys for the providers you want to use. Unconfigured providers are skipped automatically.
curl -s -X POST http://localhost:8100/search \
-H "Content-Type: application/json" \
-d '{"query": "latest AI Loading reviews...