图表展示MCP
一个用于生成图表的Model Context Protocol服务器。我们可以使用这个mcp服务器进行图表生成和数据分析。
MCP 服务配置
复制以下 JSON 到 OPClaw 或其他 MCP 客户端的配置文件中即可使用
{
"mcpServers": {
"AntV Map": {
"args": [
"-y",
"@antv/mcp-server-chart"
],
"command": "npx",
"env": {
"SERVICE_ID": "***********************************"
}
},
"mcp-server-chart": {
"args": [
"-y",
"@antv/mcp-server-chart"
],
"command": "npx",
"env": {
"DISABLED_TOOLS": "generate_fishbone_diagram,generate_mind_map"
}
}
}
}
该服务需要配置环境变量:DISABLED_TOOLS、SERVICE_ID、VIS_REQUEST_SERVER
可用工具 (25 个)
该服务在 MCP 协议中暴露的工具,AI 可按需调用
generate_area_chart 9 个参数 需填 1 项
Generate a area chart to show data trends under continuous independent variables and observe the overall data trend, such as, displacement = velocity (average or instantaneous) × time: s = v × t. If the x-axis is time (t) and the y-axis is velocity (v) at each moment, an area chart allows you to observe the trend of velocity over time and infer the distance traveled by the area's size.
必填参数:data
generate_bar_chart 10 个参数 需填 1 项
Generate a horizontal bar chart to show data for numerical comparisons among different categories, such as, comparing categorical data and for horizontal comparisons.
必填参数:data
generate_boxplot_chart 8 个参数 需填 1 项
Generate a boxplot chart to show data for statistical summaries among different categories, such as, comparing the distribution of data points across categories.
必填参数:data
generate_column_chart 10 个参数 需填 1 项
Generate a column chart, which are best for comparing categorical data, such as, when values are close, column charts are preferable because our eyes are better at judging height than other visual elements like area or angles.
必填参数:data
generate_district_map 4 个参数 需填 2 项
Generates regional distribution maps, which are usually used to show the administrative divisions and coverage of a dataset. It is not suitable for showing the distribution of specific locations, such as urban administrative divisions, GDP distribution maps of provinces and cities across the country, etc. This tool is limited to generating data maps within China.
必填参数:title、data
generate_dual_axes_chart 8 个参数 需填 2 项
Generate a dual axes chart which is a combination chart that integrates two different chart types, typically combining a bar chart with a line chart to display both the trend and comparison of data, such as, the trend of sales and profit over time.
必填参数:categories、series
generate_fishbone_diagram 5 个参数 需填 1 项
Generate a fishbone diagram chart to uses a fish skeleton, like structure to display the causes or effects of a core problem, with the problem as the fish head and the causes/effects as the fish bones. It suits problems that can be split into multiple related factors.
必填参数:data
generate_flow_diagram 5 个参数 需填 1 项
Generate a flow diagram chart to show the steps and decision points of a process or system, such as, scenarios requiring linear process presentation.
必填参数:data
generate_funnel_chart 6 个参数 需填 1 项
Generate a funnel chart to visualize the progressive reduction of data as it passes through stages, such as, the conversion rates of users from visiting a website to completing a purchase.
必填参数:data
generate_histogram_chart 9 个参数 需填 1 项
Generate a histogram chart to show the frequency of data points within a certain range. It can observe data distribution, such as, normal and skewed distributions, and identify data concentration areas and extreme points.
必填参数:data
generate_line_chart 9 个参数 需填 1 项
Generate a line chart to show trends over time, such as, the ratio of Apple computer sales to Apple's profits changed from 2000 to 2016.
必填参数:data
generate_liquid_chart 7 个参数 需填 1 项
Generate a liquid chart to visualize a single value as a percentage, such as, the current occupancy rate of a reservoir or the completion percentage of a project.
必填参数:percent
generate_mind_map 5 个参数 需填 1 项
Generate a mind map chart to organizes and presents information in a hierarchical structure with branches radiating from a central topic, such as, a diagram showing the relationship between a main topic and its subtopics.
必填参数:data
generate_network_graph 5 个参数 需填 1 项
Generate a network graph chart to show relationships (edges) between entities (nodes), such as, relationships between people in social networks.
必填参数:data
generate_organization_chart 6 个参数 需填 1 项
Generate an organization chart to visualize the hierarchical structure of an organization, such as, a diagram showing the relationship between a CEO and their direct reports.
必填参数:data
generate_path_map 4 个参数 需填 2 项
Generate a route map to display the user's planned route, such as travel guide routes.
必填参数:title、data
generate_pie_chart 7 个参数 需填 1 项
Generate a pie chart to show the proportion of parts, such as, market share and budget allocation.
必填参数:data
generate_pin_map 5 个参数 需填 2 项
Generate a point map to display the location and distribution of point data on the map, such as the location distribution of attractions, hospitals, supermarkets, etc.
必填参数:title、data
generate_radar_chart 6 个参数 需填 1 项
Generate a radar chart to display multidimensional data (four dimensions or more), such as, evaluate Huawei and Apple phones in terms of five dimensions: ease of use, functionality, camera, benchmark scores, and battery life.
必填参数:data
generate_sankey_chart 7 个参数 需填 1 项
Generate a sankey chart to visualize the flow of data between different stages or categories, such as, the user journey from landing on a page to completing a purchase.
必填参数:data
generate_scatter_chart 8 个参数 需填 1 项
Generate a scatter chart to show the relationship between two variables, helps discover their relationship or trends, such as, the strength of correlation, data distribution patterns.
必填参数:data
generate_treemap_chart 6 个参数 需填 1 项
Generate a treemap chart to display hierarchical data and can intuitively show comparisons between items at the same level, such as, show disk space usage with treemap.
必填参数:data
generate_venn_chart 6 个参数 需填 1 项
Generate a Venn diagram to visualize the relationships between different sets, showing how they intersect and overlap, such as the commonalities and differences between various groups.
必填参数:data
generate_violin_chart 8 个参数 需填 1 项
Generate a violin chart to show data for statistical summaries among different categories, such as, comparing the distribution of data points across categories.
必填参数:data
generate_word_cloud_chart 6 个参数 需填 1 项
Generate a word cloud chart to show word frequency or weight through text size variation, such as, analyzing common words in social media, reviews, or feedback.
必填参数:data
服务介绍
MCP 服务器图表

一个用于生成图表的 Model Context Protocol 服务器,使用 AntV。我们可以使用这个 mcp 服务器进行 图表生成 和 数据分析。
这是一个基于 TypeScript 的 MCP 服务器,提供了图表生成功能。它允许您通过 MCP 工具创建各种类型的图表。您也可以在 Dify 中使用它。
📋 目录
- ✨ 功能
- 🤖 使用方法
- 🚰 使用 SSE 或 Streamable 传输运行
- 🎮 CLI 选项
- ⚙️ 环境变量
- VIS_REQUEST_SERVER
- [SERVICE_ID](#%EF%B8%8F 生成记录)
- [DISABLED_TOOLS](#%EF%B8%8F 工具过滤)
- 📠 私有部署
- [🗺️ 生成记录](#%EF%B8%8F 生成记录)
- [🎛️ 工具过滤](#%EF%B8%8F 工具过滤)
- 🔨 开发
- 📄 许可证
✨ 功能
目前支持 25+ 种图表。
generate_area_chart: 生成面积图表,用于显示连续自变量下的数据趋势,可以观察整体数据趋势。generate_bar_chart: 生成条形图表,用于比较不同类别的值,适合水平比较。generate_boxplot_chart: 生成箱线图,用于显示数据分布,包括中位数、四分位数和异常值。generate_column_chart: 生成柱状图表,用于比较不同类别的值,适合垂直比较。generate_district_map- 生成区域地图,用于显示行政区划和数据分布。generate_dual_axes_chart: 生成双轴图表,用于显示两个具有不同单位或范围的变量之间的关系。generate_fishbone_diagram: 生成鱼骨图,也称为石川图,用于识别和显示问题的根本原因。generate_flow_diagram: 生成流程图,用于显示过程的步骤和顺序。generate_funnel_chart: 生成漏斗图表,用于显示不同阶段的数据损失。generate_histogram_chart: 生成直方图,用于通过将数据分成区间并计算每个区间中的数据点数量来显示数据分布。generate_line_chart: 生成折线图表,用于显示随时间或其他连续变量变化的数据趋势。generate_liquid_chart: 生成液体图表,用于显示数据的比例,以水填充球体的形式直观表示百分比。generate_mind_map: 生成思维导图,用于显示思维过程和层次信息。generate_network_graph: 生成网络图,用于显示节点之间的关系和连接。generate_organization_chart: 生成组织图表,用于显示组织结构和人员关系。generate_path_map- 生成路径地图,用于显示 POI 的路线规划结果。1.generate_pie_chart: 生成饼图,用于显示数据的比例,将其划分为由扇形表示的部分,展示每个部分的百分比。generate_pin_map- 生成点位地图,用于显示POI(兴趣点)的分布。generate_radar_chart: 生成雷达图,用于全面展示多维数据,在类似雷达的格式中显示多个维度。generate_sankey_chart: 生成桑基图,用于展示数据流和量,以桑基图样式表示不同节点间的数据流动。generate_scatter_chart: 生成散点图,用于显示两个变量之间的关系,将数据点作为散点在坐标系上展示。generate_treemap_chart: 生成树状图,用于显示层次结构数据,以矩形形式展示数据,矩形的大小代表数据值。generate_venn_chart: 生成文氏图,用于显示集合之间的关系,包括交集、并集和差集。generate_violin_chart: 生成小提琴图,用于显示数据分布,结合箱线图和密度图的特点,提供更详细的数据分布视图。generate_word_cloud_chart: 生成词云图,用于显示文本数据中词语的频率,字体大小表示每个词语的频率。
[!NOTE]
上述地理可视化图表生成工具使用AMap服务,目前仅支持在中国范围内的地图生成。
🤖 使用方法
要与桌面应用程序一起使用,例如Claude、VSCode、Cline、Cherry Studio、Cursor等,请添加以下MCP服务器配置。在Mac系统上:
{
"mcpServers": {
"mcp-server-chart": {
"command": "npx",
"args": [
"-y",
"@antv/mcp-server-chart"
]
}
}
}
在Windows系统上:
{
"mcpServers": {
"mcp-server-chart": {
"command": "cmd",
"args": [
"/c",
"npx",
"-y",
"@antv/mcp-server-chart"
]
}
}
}
此外,您还可以通过HTTP、SSE协议在aliyun、modelscope、glama.ai、smithery.ai或其他平台上使用它。
🚰 使用SSE或可流式传输运行
直接运行
全局安装包。
npm install -g @antv/mcp-server-chart
使用您偏好的传输选项运行服务器:
# For SSE transport (default endpoint: /sse)
mcp-server-chart --transport sse
# For Streamable transport with custom endpoint
mcp-server-chart --transport streamable
然后您可以访问服务器:
- SSE传输:
http://localhost:1122/sse - 可流式传输:
http://localhost:1122/mcp
Docker部署
进入Docker目录。
cd docker
使用docker-compose进行部署。
docker compose up -d
然后您可以访问服务器:
- SSE传输:
http://localhost:1123/sse - 可流式传输:
http://localhost:1122/mcp
🎮 CLI选项
在运行MCP服务器时,您还可以使用以下CLI选项。通过运行带有-h的命令查看选项。
MCP Server Chart CLI
Options:
--transport, -t Specify the transport protocol: "stdio", "sse", or "streamable" (default: "stdio")
--port, -p Specify the port for SSE or streamable transport (default: 1122)
--endpoint, -e Specify the endpoint for the transport:
- For SSE: default is "/sse"
- For streamable: default is "/mcp"
--help, -h Show this help message
⚙️ 环境变量
| 变量 | 描述 | 默认值 | 示例 |
|---|---|---|---|
VIS_REQUEST_SERVER |
私有部署自定义图表生成服务URL | https://antv-studio.alipay.com/api/gpt-vis |
https://your-server.com/api/chart |
SERVICE_ID |
图表生成记录的服务标识符 | - | your-service-id-123 |
DISABLED_TOOLS |
用逗号分隔的禁用工具名称列表 | - | generate_fishbone_diagram,generate_mind_map |
📠 私有部署
MCP Server Chart默认提供免费的图表生成服务。对于需要私有部署的用户,可以尝试使用VIS_REQUEST_SERVER来自定义自己的图表生成服务。
{
"mcpServers": {
"mcp-server-chart": {
"command": "npx",
"args": [
"-y",
"@antv/mcp-server-chart"
],
"env": {
"VIS_REQUEST_SERVER": "<YOUR_VIS_REQUEST_SERVER>"
}
}
}
}
您可以使用AntV的项目GPT-Vis-SSR在私有环境中部署一个HTTP服务,然后通过环境变量VIS_REQUEST_SERVER传递URL地址。
- 方法:
POST - 参数: 将传递给
GPT-Vis-SSR进行渲染。例如,{ "type": "line", "data": [{ "time": "2025-05", "value": 512 }, { "time": "2025-06", "value": 1024 }] }。- 返回值: HTTP 服务的返回对象。- success:
boolean是否成功生成图表图像。 - resultObj:
string图表图像的 URL。 - errorMessage:
string当success = false时,返回错误信息。
- success:
[!NOTE]
目前私有部署方案不支持地理可视化图表生成,包括以下 3 个工具:geographic-district-map、geographic-path-map、geographic-pin-map。
🗺️ 生成记录
默认情况下,用户需要自行保存结果,但我们还提供了一个查看图表生成记录的服务,这需要用户为自己生成一个服务标识符并进行配置。
使用支付宝扫描并打开小程序以生成个人服务标识符(点击下方的“我的”菜单,进入“我的服务”页面,点击“生成”按钮,并在成功后点击“复制”按钮):
接下来,你需要在 MCP 服务器配置中添加 SERVICE_ID 环境变量。例如,Mac 的配置如下(对于 Windows 系统,只需添加 env 变量即可):
{
"mcpServers": {
"AntV Map": {
"command": "npx",
"args": [
"-y",
"@antv/mcp-server-chart"
],
"env": {
"SERVICE_ID": "***********************************"
}
}
}
}
更新 MCP Server 配置后,你需要重启你的 AI 客户端应用程序,并再次检查是否已成功启动并连接到 MCP Server。然后你可以尝试重新生成地图。生成成功后,你可以前往小程序的“我的地图”页面查看你的地图生成记录。
🎛️ 工具过滤
你可以使用 DISABLED_TOOLS 环境变量禁用特定的图表生成工具。当某些工具与你的 MCP 客户端存在兼容性问题或你希望限制可用功能时,这非常有用。
{
"mcpServers": {
"mcp-server-chart": {
"command": "npx",
"args": [
"-y",
"@antv/mcp-server-chart"
],
"env": {
"DISABLED_TOOLS": "generate_fishbone_diagram,generate_mind_map"
}
}
}
}
可用于过滤的工具名称 请参阅 ✨ 功能。
🔨 开发
安装依赖项:
npm install
构建服务器:
npm run build
启动 MCP 服务器:
npm run start
📄 许可证
MIT@AntV。