Ant Design MCP Server logo

Ant Design MCP Server

Community
wxzhishang

一个关于ant design的MCP server

Publisherwxzhishang
Repositoryantd-mcp
LanguageTypeScript
Forks
1
Stars
3
Available tools
7
Transport typestdio
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    Ant Design MCP Server exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 7 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    3 stars and 1 forks from the linked repository.

Ant Design MCP Server

一个基于 Model Context Protocol (MCP) 的 Ant Design 组件服务器,为 AI 助手提供丰富的 Ant Design 组件文档、示例和最佳实践。

🚀 功能特性

  • 组件文档查询:获取 Ant Design 所有组件的详细文档
  • 示例代码获取:提供每个组件的完整示例代码
  • API 文档查询:查询组件的 API 属性和方法
  • 最佳实践指导:获取组件使用的最佳实践建议
  • 更新日志查询:查看组件的版本更新历史
  • 多版本支持:支持切换不同版本的 Ant Design

📦 安装

从源码构建

bash
# 克隆仓库
git clone <repository-url>
cd antd-MCP

# 安装依赖
npm install

# 构建项目
npm run build

🛠️ 使用方法

启动 MCP 服务器

构建完项目后可以选择在本地的客户端配置MCP。

具体配置方法可以参考客户端说明。

以cursor为例,可以在Cursor Settings中的Tools中配置:

json
// 从本地导入(推荐,后面也许就不推荐了)
{
  "mcpServers": {
    "antd-components-local": {
      "command": "node",
      "args": [
        "<repository-url>/antd-MCP/dist/cli.js"
      ]
    }
  }
}

// 从npm导入
{
  "mcpServers": {
    "antd-components-local": {
      "command": "npx",
      "args": [
        "antd-mcp"
      ]
    }
  }
}

提取 Ant Design 数据

如果需要从本地的 Ant Design 仓库提取最新数据:

bash
# 先克隆antd仓库到本地
git clone https://github.com/ant-design/ant-design

# 执行脚本
npm run extract

# 可能会出现更新日志无法正常获取的现象(如果docs文件夹下没有components-changelog.json文件),可以执行以下脚本后重新执行extract脚本
npm run generate-component-changelog

爬取最佳实践

此功能还待完善,写得脚本太烂了,目前爬取的数据较混乱,如果有大佬有好的思路欢迎PR

bash
# 爬取全部组件的最佳实践(需要提前提取Ant Design数据)
npm run crawl-practices

# 爬取指定组件的最佳实践
npm run crawl-practices Button ...

在 MCP 客户端中使用

将此服务器添加到您的 MCP 客户端配置中,然后可以使用以下功能:

  • 📋 list-components - 列出所有可用的 Ant Design 组件
  • 📖 get-component-docs - 获取指定组件的文档
  • 💡 get-component-examples - 获取组件示例代码
  • 🔍 get-component-api - 查询组件的 API 文档
  • get-best-practices - 获取组件使用的最佳实践
  • 📝 get-component-changelog - 查看组件更新历史
  • 🔄 change-component-version - 切换 Ant Design 版本

📁 项目结构

antd-MCP/
├── src/                    # 源代码
│   ├── tools/             # MCP 工具实现
│   ├── scripts/           # 脚本工具
│   ├── utils/             # 工具函数
│   └── index.ts           # 主入口文件
├── docs/                  # Ant Design 组件文档
│   └── components/        # 各组件文档和示例
├── cli.ts                 # 命令行入口
└── package.json           # 项目配置

🔧 开发

开发环境启动

可以利用MCP提供的线上调试器调试

构建项目

bash
npm run build

调试和检查

bash
npm run inspector

生成组件更新日志

bash
npm run generate-component-changelog

📋 系统要求

  • Node.js >= 16.0.0
  • npm 或 yarn

🤝 贡献

欢迎提交 Issue 和 Pull Request!

开发流程

  1. Fork 本仓库
  2. 创建特性分支 (git checkout -b feat/amazing-feature)
  3. 提交更改 (git commit -m 'Add some amazing feature')
  4. 推送到分支 (git push origin feat/amazing-feature)
  5. 开启 Pull Request

分支命名规范

  • feat/ - 新功能
  • fix/ - 问题修复
  • docs/ - 文档更新
  • refactor/ - 代码重构
  • test/ - 测试相关

Installation

TypingMind
Prerequisites:

Node.js 18+

{
  "mcpServers": {
    "antd-components-local": {
      "command": "npx",
      "args": [
        "antd-mcp"
      ]
    }
  }
}

Available Tools

  • change-component-version

    切换当前Ant Design版本 适用场景:

    1. 用户主动切换版本
    2. 其他工具需要切换版本时
  • get-best-practices

    获取某个组件的最佳实践 适用场景:

    1. 用户主动获取某个组件的最佳实践
    2. 其他工具需要获取某个组件的最佳实践时
  • get-component-changelog

    列出 Ant Design 特定组件的更新日志 适用场景:

    1. 用户询问特定组件的更新日志
    2. 在知道用户 antd 版本的情况下,当用户需要实现相关组件功能时判断是否在后续版本中才实现,来决定是否需要升级依赖
  • list-components

    当用户请求一个新的用户界面(UI)使用 Ant Design 组件时使用此工具。 此工具仅返回可用的组件列表。 适用场景:

    1. 用户希望看到可用的组件列表
    2. 用户想要根据描述的场景知道可以用哪些组件
    3. 其他工具调用需要用到可用组件列表时
  • get-component-docs

    获取 Ant Design 特定组件的详细文档,支持数组形式传入 适用场景: 用户询问如何使用特定组件

  • get-component-examples

    获取 Ant Design 特定组件的代码示例,支持数组形式传入 适用场景:

    1. 用户询问特定组件的示例时
    2. 用户想要实现某个功能时直接告知可使用的例子
    3. 生成页面前需要获取组件的示例代码
  • get-component-api

    获取 Ant Design 特定组件的API,api名称支持数组形式传入 适用场景:

    1. 用户询问如何使用特定组件的API
    2. 用户希望查询到对应API的ts类型以及联合类型值
    3. 其他工具需要查看对应API,需要获取API的ts类型以及联合类型值时

Use Ant Design MCP Server MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once Ant Design MCP Server is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add Ant Design MCP Server as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the Ant Design MCP Server MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "ant-design-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "antd-mcp"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the Ant Design MCP Server MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the Ant Design MCP Server MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use Ant Design MCP Server to help me with this task?
Ant Design MCP Server
Sure. I read it.
Here is what I found using Ant Design MCP Server.

Frequently asked questions

What is the Ant Design MCP Server MCP server used for?

Ant Design MCP Server is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use Ant Design MCP Server MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use Ant Design MCP Server with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use Ant Design MCP Server MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With Ant Design MCP Server connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect Ant Design MCP Server MCP to TypingMind?

Ant Design MCP Server runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does Ant Design MCP Server MCP provide in TypingMind?

Ant Design MCP Server exposes 7 MCP tools that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use Ant Design MCP Server MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If Ant Design MCP Server requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇