Favicon of search2ai

search2ai

A self-hosted search gateway gives AI agents web search, news and page extraction through MCP or an API, with automatic fallback between providers.

Screenshot of search2ai website

search2ai is a self-hosted search gateway for developers adding web access to AI agents and chat clients. It connects your chosen search services through one interface, with backup providers when requests fail.

  • Search and page content: Give agents web results, news and extracted page text through providers such as Tavily, Exa, Brave, Search1API, SearXNG and Firecrawl.
  • Routing and fallback: Choose separate provider orders for search, news and extraction; the gateway retries after rate limits, timeouts or failures and reports which service answered.
  • Agent and app connections: Use MCP with clients such as Claude Desktop and Cursor, an HTTP API for applications, or a JavaScript / TypeScript library embedded in your app.
  • Existing API clients: Reuse supported Exa, Tavily, Search1API, SearXNG and Firecrawl calls through compatibility endpoints; provider-specific features still need the matching provider, and Firecrawl compatibility covers single-page extraction.
  • Chat with web access: Add search tools to NextChat, Cherry Studio or Chatbox through an OpenAI-compatible chat proxy that calls your configured tool-calling model.

The project is open source under MIT and free to self-host with Node.js or Docker, or deploy on Cloudflare Workers. Optional caching uses memory or Cloudflare KV on Workers. The gateway runs where you host it, but web access needs an internet connection and sends requests to configured providers, using your credentials or service URLs. You can connect self-hosted SearXNG and Firecrawl instances. Search1API is a separate hosted alternative; the chat proxy also sends requests to your chosen model service.

Similar to search2ai