Skip to main content
Glama
multi-api-web-search

multi-api-web-search

Multi-API Web Search (MCP)

English | 简体中文

MCP Compatible Node.js License: MIT

Live web search for MCP clients through any OpenAI-compatible /v1 endpoint. A built-in setup tool benchmarks your models, picks the best search mode (native or tool) for each one, and writes .env automatically.

Features

  • Adaptive search mode: supports both native search (built-in grounding) and tool search (explicit web_search tool call), automatically selecting the best mode per model.

  • Hybrid search: query 2+ models in parallel and get side-by-side answers with a merged, deduplicated source list (and resolved Gemini grounding redirect URLs).

  • Stream-aware resilience: tracks real streamed output (thinking or answer tokens, ignoring relay keep-alive pings), retries silent or stalled connections, and falls back to MULTI_WEB_SEARCH_FALLBACK_MODEL on failure.

  • Smart query language: automatically searches in the query's language plus English for technical topics and Chinese for China-related topics.

Related MCP server: qsearch

Free Web Search API Backends

Any OpenAI-compatible provider or gateway (such as New API / One API) with search-capable models works out of the box. You can also self-host free web search API backends directly:

Point MULTI_WEB_SEARCH_BASE_URL directly at either service, or put both behind an API gateway to run ChatGPT and Gemini together in hybrid mode.

Quick Start

1. Install

git clone https://github.com/Peteroooooooo/multi-api-web-search-mcp.git
cd multi-api-web-search-mcp
npm install

2. Configure endpoint

cp .env.example .env

Set your endpoint and key in .env:

MULTI_WEB_SEARCH_BASE_URL=https://api.your-provider.com/v1
MULTI_WEB_SEARCH_API_KEY=sk-your-key-here

3. Benchmark & auto-configure models

npm run setup
  • Interactive checklist to select which models on your endpoint to test (or pass -- --models a,b, -- --all, -- --hybrid, -- --single).

  • Benchmarks accuracy, latency, and citation count in both native and tool modes, then writes the winning model, fallback model, and per-model modes to .env.

  • Run npm run doctor (or double-click doctor.bat on Windows) to inspect the leaderboard and pick models manually.

4. Register in MCP client

The server loads .env from its own directory, so the client config only needs the entry script path.

Claude Code:

claude mcp add -s user multi-api-web-search -- node "/path/to/multi-api-web-search-mcp/src/index.js"

Cursor / Claude Desktop (mcp.json):

{
  "mcpServers": {
    "multi-api-web-search": {
      "command": "node",
      "args": ["/path/to/multi-api-web-search-mcp/src/index.js"]
    }
  }
}

Tool: multi_api_web_search

Returns an answer with a numbered, deduplicated source list.

Parameter

Type

Default

Description

query

string (required)

-

Search query or question

model

string

.env default

Specific model name or hybrid

max_sources

number

15

Maximum sources to return (1–30)

focus

'normal' | 'broad' | 'precise'

'normal'

broad for multi-angle deep research (up to 30 sources); precise for verifying a single latest fact

reasoning_effort

'low' | 'medium' | 'high'

.env default

Per-call reasoning effort override

Environment Variables

Variable

Required

Default

Description

MULTI_WEB_SEARCH_BASE_URL

Yes

-

OpenAI-compatible /v1 base URL

MULTI_WEB_SEARCH_API_KEY

Yes

-

API key for the endpoint

MULTI_WEB_SEARCH_MODEL

No

-

Default model name, or hybrid

MULTI_WEB_SEARCH_HYBRID_MODELS

No

-

Comma-separated models used when model=hybrid

MULTI_WEB_SEARCH_FALLBACK_MODEL

No

-

Fallback model when the primary model fails

MULTI_WEB_SEARCH_FORCE_TOOL

No

-

Comma-separated models/fragments forced to explicit web_search tool mode

MULTI_WEB_SEARCH_FORCE_NATIVE

No

-

Comma-separated models/fragments forced to native search mode

MULTI_WEB_SEARCH_TIMEOUT_MS

No

25000

Max wait (ms) for first streamed thinking/answer token before retrying

MULTI_WEB_SEARCH_IDLE_TIMEOUT_MS

No

30000

Max idle gap (ms) after streaming starts before cutting the stream

MULTI_WEB_SEARCH_REASONING_EFFORT

No

unset

Default reasoning effort (low / medium / high); auto-skipped for models that reject it

MULTI_WEB_SEARCH_FOCUS

No

unset

Default focus mode (broad or precise) when not specified by caller

MULTI_WEB_SEARCH_LANGUAGE

No

topic

Search term language strategy: topic (by topic/region) or bilingual (always EN + ZH)

MULTI_WEB_SEARCH_ALIAS

No

off

Set to 1 to also register the tool as web_search

License

MIT

Available Tools

2 tools

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    C2.8/5.0

    Scored across 2 tools

    Disambiguation1/5

    Both tools have the exact same description and purpose, differing only in the name prefix. An agent cannot reliably choose between them because they appear to be identical duplicates.

    Naming Consistency2/5

    Both names use snake_case, but 'web_search' and 'multi_api_web_search' are near-duplicates with no clear convention. The prefixed variant is inconsistent with the generic one, making the naming feel redundant rather than patterned.

    Tool Count2/5

    Two tools exist but they appear to serve the exact same function. One tool would be appropriate for this simple search server; the extra tool is redundant and does not earn its place.

    Completeness5/5

    For a web search server, the tool surface covers the core capability of performing live internet searches. No additional operations like create, update, or delete are relevant to this domain, so there are no obvious gaps.

    Maintenance

    ActivityActive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      Enables web search and site-specific search capabilities through the Deepsearch model. Provides unified access to broad web retrieval and targeted site search functionality within the MCP ecosystem.
      2
      5
      Apache 2.0
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI agents to perform web searches with full content retrieval and multi-engine provenance, including trust scoring and local corpus persistence, via MCP integration.
      4
      Apache 2.0
    • 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 agents and automation tasks to perform structured Google and Bing web searches through an MCP interface, with high-throughput querying and batch/request-status workflows.
      MIT