
Ant Design Components Model Context Protocol Server

2025.03.18
5
JavaScriptAnt Design 组件文档LLM 工具开发效率
mcp-antd-components 是一个 Model Context Protocol (MCP) 服务器,旨在向大型语言模型(如 Claude)提供 Ant Design 组件文档。该服务器通过一组专用工具,使 LLM 能够探索和理解 Ant Design 组件。
View on GitHub
Overview
基本能力
产品定位
mcp-antd-components 是一个专门为 Ant Design 组件文档提供访问接口的 MCP 服务器,旨在帮助开发者和 LLM 更高效地获取和使用 Ant Design 组件信息。
核心功能
- 无需克隆整个 Ant Design 仓库即可使用
- 预提取组件文档以加快启动速度
- 列出所有可用的 Ant Design 组件
- 获取详细的组件文档,包括描述和用法
- 查看组件属性和 API 定义
- 浏览特定组件的代码示例
- 按名称或功能搜索组件
适用场景
- 开发者在开发过程中快速查阅 Ant Design 组件文档
- LLM 需要理解和使用 Ant Design 组件
- 需要快速获取组件属性和 API 定义的场景
- 需要查找组件代码示例的场景
工具列表
list-components
: 列出所有可用的 Ant Design 组件(PascalCase 格式)get-component-props
: 获取特定组件的属性和 API 文档get-component-docs
: 获取特定组件的详细文档list-component-examples
: 列出特定组件的所有可用示例get-component-example
: 获取特定组件的代码示例search-components
: 按名称模式搜索组件
常见问题解答
- 如何更新文档?运行提取脚本
node scripts/extract-docs.mjs /path/to/ant-design
- 如何测试服务器?运行
npm test
或node scripts/test-server.mjs
- 如何与 Claude Desktop 集成?编辑
claude_desktop_config.json
文件
使用教程
使用依赖
# 克隆 Ant Design 仓库(可以是临时的)
git clone https://github.com/ant-design/ant-design.git
安装教程
# 提取文档
cd mcp-antd-components
npm run extract # 使用默认的 ./ant-design 路径
# 或者
node scripts/extract-docs.mjs /path/to/ant-design # 自定义路径
调试方式
# 运行服务器
npm start
# 或者
npx -y mcp-antd-components
# 测试服务器
npm test
# 或者
node scripts/test-server.mjs
许可证
None