/ ディレクトリ / プレイグラウンド / cocoindex-claude
● コミュニティ cocoindex-io ⚡ 即起動

cocoindex-claude

作者 cocoindex-io · cocoindex-io/cocoindex-claude

Claude Codeに CocoIndex データ変換パイプラインの構築方法を教えます — ベクトルDBやナレッジグラフ向けのリアルタイムインクリメンタル処理を実現します。

CocoIndexは、AIパイプライン(ソース → 変換 → ベクトルDB / ナレッジグラフ)向けのリアルタイムデータ変換フレームワークです。このスキルをClaude Codeに読み込ませることで、不慣れなライブラリを推測するのではなく、CocoIndexの慣用的なフロー定義、カスタム関数、CLI/APIコマンドを正しく生成できるようになります。

なぜ使うのか

主な機能

ライブデモ

実際の動作

cocoindex-claude-skill.replay ▶ 準備完了
0/0

インストール

クライアントを選択

~/Library/Application Support/Claude/claude_desktop_config.json  · Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "cocoindex-claude-skill": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/cocoindex-io/cocoindex-claude",
        "~/.claude/skills/cocoindex-claude"
      ],
      "_inferred": true
    }
  }
}

Claude Desktop → Settings → Developer → Edit Config を開く。保存後、アプリを再起動。

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "cocoindex-claude-skill": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/cocoindex-io/cocoindex-claude",
        "~/.claude/skills/cocoindex-claude"
      ],
      "_inferred": true
    }
  }
}

Cursor は Claude Desktop と同じ mcpServers スキーマを使用。プロジェクト設定はグローバルより優先。

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "cocoindex-claude-skill": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/cocoindex-io/cocoindex-claude",
        "~/.claude/skills/cocoindex-claude"
      ],
      "_inferred": true
    }
  }
}

Cline サイドバーの MCP Servers アイコンをクリックし、"Edit Configuration" を選択。

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "cocoindex-claude-skill": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/cocoindex-io/cocoindex-claude",
        "~/.claude/skills/cocoindex-claude"
      ],
      "_inferred": true
    }
  }
}

Claude Desktop と同じ形式。Windsurf を再起動して反映。

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "cocoindex-claude-skill",
      "command": "git",
      "args": [
        "clone",
        "https://github.com/cocoindex-io/cocoindex-claude",
        "~/.claude/skills/cocoindex-claude"
      ]
    }
  ]
}

Continue はマップではなくサーバーオブジェクトの配列を使用。

~/.config/zed/settings.json
{
  "context_servers": {
    "cocoindex-claude-skill": {
      "command": {
        "path": "git",
        "args": [
          "clone",
          "https://github.com/cocoindex-io/cocoindex-claude",
          "~/.claude/skills/cocoindex-claude"
        ]
      }
    }
  }
}

context_servers に追加。保存時に Zed がホットリロード。

claude mcp add cocoindex-claude-skill -- git clone https://github.com/cocoindex-io/cocoindex-claude ~/.claude/skills/cocoindex-claude

ワンライナー。claude mcp list で確認、claude mcp remove で削除。

ユースケース

実用的な使い方: cocoindex-claude

ローカルフォルダからベクトルDBへの初めてのCocoIndexパイプラインを構築する

👤 RAGユースケースでCocoIndexを評価中の開発者 ⏱ ~30 min intermediate

使うタイミング: CocoIndexのホームページを読み、チュートリアルのコピペではなく、Claudeに動作するフローの雛形を作ってほしいとき。

前提条件
  • スキルを ~/.claude/skills/cocoindex-claude にクローン済み — git clone https://github.com/cocoindex-io/cocoindex-claude ~/.claude/skills/cocoindex-claude
  • cocoindex Pythonパッケージがインストール済み — pip install cocoindex
フロー
  1. パイプラインを記述する
    Use the cocoindex skill — scaffold a flow that watches ./docs, chunks markdown, embeds with OpenAI, writes to Qdrant.✓ コピーしました
    → Claudeが @cocoindex.flow_def と正しい source/transform/export 呼び出しを含む flow.py を生成する
  2. 実行して検証する
    Now show me the exact CLI commands to build, run, and incrementally update this flow.✓ コピーしました
    cocoindex setup / update / eval コマンドが正しい順序で出力される

結果: 動作する flow.py と実行コマンドが得られ、CocoIndexのデコレータ仕様を推測する必要がなくなります。

注意点
  • ClaudeがCocoIndexに存在しないAPIを捏造する — 「cocoindexスキルに記載されたAPIのみを使用してください」と明示的にプロンプトすると、スキルがスコープ内にある場合はハルシネーションが減少します
組み合わせ: filesystem

カスタムCocoIndex変換関数を作成する

👤 既存のCocoIndexフローを拡張するエンジニア ⏱ ~25 min intermediate

使うタイミング: 組み込みの変換ではパース/エンリッチメントの処理をカバーできないとき。

フロー
  1. 変換を記述する
    With the cocoindex skill — write a @cocoindex.op.function that takes a PDF path, extracts tables, returns structured rows.✓ コピーしました
    → 正しい型付き入出力を持つ慣用的な関数シグネチャ
  2. フローに組み込む
    Now plug this into my existing flow at the chunking stage.✓ コピーしました
    → 新しいopを配置した現在の flow.py に対する差分

結果: CocoIndexのインクリメンタルセマンティクスに準拠したカスタム変換が完成します。

注意点
  • 関数が非決定的な出力を返し、インクリメンタル処理が壊れる — スキルがClaudeに変換は純粋関数でなければならないことを通知します。この問題が発生した場合はインクリメンタルのセクションを再確認してください

組み合わせ

他のMCPと組み合わせて10倍の力を

cocoindex-claude-skill + filesystem

Claudeが flow.py をチャットに表示するだけでなく、実際にディスクに書き出せるようにする

Scaffold the CocoIndex flow and save it to ./pipelines/docs_to_qdrant.py.✓ コピーしました
cocoindex-claude-skill + postgres

CocoIndexの出力をPostgresベクトルストアに送り、同じセッション内でクエリを実行する

Build the flow targeting pgvector, then run a retrieval query against it.✓ コピーしました

ツール

このMCPが提供する機能

ツール入力呼び出すタイミングコスト
scaffold_flow source type + sink type + transform steps 新しいパイプラインを開始するとき 0
write_custom_op function intent + input/output types 組み込みの変換では不十分なとき 0
cli_guidance task (setup / update / eval / drop) リビルドすべきかインクリメンタル更新すべきか判断に迷うとき 0

コストと制限

運用コスト

APIクォータ
なし
呼び出しあたりのトークン
少量 — スキルは関連する場合のみリファレンス資料を読み込みます
金額
無料 — スキルはローカルファイルです
ヒント
CocoIndex自体は無料です。コストはエンベディングモデルとベクトルDBから発生し、このスキルからは発生しません。

セキュリティ

権限、シークレット、影響範囲

認証情報の保管: 認証情報不要 — 純粋なプロンプトのみ
データ送信先: スキル自体からのデータ送信はありません。パイプラインは設定したエンベディング/DBサービスを呼び出します。

トラブルシューティング

よくあるエラーと対処法

CocoIndexについて質問してもスキルが呼び出されない

「use the cocoindex skill」と明示的に指示するか、~/.claude/skills/cocoindex-claude にインストールされているか確認してください。

確認: ls ~/.claude/skills/cocoindex-claude/SKILL.md
SKILL.md frontmatter wrong

ファイルを開き、name / description が設定されていることを確認してください。不完全な場合は再クローンしてください。

確認: head ~/.claude/skills/cocoindex-claude/SKILL.md
Wrong trigger keywords — ClaudeがCocoIndexではなく汎用Pythonを生成する

CocoIndexを明示的に言及するか、「scaffold a cocoindex flow_def」と指示してください。

代替案

cocoindex-claude 他との比較

代替案代わりに使う場面トレードオフ
LlamaIndex skillsCocoIndexの変換中心モデルではなく、LlamaIndexの検索抽象化を使いたいとき異なるメンタルモデル — LlamaIndexは検索ファースト、CocoIndexはパイプラインファースト
Hand-written Pythonワンショットの処理でインクリメンタルな状態管理が不要なときインクリメンタルリビルドなし、フレームワーク規約なし

その他

リソース

📖 GitHub の公式 README を読む

🐙 オープンな issue を見る

🔍 400以上のMCPサーバーとSkillsを見る