Skip to main content
Glama

unified-search-mcp

A smart multi-signal MCP search proxy, CLI (omni-search), and Agent Skill that pools Tavily, Exa, and Linkup API keys with intra-provider round-robin load balancing, weighted intent routing, tiered circuit breakers, and zero raw-key disk persistence.

Bilingual by design (English & Vietnamese): Weighted routing natively handles both English technical/academic/startup queries and Vietnamese legal, tax, labor, and real-time market queries.


Key Features

  • Multi-Provider Key Pooling & Round-Robin: Configure 1 to N keys per provider (TAVILY_KEY_POOL, EXA_KEY_POOL, LINKUP_KEY_POOL). Rotates keys within the primary provider before failing over to secondary providers.

  • Weighted Multi-Signal Intent Router: Scores legal/regulatory, breaking news, academic papers, code/GitHub, startup/market, and deep-synthesis signals with anti-hijacking rules (e.g., regulatory queries mentioning "company" still route to Legal RAG rather than Company profiles).

  • Hybrid Parallel Mode (mode="hybrid"): Runs the top two providers concurrently (asyncio.gather) and deduplicates normalized URLs.

  • Empty-Result Fast-Jump (HTTP 204): Zero-result responses jump immediately to the next provider without penalizing the active key.

  • Tiered Circuit Breaker & Secure Shared State:

    • 401 / 402 / 403 / 432 / 433 (quota/auth) → 3600s cooldown

    • 429 (rate limit) → 60s cooldown

    • 5xx / timeout → 30s cooldown

    • State persisted to $TMPDIR/unified_search_pool_state.json (chmod 0600) using 16-hex SHA-256 key_id() digests - raw API keys are never written to disk.

  • TTL Cache (300s) & Shared HTTP/2 Connection Pool: Cuts duplicate API credit spend.

  • OmniSearch Engine (omni-search): 10-intent classifier, URL tracking-parameter sanitizer (utm_*, fbclid, gclid), sentence-boundary context trimming, and numeric conflict detection.


Related MCP server: Search Toolkit

Architecture

  [ AI Clients: Claude / Cursor / Antigravity / Gemini CLI / Codex / Zed ]
                                      │
                                      ▼
                     [ unified-search-mcp (FastMCP) ]
                     tools: web_search | web_extract | pool_status
                                      │
          ┌───────────────────────────┼───────────────────────────┐
          ▼                           ▼                           ▼
   [ Tavily Pool ]              [ Exa Pool ]               [ Linkup Pool ]
  Legal / News / RAG       Academic / Code / Market        Deep Synthesis

3-Step Quickstart

1. Clone & Configure Keys (Never Committed)

git clone https://github.com/lucas-dunght/unified-search-mcp.git
cd unified-search-mcp
cp .env.example .env
chmod 600 .env

Edit .env (gitignored) with your own API keys from Tavily, Exa, and/or Linkup:

TAVILY_KEY_POOL=tvly-your-key-1-here,tvly-your-key-2-here
EXA_KEY_POOL=exa-your-key-1-here
LINKUP_KEY_POOL=linkup-your-key-1-here

2. Install

Automatic installer (macOS / Linux):

chmod +x scripts/install.sh
./scripts/install.sh

Windows (PowerShell):

.\scripts\install.ps1

Or manually with uv:

uv venv --python 3.12
uv pip install --python .venv/bin/python -e .

3. Verify Locally

.venv/bin/omni-search --self-test --json
.venv/bin/omni-search --status
.venv/bin/omni-search -q "Python httpx async client timeout" --dry-run --json

MCP Client Integration

After running ./scripts/install.sh, point your MCP client to .venv/bin/unified-search-mcp (or .venv\Scripts\unified-search-mcp.exe on Windows):

Claude Desktop / Cursor / Antigravity / Gemini CLI

{
  "mcpServers": {
    "unified-search": {
      "command": "/path/to/unified-search-mcp/.venv/bin/unified-search-mcp",
      "args": []
    }
  }
}

Claude Code CLI

claude mcp add unified-search "/path/to/unified-search-mcp/.venv/bin/unified-search-mcp"

OpenAI Codex CLI (~/.codex/config.toml)

[mcp_servers.unified-search]
  command = "/path/to/unified-search-mcp/.venv/bin/unified-search-mcp"
  args = []
  enabled = true
  startup_timeout_sec = 15
  tool_timeout_sec = 120

See docs/SETUP.md for full instructions covering Zed, OpenCode, Hermes Agent, DeepSeek Harness, Windows PowerShell, and environment variable precedence.


CLI & Agent Skill

# Quick lookup
omni-search -q "FastMCP tool decorator examples" --profile quick

# Deep research JSON output
omni-search -q "Deep dive multi-agent orchestration patterns" --profile deep --json

# Hybrid mode across top 2 providers
omni-search -q "PostgreSQL vs MySQL concurrency" --mode hybrid

# Check key pool & round-robin pointers
omni-search --status

Installing the Agent Skill

Copy skills/omni-search/ into your agent's global skills directory (for example ~/.gemini/config/skills/omni-search or ~/.claude/skills/omni-search).


Documentation

Full Diataxis documentation lives in docs/:

Document

Quadrant

Description

Getting Started Tutorial

Tutorial

Zero-to-working walkthrough: install, self-test, .env keys, live search, and MCP setup

Setup & Multi-Client Guide

How-to

Cross-platform setup for Claude Desktop, Claude Code, Antigravity, Cursor, Codex, Zed, OpenCode, Hermes, Windows

How to Operate & Audit Secrets

How-to

Key rotation, hot-reload, cooldown resets, routing overrides, pre-commit secret audits, and skill installation

API, CLI & Configuration Reference

Reference

Exact MCP tool schemas, CLI flags, Python API signatures, env precedence, and constants

Architecture & Design Decisions

Explanation

Weighted multi-signal router, anti-hijacking rules, HTTP 204 fast-jump, and SHA-256 state trade-offs

Hướng Dẫn Nhanh Tiếng Việt

Quick Guide (VI)

Cài đặt 3 bước, bảng tra cứu nhanh MCP/CLI/Router và checklist chống lộ API key

Security Policy

Security

Key precedence, SHA-256 key_id() hashing, log scrubbing, and rotation checklist


Security & Secret Hygiene

  • All API keys are loaded at runtime via process environment variables, UNIFIED_SEARCH_ENV_FILE, .env, or ~/.mcp_env (see SECURITY.md).

  • Run the built-in secret scanner before pushing:

python3 scripts/audit_secrets.py
python3 scripts/audit_secrets.py --check-git-history
  • GitHub Actions CI runs pytest, omni-search --self-test, audit_secrets.py --check-git-history, and gitleaks on every push and pull request.


License

MIT

Available Tools

3 tools
pool_statusPool StatusA

Inspect API key pool health, round-robin cursors, usage counts, and cooldown timers.

Inputs: no named parameters. Returns: result

web_extractWeb ExtractA

Extract full page text from a URL via Tavily Extract with Exa Contents fallback.

Inputs: url (required). Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 3 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose: web_search performs searches, web_extract retrieves page text from a URL, and pool_status reports operational state. There is no meaningful overlap between search, extraction, and pool inspection.

    Naming Consistency4/5

    All names use snake_case and follow a noun-oriented pattern, which is readable. However, pool_status breaks the web_ prefix used by the two primary tools, making the convention only mostly consistent rather than uniform.

    Tool Count5/5

    Three tools is a well-scoped surface for a unified search server: search, extract, and inspect the key pool. Each tool earns its place with no filler.

    Completeness4/5

    The core lifecycle of search and extraction is covered, along with operational visibility into the API pool. Minor gaps could include batch extraction or structured result controls, but these are workable omissions rather than dead ends.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables AI agents to perform web searches, extract webpage content, and conduct end-to-end search-and-extract operations using multiple search providers and content extraction methods.
      -
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents to perform web search, extraction, and research across multiple provider backends with persistent multi-key rotation and auditable routing. Supports MCP, CLI, and Agent Skill entry points.
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI clients to perform unified web searches across multiple search providers with automatic key rotation, failover, and circuit breaking, and to inspect provider status and capabilities.
      491 npm
      3
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables AI agents to perform reliable web searches through multiple vendors with automatic failover, keyless-first access, TTL caching, and concurrent request coalescing.
      1
      MIT