FS

fatwang2/search2ai

Developer tools

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

1282 stars 192 forks 品質 87 トレンド 73MIT

AIエージェントのセルフホスト検索ゲートウェイ。 プロバイダーのフォールバックで統一された検索、ニュース、ページ抽出。 REST API、MCP サーバー、TypeScript ライブラリ.

概要

設定する検索およびページ抽出サービスを接続します。 プロバイダーが制限される場合、タイムアウト、または失敗すると、ゲートウェイは、サービスが回答した順番と、他の人が失敗した理由で、次の1つを構成した注文とレポートで試します。 エンドポイントを検索して、エージェントやアプリケーションで使用するための構造された結果とページコンテンツを返します。 また、回答中にツールがWeb検索を呼び出すようにサポートするモデルもオプションです。 - : タイトル、URL、スニペット、日付やコンテンツなどのオプションフィールド。 - : 設定されたプロバイダーに応じて、検索、ニュース、およびクロール。 - : 必要に応じてサービスURLまたは認証情報を提供。 構成されていないプロバイダは自動的に有効化されません。 - : 操作、メモリ内キャッシュ、およびCloudflare KVキャッシュごとのチェーンを分離します。 - : ローカルMCP、スタンドアローンHTTPサービス、直接ライブラリ呼び出し、およびマウント可能なHonoルート。 - : サポートされているExa、Tavily、Search1API、SearXNG、Firecrawl シングルページコールは、専用の HTTP API/SDK 互換エンドポイントを使用できます.

概要(AI 翻訳)

英語・ホテル

検索2ai

AIエージェントとAIクライアントのセルフホスト検索ゲートウェイ

MCP、HTTP API、JavaScript/TypeScript ライブラリ* で設定する検索およびページ抽出サービスを接続します。 プロバイダーが制限される場合、タイムアウト、または失敗すると、ゲートウェイは、サービスが回答した順番と、他の人が失敗した理由で、次の1つを構成した注文とレポートで試します。

エンドポイントを検索して、エージェントやアプリケーションで使用するための構造された結果とページコンテンツを返します。 オプションのチャットプロキシは、応答中にWebを検索するツールをサポートするモデルを可能にします。

  • 一貫した結果: [title], url], [snippet], [date], [content]などのオプションフィールド。
  • 検索、ニュース、およびページコンテンツ: [search]、 [news]、および [crawl)、設定されたプロバイダーによって異なります。
  • プロバイダの選択: 必要に応じてサービスURLまたは資格情報を提供; 構成されていないプロバイダは自動的に有効になっています。
  • フォールバックとキャッシング:操作、メモリ内キャッシング、およびCloudflare KVキャッシングごとの独立したチェーン。 -柔軟な統合:ローカルMCP、スタンドアローンHTTPサービス、直接ライブラリ呼び出し、およびマウント可能なHonoルート.

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。

README

以下は原文 README の抜粋です。原文を見る。

English · 简体中文

search2ai

A self-hosted search gateway for AI agents and AI clients.

Connect the search and page extraction services you configure through MCP, an HTTP API, or a JavaScript / TypeScript library. When a provider is rate limited, times out, or fails, the gateway tries the next one in your configured order and reports which service answered and why others failed.

Search endpoints return structured results and page content for your agent or application to use. An optional chat proxy also lets models that support tool calling search the web while answering.

  • Consistent results: title, url, snippet, and optional fields such as date and content.
  • Search, news, and page content: search, news, and crawl, depending on the configured providers.
  • Your choice of providers: supply service URLs or credentials as needed; unconfigured providers are never enabled automatically.
  • Fallback and caching: separate chains per operation, in-memory caching, and Cloudflare KV caching.
  • Flexible integration: local MCP, a standalone HTTP service, direct library calls, and mountable Hono routes.
  • Existing API clients: supported Exa, Tavily, Search1API, SearXNG and Firecrawl single-page calls can use dedicated HTTP API / SDK compatibility endpoints.

Looking for hosted search? Search1API is this project’s companion hosted service for search, news, and page extraction. Use its API directly or configure it as a search2ai provider. It also offers hosted compatible APIs to help existing integrations switch with minimal changes. The examples below use Search1API; you can choose any other supported provider.

Website · Quick start · Choose an integration · Providers and configuration · HTTP API · API / SDK compatibility · Deployment · Chat proxy · Upgrading · Development and contributing

Quick start

The local CLI and npm package require Node.js ≥ 22.18. Configure at least one provider that supports the operation you need. In the current version, search requests return 503 when no search provider is configured.

Create .env in your working directory with your search provider key:

SEARCH1API_KEY=your_provider_key

Start a local HTTP service:

npx -y search2ai serve --host 127.0.0.1

Search from another terminal:

curl http://localhost:3014/v1/search \
  -H 'Content-Type: application/json' \
  -d '{"query":"hono cloudflare workers","max_results":3}'
GitHub で README 全文を見る

インストール

npx -y search2ai mcp
MCP 初心者?mcpskill.org のガイドから始めましょう →

設定

{ "mcpServers": { "search2ai": { "command": "npx", "args": ["-y", "search2ai", "mcp"], "env": { "SEARCH1API_KEY": "your_provider_key" } } } }