mcpField
E
exa-search

exa-search

github.com/benedictking生産性5621 回インストール27 週間前に更新
リポジトリ

exa-search について

exa-search は、意図に応じて Exa のエンドポイントを選び、ウェブ検索、コンテンツ抽出、類似ページ検索、直接回答、構造化リサーチを行うスキルです。サブスキルを使い、依頼の組み立てと API 実行を分離します。

主な機能

  1. 01意図に合わせて Exa のエンドポイントを選択
  2. 02複数の方式でウェブ検索
  3. 03結果 ID からコンテンツを抽出
  4. 04指定 URL に似たページを検索
  5. 05回答またはスキーマに沿った調査結果を生成

活用シーン

  1. 01ウェブページを横断してテーマを調査
  2. 02検索結果の全文を取得
  3. 03既知の URL に関連するページを探す
  4. 04直接回答や構造化レポートを取得

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/benedictking/exa-search --skill exa-search

インストール後、Claude Code で/exa-searchを入力して読み込まれたか確認します。

同梱ファイル

SKILL.md と一緒にインストールされる参考資料やスクリプト。

.env.example
.gitignore
exa-api.cjs
exa-fetcher.md

詳細

Exa Search スキル

トリガー条件とエンドポイントの選択

ユーザーの意図に基づいて Exa エンドポイントを選択します。

  • search:セマンティック検索、ウェブページの検索、トピックの調査が必要な場合
  • contents:結果 ID が指定されており、コンテンツ全体の抽出が必要な場合
  • findsimilar:URL が指定されており、類似ページの検索が必要な場合
  • answer:質問への直接的な回答が必要な場合
  • research:指定された output_schema に従った構造化された調査結果が必要な場合

推奨アーキテクチャ(メインスキル+サブスキル)

このスキルでは、2 段階のアーキテクチャを使用します。

  1. メインスキル(現在のコンテキスト):ユーザーの質問を理解 → エンドポイントを選択 → JSON ペイロードを組み立て
  2. サブスキル(フォークされたコンテキスト):HTTP 呼び出しの実行のみを担当し、会話履歴によるトークンの無駄を回避

実行方法

Task ツールを使用して exa-fetcher サブスキルを呼び出し、コマンドと JSON を(stdin で)渡します。

Task parameters:
- subagent_type: Bash
- description: "Call Exa API"
- prompt: cat <<'JSON' | node .claude/skills/exa-search/exa-api.cjs <search|contents|findsimilar|answer|research>
  { ...payload... }
  JSON

ペイロードの例

1) 検索
cat <<'JSON' | node .claude/skills/exa-search/exa-api.cjs search
{
  "query": "Latest research in LLMs",
  "type": "auto",
  "numResults": 10,
  "category": "research paper",
  "includeDomains": [],
  "excludeDomains": [],
  "startPublishedDate": "2025-01-01",
  "endPublishedDate": "2025-12-31",
  "includeText": [],
  "excludeText": [],
  "context": true,
  "contents": {
    "text": true,
    "highlights": true,
    "summary": true
  }
}
JSON

検索タイプ:

  • neural:埋め込みを使用したセマンティック検索
  • fast:キーワードベースの高速検索
  • auto:最適な方法を自動で選択(デフォルト)
  • deep:網羅的な詳細検索

カテゴリ:

  • company、people、research paper、news、pdf、github、tweet など
2) コンテンツ
cat <<'JSON' | node .claude/skills/exa-search/exa-api.cjs contents
{
  "ids": ["result-id-1", "result-id-2"],
  "text": true,
  "highlights": true,
  "summary": true
}
JSON
3) 類似検索
cat <<'JSON' | node .claude/skills/exa-search/exa-api.cjs findsimilar
{
  "url": "https://example.com/article",
  "numResults": 10,
  "category": "news",
  "includeDomains": [],
  "excludeDomains": [],
  "startPublishedDate": "2025-01-01",
  "contents": {
    "text": true,
    "summary": true
  }
}
JSON
4) 回答
cat <<'JSON' | node .claude/skills/exa-search/exa-api.cjs answer
{
  "query": "What is the capital of France?",
  "numResults": 5,
  "includeDomains": [],
  "excludeDomains": []
}
JSON
5) 調査
cat <<'JSON' | node .claude/skills/exa-search/exa-api.cjs research
{
  "input": "What are the latest developments in AI?",
  "model": "auto",
  "stream": false,
  "output_schema": {
    "properties": {
      "topic": {
        "type": "string",
        "description": "The main topic"
      },
      "key_findings": {
        "type": "array",
        "description": "List of key findings",
        "items": {
          "type": "string"
        }
      }
    },
    "required": ["topic"]
  },
  "citation_format": "numbered"
}
JSON

環境変数と API キー

API キーの設定方法は 2 つあります(優先順位:環境変数 > .env)。

  1. 環境変数:EXA_API_KEY
  2. .env ファイル:.claude/skills/exa-search/.env に配置します。.env.example からコピーできます。

レスポンス形式

すべてのエンドポイントは、次の内容を含む JSON を返します。

  • requestId:一意のリクエスト識別子
  • results:検索結果の配列
  • searchType:実行された検索のタイプ(search エンドポイントの場合)
  • context:LLM が利用しやすいコンテキスト文字列(要求された場合)
  • costDollars:詳細なコスト内訳

コメント