AntV文档协议服务器

为AI开发和QA设计的模型上下文协议服务器,提供AntV文档上下文和代码示例。

  • by antvis
  • TypeScript
  • 混合部署
  • 40 星标
  • 更新于
在 GitHub 查看 antvis/mcp-server-antv

使用说明

MCP服务器AntV

A. 模型上下文协议(MCP) 为AI开发和QA设计的服务器,提供 AntV 使用最新API的文档上下文和代码示例。

支持 G2型, G6,以及 地上二层 用于声明性可视化工作流的库,具有 第2页, X6, 第七层,以及更多(包括 艾娃, 模数转换器,以及 G)即将到来。

✨ 特性

  • ✅ AntV 5.x兼容性:利用最新的API实现性能和模块化。
  • 🧩 多库支持:G2(2D图表)、G6(图形/网络)和F2(移动图表)。
  • 🔍 智能意图提取:通过以下方式检测库使用情况和任务复杂性 extract_antv_topic.
  • 📚 上下文文档:使用以下命令获取相关的AntV文档和代码片段 query_antv_document.

🛠️ 快速开始

需求

  • Node.js>=v18.0.0
  • 光标、VSCode、Cline、Claude Desktop或其他MCP客户端。

连接到光标

首选 Settings -> Cursor Settings -> MCP -> Add new global MCP server

{
  "mcpServers": {
    "mcp-server-antv": {
      "command": "npx",
      "args": ["-y", "@antv/mcp-server-antv"]
    }
  }
}

On Window系统:

{
  "mcpServers": {
    "mcp-server-antv": {
      "command": "cmd",
      "args": ["/c", "npx", "-y", "@antv/mcp-server-antv"]
    }
  }
}

连接到VSCode

将以下配置粘贴到VSCode中 ~/.vscode/mcp.json 文件是推荐的方法。

{
  "servers": {
    "mcp-server-antv": {
      "command": "npx",
      "args": ["-y", "@antv/mcp-server-antv"]
    }
  }
}

或命令行配置

code --add-mcp "{\"name\":\"mcp-server-antv\",\"command\": \"npx\",\"args\": [\"-y\",\"@antv/mcp-server-antv\"]}"

🧪 工作流示例

示例工作流:

🧰 工具概述

工具 功能
extract_antv_topic 提取用户意图,检测库(G2/G6/F2),并推断任务复杂性。
query_antv_document 使用context7获取最新文档和代码示例

🔨 贡献

克隆仓库

git clone https://github.com/antvis/mcp-server-chart.git
cd mcp-server-chart

安装依赖项:

npm install

构建服务器:

npm run build

启动MCP服务器:

npm run start

📄 许可证

麻省理工学院@AntV.