Search2ai logo

Search2ai

Self-hosted MCP gateway for web search, news lookup, and page extraction with configurable provider fallback.

Install Search2ai

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "search2ai": {
      "command": "npx",
      "args": [
        "-y",
        "search2ai"
      ],
      "env": {
        "SEARCH1API_KEY": "YOUR_VALUE_HERE",
        "TAVILY_KEY": "YOUR_VALUE_HERE",
        "BRAVE_KEY": "YOUR_VALUE_HERE",
        "EXA_KEY": "YOUR_VALUE_HERE",
        "SERPER_KEY": "YOUR_VALUE_HERE",
        "SERPAPI_KEY": "YOUR_VALUE_HERE",
        "SEARXNG_BASE_URL": "YOUR_VALUE_HERE",
        "AUTH_KEYS": "YOUR_VALUE_HERE"
      }
    }
  }
}

Settings โ†’ Developer โ†’ Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Values are written into the snippet above so you can paste it as is. They never leave your browser.

Claude Code command
claude mcp add --env SEARCH1API_KEY=YOUR_VALUE_HERE --env TAVILY_KEY=YOUR_VALUE_HERE --env BRAVE_KEY=YOUR_VALUE_HERE --env EXA_KEY=YOUR_VALUE_HERE --env SERPER_KEY=YOUR_VALUE_HERE --env SERPAPI_KEY=YOUR_VALUE_HERE --env SEARXNG_BASE_URL=YOUR_VALUE_HERE --env AUTH_KEYS=YOUR_VALUE_HERE --transport stdio search2ai -- npx -y search2ai

Run in your terminal. Add --scope project to share it with your team through .mcp.json.

Install not yet sandbox-testedโ€” we haven't run this command through our automated sandbox yet. Not a red flag; we're working through the catalog.

Overview

search2ai MCP server exposes unified search, news, and page-extraction tools through MCP, using the providers you configure. It can run locally over stdio or as an HTTP service with a Streamable HTTP MCP endpoint, while also offering REST and TypeScript interfaces. Separate provider chains, fallback handling, and optional caching help route requests when a configured service times out, is rate limited, or fails. Reach for it when an agent needs self-hosted web data access without coupling its tool calls to one search provider.

Use cases

  • Give an AI client unified web search tools
  • Route search requests across multiple providers
  • Extract content from web pages for an agent
  • Serve search and MCP from one HTTP deployment
  • Embed search, news, and crawl calls in a TypeScript application

Key features

  • MCP tools for search, news, and page extraction
  • Configurable provider fallback chains
  • Local stdio and remote Streamable HTTP modes
  • REST API and TypeScript library
  • In-memory and Cloudflare KV caching
  • Optional chat proxy for tool-calling models

Security & health

What it can reach and how reliably it runs โ€” from our own checks, not the maintainerโ€™s claims.

ActiveNo health check has run yet.

Recent health check succeeded.

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 5h ago via OSV.dev ยท search2ai (npm)

How Search2ai works

What search2ai MCP server does

search2ai connects AI clients and applications to configured search, news, and page-extraction providers. Through MCP, it presents the gateway's unified tools rather than exposing each provider's individual API shape. Results use common fields such as titles, URLs, snippets, and optional dates or page content.

The server supports local MCP over stdio and remote MCP through an HTTP service. The same deployment can expose REST endpoints for applications and MCP for AI clients. A JavaScript or TypeScript library is also available when embedding the gateway directly in an application is more suitable than running a separate process.

An optional chat proxy can provide web access to chat clients with custom API base URLs. In that mode, search2ai calls the configured model upstream while using its provider configuration for web access.

How it works

Configure one or more providers and assign them to the operations they support. Search, news, and crawl requests can use separate fallback chains. When a provider is rate limited, times out, or fails, the gateway tries the next configured provider and reports the responding service along with warnings about earlier failures.

The local CLI reads .env.local and .env from its working directory, with existing process environment variables taking precedence. Library entry points do not load environment files; the host application supplies configuration directly or passes an environment object to the provided configuration helpers.

Caching can be handled in memory or through Cloudflare KV. Providers are opt-in: unconfigured services are not enabled automatically. A request needs a provider that supports its operation; for example, search requires a configured search provider, while crawl requires a page-extraction provider.

Setup and configuration

The local CLI and npm package require Node.js 22.18 or newer. Install or invoke the package with npm, then configure at least one provider. A basic local service can be started with:

Terminal
npx -y search2ai serve --host 127.0.0.1

For an MCP client using an mcpServers configuration, run npx -y search2ai mcp with the provider credentials in the client environment. A deployed HTTP service exposes MCP at /mcp; clients supporting Streamable HTTP can connect to that endpoint. If AUTH_KEYS is configured, remote clients send the gateway key as a bearer token.

Supported providers include Search1API, Tavily, Brave, Exa, Serper, SerpAPI, Google, SearXNG, Outcrawl, Cloro, Autom, Keenable, Specstream, Sofya, Jina, Firecrawl, and Parallel. Their capabilities vary across search, news, and page extraction. Parallel and Jina require explicit opt-in for the relevant operation, and SearXNG requires JSON output to be enabled.

Tools and capabilities

The MCP interface provides three gateway operations:

  • search retrieves structured web search results.
  • news retrieves news-oriented results where the selected provider supports the operation.
  • crawl extracts content from a page URL where a configured provider supports page extraction.

The gateway uses consistent request and response parameters across backends. Applications can use equivalent REST routes at /v1/search, /v1/news, and /v1/crawl, or call createGateway() from the TypeScript library. Hono applications can mount the routes and MCP endpoint under an application-defined path.

Limitations and notes

Provider capabilities are not interchangeable. Some providers support only search, while others support search and news but not page extraction. Google news requests use regular search with date sorting rather than a dedicated news endpoint.

A deployment with no configured search provider returns HTTP 503 for search requests. Provider credentials, service URLs, and fallback order must be configured explicitly. The library does not load .env files on its own, and remote MCP authentication applies only when AUTH_KEYS is configured.

Compatibility endpoints exist for selected Exa, Tavily, Search1API, SearXNG, and Firecrawl single-page API or SDK integrations. MCP clients use the unified gateway tools directly instead of those provider-specific compatibility routes.

Written by AllMCPs with AI assistance from the projectโ€™s README and listing data. How we build listings

Reviews

No reviews yet โ€” be the first to share how it worked for you.

Frequently Asked Questions about Search2ai

search2ai is an MCP server that connects AI clients to configured web search, news, and page-extraction providers. Its main tools are `search`, `news`, and `crawl`, which return unified results across supported backends. It runs locally over stdio or remotely through a Streamable HTTP MCP endpoint.

Run it with `npx -y search2ai mcp` from an MCP client configuration. Set at least one provider credential or service URL in the client environment, such as `SEARCH1API_KEY`. The local CLI and npm package require Node.js 22.18 or newer.

Yes, search2ai works with Cursor through its MCP configuration. Add a server entry that runs `npx -y search2ai mcp` and pass the provider environment variables. Cursor can then access the `search`, `news`, and `crawl` tools over stdio.

Yes, search2ai can try multiple configured providers in an operation-specific fallback chain. It moves to the next provider after rate limits, timeouts, or failures, and reports which provider answered along with warnings about earlier failures.

Yes, start the standalone HTTP service and connect an MCP client that supports Streamable HTTP to its `/mcp` endpoint. The same service provides `/v1/search`, `/v1/news`, and `/v1/crawl` for applications, and bearer authentication is available when `AUTH_KEYS` is configured.

Related MCP servers

Add a badge to your READMEShow itโ€™s listed โ€” live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewSearch2ai AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/search2ai?style=directory)](https://allmcps.com/mcp/search2ai)
HTML Embed
<a href="https://allmcps.com/mcp/search2ai"><img src="https://allmcps.com/api/badge/search2ai?style=directory" alt="Search2ai on AllMCPs" /></a>