fatwang2/search2ai

Help your LLMs online

What it solves

search2ai is a self-hosted search gateway designed for AI agents. It solves the problem of relying on a single search provider by aggregating multiple search engines (such as Tavily, Brave, Exa, Serper, SerpApi, Google, and SearXNG) into a single, Perplexity-compatible API. This ensures high availability through an automatic fallback chain that switches to the next provider if one fails, hits a rate limit, or times out.

How it works

The project provides a unified schema (title, url, snippet, date) regardless of the underlying provider. It can be deployed as a library, an HTTP service, a Model Context Protocol (MCP) server for tools like Claude and Cursor, or integrated into Hono applications. It supports three primary capabilities: general search, news search, and web crawling. Users provide their own API keys for the providers they wish to use.

Who it’s for

  • AI Agent Developers: Those building agents that need reliable, standardized search and crawling capabilities without managing multiple different APIs.
  • LLM Client Users: Users of clients like NextChat or Cherry Studio who want to add web search capabilities to their models via a proxy.
  • MCP Users: Users of Claude Desktop or Cursor who want to integrate search tools directly into their AI environment.

Highlights

  • Automatic Fallback Chain: Automatically switches providers on rate limits, timeouts, or errors to ensure uninterrupted search results.
  • Perplexity-Compatible API: Uses a schema identical to the Perplexity Search API, making it easy to switch providers without changing code.
  • Crawl and News Capabilities: Beyond basic search, it supports dedicated news endpoints and page content crawling.
  • Flexible Deployment: Supports Node.js, Cloudflare Workers, Bun, and Docker.
  • MCP Integration: Native support for the Model Context Protocol, allowing it to be used as a tool for AI agents.
  • Legacy Proxy Mode: Can act as a proxy to inject search tools into non-connected LLM clients.

Related

  • Project
  • Project
  • Project
  • Project
  • Project