/ 目录 / 演练场 / cocoindex-claude
● 社区 cocoindex-io ⚡ 即开即用

cocoindex-claude

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

Teaches Claude Code how to build CocoIndex data-transformation pipelines — real-time incremental processing for vector DBs and knowledge graphs.

CocoIndex is a real-time data transformation framework for AI pipelines (source → transform → vector DB / knowledge graph). This skill loads its conventions into Claude Code so the model writes idiomatic CocoIndex flows, custom functions, and CLI/API commands instead of guessing at an unfamiliar library.

为什么要用

核心特性

实时演示

实际使用效果

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

Build your first CocoIndex pipeline from a local folder into a vector DB

👤 Developers evaluating CocoIndex for a RAG use case ⏱ ~30 min intermediate

何时使用: You've read the CocoIndex homepage and want Claude to scaffold a working flow instead of copy-pasting tutorials.

前置条件
  • Skill cloned to ~/.claude/skills/cocoindex-claude — git clone https://github.com/cocoindex-io/cocoindex-claude ~/.claude/skills/cocoindex-claude
  • cocoindex Python package installed — pip install cocoindex
步骤
  1. Describe the pipeline
    Use the cocoindex skill — scaffold a flow that watches ./docs, chunks markdown, embeds with OpenAI, writes to Qdrant.✓ 已复制
    → Claude generates a flow.py with @cocoindex.flow_def and the right source/transform/export calls
  2. Run and verify
    Now show me the exact CLI commands to build, run, and incrementally update this flow.✓ 已复制
    → cocoindex setup / update / eval commands in the correct order

结果: A working flow.py plus the commands to run it — no more guessing at the CocoIndex decorator surface.

注意事项
  • Claude invents APIs that don't exist in CocoIndex — Explicitly prompt 'use only APIs documented in the cocoindex skill' — hallucination drops when the skill is in scope
搭配使用: filesystem

Write a custom CocoIndex transform function

👤 Engineers extending an existing CocoIndex flow ⏱ ~25 min intermediate

何时使用: Built-in transforms don't cover your parsing / enrichment step.

步骤
  1. Describe the transform
    With the cocoindex skill — write a @cocoindex.op.function that takes a PDF path, extracts tables, returns structured rows.✓ 已复制
    → Idiomatic function signature with correct typed inputs/outputs
  2. Wire it into the flow
    Now plug this into my existing flow at the chunking stage.✓ 已复制
    → Diff against current flow.py with the new op in place

结果: A custom transform that obeys CocoIndex's incremental semantics.

注意事项
  • Function returns non-deterministic output, breaking incremental processing — Skill reminds Claude that transforms must be pure — if you hit this, re-read the incremental section

组合

与其他 MCP 搭配,撬动十倍杠杆

cocoindex-claude-skill + filesystem

Let Claude actually write the flow.py file to disk, not just print it in chat

Scaffold the CocoIndex flow and save it to ./pipelines/docs_to_qdrant.py.✓ 已复制
cocoindex-claude-skill + postgres

Pipe CocoIndex output into a Postgres vector store and query it from the same session

Build the flow targeting pgvector, then run a retrieval query against it.✓ 已复制

工具

此 MCP 暴露的能力

工具输入参数何时调用成本
scaffold_flow source type + sink type + transform steps Starting a new pipeline 0
write_custom_op function intent + input/output types Built-in transforms aren't enough 0
cli_guidance task (setup / update / eval / drop) You're unsure whether to rebuild or incrementally update 0

成本与限制

运行它的成本

API 配额
None
每次调用 Token 数
Modest — skill loads reference material only when relevant
费用
Free — skills are local files
提示
CocoIndex itself is free; costs come from your embedding model and vector DB, not this skill.

安全

权限、密钥、影响范围

凭据存储: No credentials — pure prompts
数据出站: None from the skill itself. Your pipeline calls whichever embedding / DB services you configure.

故障排查

常见错误与修复

Skill not invoked when you ask about CocoIndex

Say 'use the cocoindex skill' explicitly, or check it's installed at ~/.claude/skills/cocoindex-claude.

验证: ls ~/.claude/skills/cocoindex-claude/SKILL.md
SKILL.md frontmatter wrong

Open the file and verify name / description are populated. Re-clone if partial.

验证: head ~/.claude/skills/cocoindex-claude/SKILL.md
Wrong trigger keywords — Claude writes generic Python instead of CocoIndex

Mention CocoIndex explicitly, or say 'scaffold a cocoindex flow_def'.

替代方案

cocoindex-claude 对比其他方案

替代方案何时用它替代权衡
LlamaIndex skillsYou want LlamaIndex's retrieval abstractions instead of CocoIndex's transform-centric modelDifferent mental model — LlamaIndex is retrieval-first, CocoIndex is pipeline-first
Hand-written PythonYou need one-off processing and don't want incremental stateNo incremental rebuilds, no framework conventions

更多

资源

📖 阅读 GitHub 上的官方 README

🐙 查看未解决的 issue

🔍 浏览全部 400+ MCP 服务器和 Skills