
一个模型上下文协议(MCP)服务器,将 Ant Design 组件文档暴露给大型语言模型(LLM),如 Claude。
概览
一个模型上下文协议(MCP)服务器,将Ant Design组件文档暴露给大型语言模型(LLM),如Claude。该服务器允许LLM通过一套专用工具探索和理解Ant Design组件。 - 易用 - 无需克隆整个 Ant Design 仓库 - 预解压组件文档以加快启动速度 - 列出所有可用的 Ant Design 组件 - 获取详细组件文档,包括描述和使用情况 - 查看组件 props 和 API 定义 - 浏览特定组件的代码示例 - 通过名称或功能搜索组件 在首次使用 MCP 服务器之前,您需要从 Ant Design 仓库中提取文档: 这将创建一个包含所有提取组件文档的数据目录,MCP服务器将使用该目录。
概述(AI 翻译)
一个模型上下文协议(MCP)服务器,将Ant Design组件文档暴露给大型语言模型(LLM),如Claude。该服务器允许LLM通过一套专用工具探索和理解Ant Design组件。
特色
- 易于使用 - 无需克隆整个 Ant Design 仓库
- 预解压组件文档,加快启动速度
- 列出所有可用的Ant Design组件
- 获取详细的组件文档,包括描述和使用情况
- 查看组件道具和API定义
- 浏览特定组件的代码示例
- 按名称或功能搜索组件
初始布置
在首次使用 MCP 服务器之前,您需要从 Ant Design 仓库中提取文档:
这将创建一个包含所有解压组件文档的 data 目录,MCP 服务器将使用该目录。
测试服务器
为了验证一切正常,你可以运行测试脚本:
这将运行MCP服务器,并通过示例查询测试所有可用工具。
用途
命令行
运行MCP服务器:
Claude桌面集成
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
Ant Design Components Model Context Protocol Server
A Model Context Protocol (MCP) server that exposes Ant Design component documentation to Large Language Models (LLMs) like Claude. This server allows an LLM to explore and understand Ant Design components through a set of specialized tools.
Features
- Easy to use - no need to clone the entire Ant Design repository
- Pre-extracted component documentation for faster startup
- List all available Ant Design components
- Get detailed component documentation including descriptions and usage
- View component props and API definitions
- Browse code examples for specific components
- Search for components by name or functionality
Initial Setup
Before using the MCP server for the first time, you need to extract the documentation from the Ant Design repository:
# First, clone the Ant Design repository (can be temporary)
git clone https://github.com/ant-design/ant-design.git
# Extract documentation
cd mcp-antd-components
npm run extract # Uses the default ./ant-design path
# OR
node scripts/extract-docs.mjs /path/to/ant-design # For a custom path
# After extraction is complete, the Ant Design repo can be deleted if desired
This will create a data directory with all the extracted component documentation, which the MCP server will use.
Testing the Server
To verify that everything is working correctly, you can run the test script:
npm test
# OR
node scripts/test-server.mjs
This will run the MCP server and test all available tools with sample queries.
Usage
Command Line
Run the MCP server:
# Run server with pre-extracted data
npm start
# OR
npx -y mcp-antd-components
Claude Desktop Integration
To use this MCP server with Claude Desktop, edit your claude_desktop_config.json configuration file:
{
"mcpServers": {
"Ant Design Components": {
"command": "npx",
"args": ["-y", "mcp-antd-components"]
}
}
}
Location of the configuration file:
- macOS/Linux:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
$env:AppData\Claude\claude_desktop_config.json
Claude Code Integration
To use this MCP server with Claude Code CLI, follow these steps:
-
Add the Ant Design Components MCP server to Claude Code
# Basic syntax claude mcp add antd-components npx -y mcp-antd-components -
Verify the MCP server is registered
# List all configured servers claude mcp list # Get details for your Ant Design components server claude mcp get antd-components -
Remove the server if needed
claude mcp remove antd-components -
Use the tool in Claude Code
Once configured, you can invoke the tool in your Claude Code session by asking questions about Ant Design components.
Tips:
安装
npx -y mcp-antd-components配置
{
"mcpServers": {
"Ant Design Components": {
"command": "npx",
"args": ["-y", "mcp-antd-components"]
}
}
}