Skip to main content
Glama
sonar-web-search-mcp

sonar-web-search-mcp

by chirag127

sonar-web-search-mcp

MCP (Model Context Protocol) stdio server for live web search, deep research, and fact-checking powered by Perplexity Sonar Pro or any realtime web-grounded OpenAI-compatible model (sonar-deep-research, sonar, gpt-4o-search-preview, :online gateway models, Gemini-grounded gateways) through sap-aic-openai-proxy or compatible gateways.

Features

  • sonar_search (default sonar-pro): Live web search supporting any realtime model override, optional search_context_size (low, medium, high), focus (detailed, concise, sources_only), recency, include_domains, and exclude_domains.

  • sonar_research (default sonar-deep-research): Multi-source research synthesis (standard or comprehensive depth) with inline citations and deduplicated source URLs.

  • sonar_fact_check (default sonar): Claim verification returning a normalized verdict (supported, contradicted, mixed, unverified) and supporting citations.

  • sonar_list_models: Queries /v1/models on the configured proxy/gateway so callers can discover available web-capable models dynamically.

  • Universal citation extraction: Merges Perplexity citations/search_results, OpenAI/OpenRouter url_citation annotations (including content snippets), Gemini groundingMetadata.groundingChunks, Markdown links, reference footnotes, and bare URLs.

  • Stdout hygiene: JSON-RPC uses stdout exclusively; startup diagnostics are written to stderr.

Related MCP server: Perplexity MCP Server

Configuration

Variable

Default

Description

WEB_SEARCH_BASE_URL / SAP_PROXY_BASE_URL

http://127.0.0.1:8787

Base URL of sap-aic-openai-proxy or OpenAI-compatible gateway

WEB_SEARCH_API_KEY / SAP_PROXY_API_KEY

(unset)

Optional Bearer token if gateway auth is required

WEB_SEARCH_MODEL / SONAR_SEARCH_MODEL

sonar-pro

Default model ID for sonar_search

WEB_SEARCH_RESEARCH_MODEL / SONAR_RESEARCH_MODEL

sonar-deep-research

Default model ID for sonar_research

WEB_SEARCH_FAST_MODEL / SONAR_FACT_CHECK_MODEL

sonar

Default model ID for sonar_fact_check

WEB_SEARCH_TIMEOUT_MS / SONAR_TIMEOUT_MS

90000

Request timeout for sonar_search and sonar_fact_check

WEB_SEARCH_RESEARCH_TIMEOUT_MS / SONAR_RESEARCH_TIMEOUT_MS

180000

Request timeout for sonar_research

WEB_SEARCH_MAX_TOKENS / SONAR_MAX_TOKENS

2048

Default max_tokens for sonar_search

WEB_SEARCH_RESEARCH_MAX_TOKENS / SONAR_RESEARCH_MAX_TOKENS

4096

Default max_tokens for sonar_research

Usage

npm install
npm test
npm start

MCP client config (stdio)

{
  "command": "node",
  "args": ["C:/ws/repos/own/public/cli-tools/sonar-web-search-mcp/bin/sonar-web-search-mcp.mjs"],
  "env": {
    "SAP_PROXY_BASE_URL": "http://127.0.0.1:8787"
  }
}

Tool Schema Changelog

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

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Enables AI assistants to perform web searches and retrieve real-time information using Perplexity AI's Sonar models, with support for multiple search modes and easy integration with MCP clients.
      5
      1
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents to perform live web searches across 9 engines, scrape web pages into clean formats, and run agentic research with citations via MCP.
      7
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Gives MCP-capable agents live web access: search the web, scrape pages into Markdown (including JavaScript-heavy and bot-protected sites), and extract named fields as JSON, with job polling, token-aware content offloading, and built-in research guidance. Ships as a self-hostable stdio or HTTP service with spend caps and per-request key support.
      7
      MIT