Skip to main content
Glama

antd-components-mcp

list-component-examples.ts938 B
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { z } from "zod"; import { listComponentExamples } from "../utils/components"; /** 获取 Ant Design 特定组件示例 */ const registryTool = (server: McpServer) => { server.tool( "list-component-examples", `获取 Ant Design 特定组件的代码示例 适用场景: 1. 用户询问特定组件的示例时 2. 用户想要实现某个功能时直接告知可使用的例子 3. 生成页面前需要获取组件的示例代码`, { componentName: z.string() }, async ({ componentName }) => { const componentExamples = await listComponentExamples(componentName); return { content: [ { type: "text", text: `${componentName} 组件的代码示例文档: ${componentExamples || '暂无代码示例'}`, }, ], }; }, ); } export default registryTool;

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/zhixiaoqiang/antd-components-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server