charts-mcp

@therealtimex/charts-mcp
Hosted
3 Stars 807 次浏览 更新于 2026-08-23

一个使用 AntV 生成图表的模型上下文协议服务器。它支持超过25种类型的图表,可用于图表生成和数据分析。

MCP 服务配置

复制以下 JSON 到 OPClaw 或其他 MCP 客户端的配置文件中即可使用

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

该服务需要配置环境变量:RENDER_MODE、UI_RESOURCE_MODE

可用工具 (44 个)

该服务在 MCP 协议中暴露的工具,AI 可按需调用

generate_arc_diagram 8 个参数 需填 1 项

Generate an arc diagram to visualize relationships between nodes in a linear or circular layout with curved edges. Useful for showing sequential processes with connections. Returns an interactive MCP-UI resource by default (format='html') that renders directly in compatible clients, a URL to an interactive HTML page (format='html-url'), or a static PNG image URL (format='png') for reports and documents.

必填参数:data

generate_area_chart 19 个参数 需填 1 项

Generate area charts with full G2 v5 capabilities. Supports: basic area (single series trends), range area (data uncertainty/bounds), stacked area (multiple series comparison), percentage stacked (proportion changes), difference area (comparing two series), and streamgraph (flowing stream layout with wiggle offset). Features include smooth curves, gradient fills, opacity control, advanced transforms (stackY with orderBy/offset, normalizeY, diffY), combined marks (area+line+point), scale configuration, axis formatting, and connectNulls for handling missing data. Perfect for time series data, trend analysis, and showing magnitude of change. Returns an interactive MCP-UI resource by default (format='html') that renders directly in compatible clients, a URL to an interactive HTML page (format='html-url'), or a static PNG image URL (format='png') for reports and documents.

必填参数:data

generate_bar_chart 14 个参数 需填 1 项

Generate a bar chart (horizontal or vertical) to show numerical comparisons among different categories. Supports orientation options (horizontal for many categories, vertical for fewer categories), advanced axis label configuration (auto-ellipsis, auto-wrap, auto-rotate, auto-hide), and interactions (element highlighting). Returns an interactive MCP-UI resource by default (format='html') that renders directly in compatible clients, a URL to an interactive HTML page (format='html-url'), or a static PNG image URL (format='png') for reports and documents.

必填参数:data

generate_bi_directional_bar_chart 17 个参数 需填 1 项

Generate a bi-directional bar chart (also known as positive-negative bar chart) to show numerical comparisons with both positive and negative values. Ideal for comparing completed vs uncompleted, agree vs disagree, or any opposing categories. Supports stacking for multiple agreement levels and hollow/solid styling to distinguish positive from negative. Returns an interactive MCP-UI resource by default (format='html') that renders directly in compatible clients, a URL to an interactive HTML page (format='html-url'), or a static PNG image URL (format='png') for reports and documents.

必填参数:data

generate_boxplot_chart 11 个参数 需填 1 项

Generate a boxplot chart to show data for statistical summaries among different categories, such as, comparing the distribution of data points across categories. Returns an interactive MCP-UI resource by default (format='html') that renders directly in compatible clients, a URL to an interactive HTML page (format='html-url'), or a static PNG image URL (format='png') for reports and documents.

必填参数:data

generate_bubble_chart 11 个参数 需填 1 项

Generate bubble charts for multivariate data visualization. Bubble charts display relationships between three or more variables using position (X, Y) and bubble size. The chart uses area (not radius) for size encoding to ensure accurate visual perception. Supports logarithmic scales for handling data with large value ranges (e.g., population data, GDP), color encoding for categorical grouping (e.g., continents), semi-transparent bubbles to handle overlapping, and customizable legends. Perfect for analyzing correlations, comparing clusters, and showing multidimensional patterns like economic indicators vs. health metrics vs. population. Returns an interactive MCP-UI resource by default (format='html') that renders directly in compatible clients, a URL to an interactive HTML page (format='html-url'), or a static PNG image URL (format='png') for reports and documents.

必填参数:data

generate_bubble_map 15 个参数

Generate bubble maps for geographic data visualization. Bubble maps display data on a geographic background using bubbles where position represents coordinates (longitude/latitude), bubble size represents values (e.g., GDP, population), and colors distinguish categories or regions. Uses G2 v5 geoView with point marks. Advanced features: (1) Multi-layer bubble maps - display multiple data series with different styles and opacities on the same map via 'layers' array; (2) Time-series animations - show temporal changes with automatic frame transitions via 'animation' config; (3) Map projections - support for mercator, albers, equalEarth, orthographic, and other geographic projections; (4) Custom GeoJSON backgrounds, logarithmic scales, and rich tooltips with formatters. Perfect for showing geographic distribution patterns, regional comparisons, temporal trends, and multidimensional location-based data like city economics, population growth, or business metrics. Returns an interactive MCP-UI resource by default (format='html') that renders directly in compatible clients, a URL to an interactive HTML page (format='html-url'), or a static PNG image URL (format='png') for reports and documents.

该工具无需必填参数,直接调用即可

generate_bullet_chart 14 个参数 需填 1 项

Generate bullet charts for KPI and performance monitoring. Bullet charts are compact dashboard visualizations that display actual values against targets with performance ranges. Components include: (1) Background ranges showing performance zones (poor/good/excellent), (2) Measures bar showing actual achieved value, (3) Target marker line showing goal. Features: horizontal or vertical orientation, single or layered performance ranges (e.g., [40, 30, 30] for 3-tier ranges), conditional coloring (green when above target, red when below), customizable labels with formatters, multi-metric comparison support. Perfect for dashboards, KPI tracking, resource utilization monitoring (CPU, memory, disk), sales completion rates, budget execution, and project progress. More space-efficient than gauge charts while providing richer context than simple progress bars. Returns an interactive MCP-UI resource by default (format='html') that renders directly in compatible clients, a URL to an interactive HTML page (format='html-url'), or a static PNG image URL (format='png') for reports and documents.

必填参数:data

generate_chord 11 个参数 需填 1 项

Generate a chord diagram to visualize flows and relationships between entities in a circular layout. Ideal for showing migration patterns, trade flows, or any inter-entity relationships. Returns an interactive MCP-UI resource by default (format='html') that renders directly in compatible clients, a URL to an interactive HTML page (format='html-url'), or a static PNG image URL (format='png') for reports and documents.

必填参数:data

generate_choropleth_map 14 个参数 需填 2 项

Generate choropleth maps (also called thematic maps or shaded maps) for geographic data visualization. Choropleth maps use color shading to represent statistical values across geographic regions like countries, states, or counties. Color intensity or hue represents the magnitude of values (e.g., population density, unemployment rate, election results, GDP per capita). Uses G2 v5 geoPath with data joins to combine geographic boundaries with statistical data. Features: (1) Flexible projections - support for mercator, albers, albersUsa, equalEarth, and other geographic projections; (2) Rich color palettes - built-in ColorBrewer schemes (ylGnBu, rdYlGn, spectral, etc.) or custom color arrays; (3) Multiple scale types - quantile, quantize, threshold, linear, log for different data distributions; (4) Data joins - automatically joins statistical data with GeoJSON/TopoJSON features by ID; (5) Custom tooltips with formatters. Perfect for visualizing census data, election results, economic indicators, disease spread, climate data, and any metric that varies by geographic region. Returns an interactive MCP-UI resource by default (format='html') that renders directly in compatible clients, a URL to an interactive HTML page (format='html-url'), or a static PNG image URL (format='png') for reports and documents.

必填参数:geoData、data

generate_color_map 18 个参数 需填 1 项

Generate color maps (also called color block charts) for visualizing relationships between two categorical dimensions. Color maps use a regular grid where each cell represents the intersection of two categorical variables (x and y axes), with color intensity encoding numerical values. Perfect for showing patterns and relationships in multi-dimensional categorical data. Common use cases: (1) Product sales across time periods - see which products perform best in which months; (2) Student exam scores across subjects - identify strengths and weaknesses; (3) Fare matrices - show pricing between different origin-destination pairs; (4) Performance tracking - compare metrics across teams and time periods; (5) Conditional formatting - use threshold scales to highlight cells meeting specific criteria (e.g., above/below target). Features: Sequential color palettes (rdBu, ylGnBu, etc.) for continuous data ranges, threshold scales for conditional formatting with custom breakpoints, value labels in cells with conditional text colors, customizable cell spacing and borders, interactive tooltips and highlighting. Best for datasets with up to 20 categories per dimension (max ~400 cells). Not suitable for: very few data points (use bar/table instead), showing precise trends over time (use line chart instead), continuous data distributions (use heatmap instead). Returns an interactive MCP-UI resource by default (format='html') that renders directly in compatible clients, a URL to an interactive HTML page (format='html-url'), or a static PNG image URL (format='png') for reports and documents.

必填参数:data

generate_column_chart 11 个参数 需填 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. Returns an interactive MCP-UI resource by default (format='html') that renders directly in compatible clients, a URL to an interactive HTML page (format='html-url'), or a static PNG image URL (format='png') for reports and documents.

必填参数:data

generate_compact_tree 8 个参数 需填 1 项

Generate a compact tree layout to visualize hierarchical structures in a space-efficient manner. Ideal for file systems, organizational charts, and any tree-structured data where space optimization is important. Returns an interactive MCP-UI resource by default (format='html') that renders directly in compatible clients, a URL to an interactive HTML page (format='html-url'), or a static PNG image URL (format='png') for reports and documents.

必填参数:data

generate_concentric_graph 7 个参数 需填 1 项

Generate a concentric graph layout with nodes arranged in concentric circles. Useful for visualizing network structures, social networks, and relationships with a radial organization. Returns an interactive MCP-UI resource by default (format='html') that renders directly in compatible clients, a URL to an interactive HTML page (format='html-url'), or a static PNG image URL (format='png') for reports and documents.

必填参数:data

generate_contour_plot 11 个参数 需填 1 项

Generate a contour plot to visualize three-dimensional data on a two-dimensional plane. Supports two variants: 'cell' for heatmap-style visualization with color gradients (like topographic maps), and 'line' for traditional contour outline charts with isolines. Useful for showing temperature distributions, elevation maps, density plots, terrain visualization, or any continuous spatial data. Returns an interactive MCP-UI resource by default (format='html') that renders directly in compatible clients, a URL to an interactive HTML page (format='html-url'), or a static PNG image URL (format='png') for reports and documents.

必填参数:data

generate_dendrogram 8 个参数 需填 1 项

Generate a dendrogram to visualize hierarchical tree structures. Useful for showing taxonomies, classification systems, organizational hierarchies, and phylogenetic relationships. Returns an interactive MCP-UI resource by default (format='html') that renders directly in compatible clients, a URL to an interactive HTML page (format='html-url'), or a static PNG image URL (format='png') for reports and documents.

必填参数:data

generate_district_map 5 个参数 需填 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. Returns an interactive MCP-UI resource by default (format='html') that renders directly in compatible clients, a URL to an interactive HTML page (format='html-url'), or a static PNG image URL (format='png') for reports and documents.

必填参数:title、data

generate_donut_chart 15 个参数 需填 1 项

Generate a donut chart (doughnut chart) with full G2 v5 capabilities. Features include: customizable labels (category, value, percentage with multiple label layers), flexible legend positioning, center annotations for totals/titles, faceted small multiples for comparisons, mark-specific styling (stroke, opacity), and flexible data field mapping. Ideal for proportional relationships with better space utilization (max 9 categories recommended).

必填参数:data

generate_dual_axes_chart 9 个参数 需填 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. Returns an interactive MCP-UI resource by default (format='html') that renders directly in compatible clients, a URL to an interactive HTML page (format='html-url'), or a static PNG image URL (format='png') for reports and documents.

必填参数:categories、series

generate_fishbone_diagram 6 个参数 需填 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. Returns an interactive MCP-UI resource by default (format='html') that renders directly in compatible clients, a URL to an interactive HTML page (format='html-url'), or a static PNG image URL (format='png') for reports and documents.

必填参数:data

generate_flow_diagram 6 个参数 需填 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. Returns an interactive MCP-UI resource by default (format='html') that renders directly in compatible clients, a URL to an interactive HTML page (format='html-url'), or a static PNG image URL (format='png') for reports and documents.

必填参数:data

generate_funnel_chart 7 个参数 需填 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. Returns an interactive MCP-UI resource by default (format='html') that renders directly in compatible clients, a URL to an interactive HTML page (format='html-url'), or a static PNG image URL (format='png') for reports and documents.

必填参数:data

generate_grid_graph 8 个参数 需填 1 项

Generate a grid layout graph with nodes arranged in a regular grid pattern. Useful for visualizing task boards, process flows, and structured layouts where items need to be organized in rows and columns. Returns an interactive MCP-UI resource by default (format='html') that renders directly in compatible clients, a URL to an interactive HTML page (format='html-url'), or a static PNG image URL (format='png') for reports and documents.

必填参数:data

generate_hierarchical_edge_bundling 7 个参数 需填 1 项

Generate a hierarchical edge bundling diagram to visualize connections within hierarchical data. This layout bundles edges together to reduce visual clutter, making it ideal for showing dependencies, imports, or relationships in complex hierarchical systems like package dependencies or module relationships. Returns an interactive MCP-UI resource by default (format='html') that renders directly in compatible clients, a URL to an interactive HTML page (format='html-url'), or a static PNG image URL (format='png') for reports and documents.

必填参数:data

generate_histogram_chart 11 个参数 需填 1 项

Generate a histogram chart to show the frequency or density distribution of continuous numerical data. Supports three modes: (1) Basic histogram showing raw frequency counts, (2) Multi-distribution histogram for comparing multiple groups side-by-side with color encoding, (3) Density histogram showing normalized probability density for statistical analysis. Useful for observing data distribution patterns (normal, skewed), identifying concentration areas, detecting outliers, and comparing distributions. Returns an interactive MCP-UI resource by default (format='html') that renders directly in compatible clients, a URL to an interactive HTML page (format='html-url'), or a static PNG image URL (format='png') for reports and documents.

必填参数:data

generate_hybrid_chart 10 个参数 需填 2 项

Generate a hybrid visualization combining G2 statistical charts with G6 graph/network layouts. Ideal for showing both quantitative data (bar, line charts) alongside relational data (network graphs) in a single integrated view. For example, displaying sales data alongside product relationship networks. Returns an interactive MCP-UI resource by default (format='html') that renders directly in compatible clients, a URL to an interactive HTML page (format='html-url'), or a static PNG image URL (format='png') for reports and documents.

必填参数:g2Config、g6Config

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. Returns an interactive MCP-UI resource by default (format='html') that renders directly in compatible clients, a URL to an interactive HTML page (format='html-url'), or a static PNG image URL (format='png') for reports and documents.

必填参数:data

generate_liquid_chart 8 个参数 需填 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. Returns an interactive MCP-UI resource by default (format='html') that renders directly in compatible clients, a URL to an interactive HTML page (format='html-url'), or a static PNG image URL (format='png') for reports and documents.

必填参数:percent

generate_mind_map 6 个参数 需填 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. Returns an interactive MCP-UI resource by default (format='html') that renders directly in compatible clients, a URL to an interactive HTML page (format='html-url'), or a static PNG image URL (format='png') for reports and documents.

必填参数:data

generate_network_graph 6 个参数 需填 1 项

Generate a network graph chart to show relationships (edges) between entities (nodes), such as, relationships between people in social networks. Returns an interactive MCP-UI resource by default (format='html') that renders directly in compatible clients, a URL to an interactive HTML page (format='html-url'), or a static PNG image URL (format='png') for reports and documents.

必填参数:data

generate_organization_chart 7 个参数 需填 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. Returns an interactive MCP-UI resource by default (format='html') that renders directly in compatible clients, a URL to an interactive HTML page (format='html-url'), or a static PNG image URL (format='png') for reports and documents.

必填参数:data

generate_parallel_coordinates 8 个参数 需填 2 项

Generate a parallel coordinates plot to visualize multivariate data. Useful for comparing multiple variables across different data points, finding patterns, and identifying outliers in high-dimensional datasets. Returns an interactive MCP-UI resource by default (format='html') that renders directly in compatible clients, a URL to an interactive HTML page (format='html-url'), or a static PNG image URL (format='png') for reports and documents.

必填参数:dimensions、data

generate_path_map 5 个参数 需填 2 项

Generate a route map to display the user's planned route, such as travel guide routes. Returns an interactive MCP-UI resource by default (format='html') that renders directly in compatible clients, a URL to an interactive HTML page (format='html-url'), or a static PNG image URL (format='png') for reports and documents.

必填参数:title、data

generate_pie_chart 8 个参数 需填 1 项

Generate a pie chart to show the proportion of parts, such as, market share and budget allocation. Returns an interactive MCP-UI resource by default (format='html') that renders directly in compatible clients, a URL to an interactive HTML page (format='html-url'), or a static PNG image URL (format='png') for reports and documents.

必填参数:data

generate_pin_map 6 个参数 需填 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. Returns an interactive MCP-UI resource by default (format='html') that renders directly in compatible clients, a URL to an interactive HTML page (format='html-url'), or a static PNG image URL (format='png') for reports and documents.

必填参数:title、data

generate_radar_chart 7 个参数 需填 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. Returns an interactive MCP-UI resource by default (format='html') that renders directly in compatible clients, a URL to an interactive HTML page (format='html-url'), or a static PNG image URL (format='png') for reports and documents.

必填参数:data

generate_sankey_chart 8 个参数 需填 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. Returns an interactive MCP-UI resource by default (format='html') that renders directly in compatible clients, a URL to an interactive HTML page (format='html-url'), or a static PNG image URL (format='png') for reports and documents.

必填参数:data

generate_scatter_chart 9 个参数 需填 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. Returns an interactive MCP-UI resource by default (format='html') that renders directly in compatible clients, a URL to an interactive HTML page (format='html-url'), or a static PNG image URL (format='png') for reports and documents.

必填参数:data

generate_stream_graph 8 个参数 需填 1 项

Generate a stream graph (or theme river) to visualize changes in data over time for multiple categories. The flowing, organic shapes make it ideal for showing trends, patterns, and the relative proportions of different categories over time. Returns an interactive MCP-UI resource by default (format='html') that renders directly in compatible clients, a URL to an interactive HTML page (format='html-url'), or a static PNG image URL (format='png') for reports and documents.

必填参数:data

generate_treemap_chart 7 个参数 需填 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. Returns an interactive MCP-UI resource by default (format='html') that renders directly in compatible clients, a URL to an interactive HTML page (format='html-url'), or a static PNG image URL (format='png') for reports and documents.

必填参数:data

generate_venn_chart 7 个参数 需填 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. Returns an interactive MCP-UI resource by default (format='html') that renders directly in compatible clients, a URL to an interactive HTML page (format='html-url'), or a static PNG image URL (format='png') for reports and documents.

必填参数:data

generate_violin_chart 9 个参数 需填 1 项

Generate a violin chart to show data for statistical summaries among different categories, such as, comparing the distribution of data points across categories. Returns an interactive MCP-UI resource by default (format='html') that renders directly in compatible clients, a URL to an interactive HTML page (format='html-url'), or a static PNG image URL (format='png') for reports and documents.

必填参数:data

generate_word_cloud_chart 7 个参数 需填 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. Returns an interactive MCP-UI resource by default (format='html') that renders directly in compatible clients, a URL to an interactive HTML page (format='html-url'), or a static PNG image URL (format='png') for reports and documents.

必填参数:data

get_area_chart_guide 1 个参数

Get the JSON guide for area chart (G2 v5): data shapes, encodings, transforms, styles, examples.

该工具无需必填参数,直接调用即可

服务介绍

MCP Server Chart build npm Version smithery badge npm License Trust Score

一个用于生成图表的Model Context Protocol服务器,使用AntV。我们可以使用这个MCP服务器进行_图表生成_和_数据分析_。

这是一个基于TypeScript的MCP服务器,提供图表生成功能。它允许您通过MCP工具创建各种类型的图表。您也可以在Dify中使用它。

📋 目录

✨ 特性

现已支持25+种图表。

  1. generate_area_chart: 生成面积图,用于显示连续自变量下的数据趋势,允许观察整体数据趋势。
  2. generate_bar_chart: 生成条形图,用于比较不同类别的值,适合横向比较。
  3. generate_boxplot_chart: 生成箱线图,用于显示数据分布,包括中位数、四分位数和异常值。
  4. generate_column_chart: 生成柱状图,用于比较不同类别的值,适合纵向比较。
  5. generate_district_map - 生成地区地图,用于显示行政区划和数据分布。
  6. generate_dual_axes_chart: 生成双轴图,用于显示两个具有不同单位或范围的变量之间的关系。
  7. generate_fishbone_diagram: 生成鱼骨图(也称为石川图),用于识别并显示问题的根本原因。
  8. generate_flow_diagram: 生成流程图,用于显示过程中的步骤和顺序。
  9. generate_funnel_chart: 生成漏斗图,用于显示不同阶段的数据损失。
  10. generate_histogram_chart: 生成直方图,用于通过将数据分成区间并计算每个区间内的数据点数量来显示数据分布。
  11. generate_line_chart: 生成折线图,用于显示随时间或其他连续变量变化的数据趋势。
  12. generate_liquid_chart: 生成液体图,用于显示数据的比例,以水填充球体的形式直观表示百分比。
  13. generate_mind_map: 生成思维导图,用于显示思维过程和层次信息。
  14. generate_network_graph: 生成网络图,用于显示节点之间的关系和连接。
  15. generate_organization_chart: 生成组织图,用于显示组织结构和人员关系。1. generate_path_map - 生成一个path-map,用于显示POI的路线规划结果。
  16. generate_pie_chart: 生成一个pie图,用于显示数据的比例,将其划分为由扇形表示的部分,展示每个部分的百分比。
  17. generate_pin_map - 生成一个pin-map,用于显示POI的分布情况。
  18. generate_radar_chart: 生成一个radar图,用于全面展示多维数据,在类似雷达的格式中显示多个维度。
  19. generate_sankey_chart: 生成一个sankey图,用于展示数据流和量,以Sankey风格的格式表示不同节点间的数据流动。
  20. generate_scatter_chart: 生成一个scatter散点图,用于展示两个变量之间的关系,在坐标系上以分散的点形式展示数据点。
  21. generate_treemap_chart: 生成一个treemap,用于展示层次结构数据,以矩形的形式展示数据,其中矩形的大小代表数据值。
  22. generate_venn_chart: 生成一个venn图,用于展示集合之间的关系,包括交集、并集和差集。
  23. generate_violin_chart: 生成一个violin图,用于展示数据分布,结合箱线图和密度图的特点,提供更详细的数据分布视图。
  24. generate_word_cloud_chart: 生成一个word-cloud词云图,用于展示文本数据中词语的频率,字体大小表示每个词的频率。

[!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协议在aliyunmodelscopeglama.aismithery.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: stringsuccess = false 时,返回错误信息。

[!NOTE]
私有部署方案目前不支持地理可视化图表生成,包括以下 3 个工具:geographic-district-mapgeographic-path-mapgeographic-pin-map

🗺️ 生成记录

默认情况下,用户需要自行保存结果,但我们还提供了一种查看图表生成记录的服务,这要求用户为自己生成一个服务标识符并进行配置。

使用支付宝扫描并打开小程序以生成个人服务标识符(点击下方的“我的”菜单,进入“我的服务”页面,点击“生成”按钮,在成功后点击“复制”按钮):

接下来,你需要在 MCP 服务器配置中添加 SERVICE_ID 环境变量。例如,Mac 的配置如下(对于 Windows 系统,只需添加 env 变量):


{

  "mcpServers": {

    "AntV Map": {

      "command": "npx",

      "args": [

        "-y",

        "@antv/mcp-server-chart"

      ],

      "env": {

        "SERVICE_ID": "***********************************"

      }

    }

  }

}

更新 MCP 服务器配置后,你需要重启你的 AI 客户端应用程序,并再次检查是否已成功启动并连接到 MCP 服务器。然后你可以尝试重新生成地图。生成成功后,你可以前往小程序的“我的地图”页面查看你的地图生成记录。

🎛️ 工具过滤

你可以使用 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

使用 SSE 传输启动 MCP 服务器:


node build/index.js -t sse

使用 Streamable 传输启动 MCP 服务器:


node build/index.js -t streamable

📄 许可证

MIT@AntV

相关 MCP 服务