docs/installation/mcp.cn.mdx
Plate 有一个官方的 MCP 服务器。这使 AI 工具能够理解并使用我们丰富的编辑器模板、插件配置、UI 组件和文档生态系统。
Model Context Protocol(MCP)是一个开放协议,用于标准化应用程序如何向 LLM 提供上下文。这对 Plate 很有用,因为你现在可以让你的 AI 辅助 IDE 直接访问数百个 Plate 资源。
你的 AI 现在可以:
尝试询问你的 AI:
"Set up a Plate editor with basic formatting and table support"
"Help me understand how the Plate AI plugin works"
"Update my editor components to the latest version"
Plate 生态系统提供结构化信息,支持 MCP 的工具可以从统一注册表中读取,包括:
这个全面的注册表确保 AI 工具在代码生成和理解 Plate 功能方面具有完整的上下文。
对于使用 Plate 的团队来说,集成本地文档是最大化 MCP 效益的关键。我们建议按照我们的本地文档指南进行设置。这种方法为 AI 驱动的开发提供了几个优势:
llms.txt: 与简单地将文档转储到文本文件中(可能难以处理大量内容和上下文限制)不同,结构化的本地设置允许 AI 高效访问所需的特定信息。按照以下步骤使用 Plate 设置 MCP:
运行此命令以使用基础编辑器模板初始化你的项目:
npx shadcn@latest add @plate/editor-basic
在 components.json 文件中配置你的注册表:
{
"registries": {
"@platejs": "https://platejs.org/r/{name}.json"
}
}
选择适合你 IDE 的配置:
复制并粘贴到 .cursor/mcp.json:
{
"mcpServers": {
"plate": {
"description": "Plate editors, plugins and components",
"type": "stdio",
"command": "npx",
"args": [
"shadcn@latest",
"mcp"
]
}
}
}
复制并粘贴到工作区中的 .vscode/mcp.json:
{
"servers": {
"plate": {
"type": "stdio",
"command": "npx",
"args": [
"shadcn@latest",
"mcp"
]
}
}
}
复制并粘贴到 .mcp.json:
{
"mcpServers": {
"plate": {
"description": "Plate editors, plugins and components",
"type": "stdio",
"command": "npx",
"args": [
"shadcn@latest",
"mcp"
]
}
}
}
~/.codex/config.toml[mcp_servers.plate]
command = "npx"
args = ["shadcn@latest", "mcp"]