copilotkit

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

CopilotKit

CopilotKit

CopilotKit's APIs move. Anything written down in a skill file is a copy that starts drifting the day it is written, so this skill carries almost no API detail on purpose. It tells you where the current answer lives and how to get it.
Look it up before you write code. Not because the docs are more convenient, but because they are regenerated from the source and a recollection is not.
CopilotKit的API会持续迭代更新。技能文件中记录的任何内容都是副本,从编写之日起就会逐渐过时,因此本技能刻意几乎不包含API细节。它会告诉你最新答案的位置以及获取方式。
编写代码前请先查阅文档。 不是因为文档更方便,而是因为文档是基于源码重新生成的,而记忆中的内容并非如此。

The search tools

搜索工具

An MCP server,
copilotkit-docs
, is bundled with this plugin. It exposes four search tools and two exploration tools over four separate corpora. Picking the wrong one is the most common way to come up empty:
ToolCorpusUse it for
search-docs
docs.copilotkit.aiUsage, configuration, guides, quickstarts, the generated API reference
search-code
CopilotKit library sourceHow something is implemented, and exact signatures. Library packages only — not examples or showcases
search-ag-ui-docs
AG-UI protocol docsThe protocol itself: event types, transports, the SDKs
search-ag-ui-code
AG-UI protocol SDK sourceProtocol implementation detail
explore-docs
/
explore-code
either treeBrowsing structure when you do not yet know what to search for
CopilotKit questions go to the first two. AG-UI protocol questions go to the second two — they are a different repository, and
search-docs
will not find them.
These are semantic searches. Several short, differently-phrased queries beat one long one. If a query returns something off-target, rephrase rather than widen — and if you get a plausible-looking page that does not actually contain the term you need, say so instead of reasoning from the title.
本插件捆绑了一个MCP服务器
copilotkit-docs
。它基于四个独立的语料库提供了四个搜索工具和两个浏览工具。选错工具是搜索无果的最常见原因:
工具语料库用途
search-docs
docs.copilotkit.ai用法、配置、指南、快速入门、生成的API参考
search-code
CopilotKit 库源码实现逻辑以及精确的签名。仅适用于库包——不包含示例或演示项目
search-ag-ui-docs
AG-UI 协议文档协议本身:事件类型、传输方式、SDK
search-ag-ui-code
AG-UI 协议 SDK 源码协议实现细节
explore-docs
/
explore-code
任意目录树当你还不确定要搜索什么时,用于浏览结构
CopilotKit相关问题使用前两个工具。AG-UI协议相关问题使用后两个——它们属于不同的代码仓库,
search-docs
无法找到相关内容。
这些是语义搜索。 多个表述不同的短查询效果优于一个长查询。如果查询结果偏离目标,请重新表述而非扩大搜索范围——如果你得到一个看起来合理但实际上不包含所需术语的页面,请如实说明,不要仅凭标题进行推断。

Setup

安装配置

The server is registered once per tool, and installing the skills does not register it. Check first — if the search tools above are already available, skip this.
Claude Code — the CopilotKit plugin declares the server in its
.mcp.json
, so a plugin install needs nothing. A skills-only install (
npx skills add
) does not carry that file, so register it:
bash
claude mcp add --transport sse copilotkit-mcp https://mcp.copilotkit.ai/sse
Codex:
bash
codex mcp add copilotkit --url https://mcp.copilotkit.ai/mcp
Anything else —
https://mcp.copilotkit.ai/mcp
for streamable HTTP,
https://mcp.copilotkit.ai/sse
for SSE. Keep the path: the bare host returns 404. Per-tool instructions cover Cursor, Windsurf, Cline, GitHub Copilot and VS Code.
Without the server, the documentation works as a plain site, and appending
.md
to any docs URL returns that page as Markdown.
该服务器每个工具只需注册一次,安装技能并不会自动注册它。请先检查——如果上述搜索工具已可用,请跳过此步骤。
Claude Code —— CopilotKit插件在其
.mcp.json
中声明了该服务器,因此安装插件无需额外操作。仅安装技能的方式(
npx skills add
)不会携带该文件,因此需要手动注册:
bash
claude mcp add --transport sse copilotkit-mcp https://mcp.copilotkit.ai/sse
Codex:
bash
codex mcp add copilotkit --url https://mcp.copilotkit.ai/mcp
其他工具 —— 流式HTTP使用
https://mcp.copilotkit.ai/mcp
,SSE使用
https://mcp.copilotkit.ai/sse
。请保留路径:仅访问主机会返回404。各工具的具体说明涵盖了Cursor、Windsurf、Cline、GitHub Copilot和VS Code。
如果没有该服务器,文档站点可作为普通网站使用,在任意文档URL后添加
.md
即可返回该页面的Markdown格式内容。

Where the answers are

答案所在位置

Worth knowing so a search has somewhere to land:
了解这些内容有助于搜索时定位方向:

Before you debug anything

调试前须知

Run the CLI's wiring check first —
npx copilotkit@latest verify --json
. It settles up to eleven things in one command and is almost always faster than reading the project. See the
copilotkit-cli
skill.
请先运行CLI的配置检查命令——
npx copilotkit@latest verify --json
。该命令可一次性检查多达11项内容,几乎总是比通读项目更快。详见
copilotkit-cli
技能。

Two versions exist

存在两个版本

v2 is current. Import from the
/v2
subpath —
@copilotkit/react-core/v2
,
@copilotkit/runtime/v2
. The package root is the deprecated v1 surface and still resolves, so mixing the two raises nothing at import time and surfaces later as a runtime mismatch. Check which subpath a project imports before trusting anything else about it. v1 is deprecated but supported; the migration guide covers moving off it.
v2是当前版本。请从
/v2
子路径导入——例如
@copilotkit/react-core/v2
、
@copilotkit/runtime/v2
。包根路径是已弃用的v1接口,仍然可以解析,因此混用两个版本在导入时不会报错,之后会以运行时不匹配的形式暴露出来。在确认项目的其他信息之前,请先检查项目导入的是哪个子路径。v1已弃用但仍受支持;迁移指南介绍了如何从v1迁移。