【MCP】一文对接图表MCP-mcp-server-chart
是基于antv的图标MCP,可以轻松的让大模型生成各种图表。
·
介绍
mcp-server-chart是基于antv的图标MCP,可以轻松的让大模型生成各种图表。
支持图表类型
支持生成超过25款图表,基本市面上常见图表都支持生成
generate_area_chart: Generate anareachart, used to display the trend of data under a continuous independent variable, allowing observation of overall data trends.generate_bar_chart: Generate abarchart, used to compare values across different categories, suitable for horizontal comparisons.generate_boxplot_chart: Generate aboxplot, used to display the distribution of data, including the median, quartiles, and outliers.generate_column_chart: Generate acolumnchart, used to compare values across different categories, suitable for vertical comparisons.generate_district_map- Generate adistrict-map, used to show administrative divisions and data distribution.generate_dual_axes_chart: Generate adual-axeschart, used to display the relationship between two variables with different units or ranges.generate_fishbone_diagram: Generate afishbonediagram, also known as an Ishikawa diagram, used to identify and display the root causes of a problem.generate_flow_diagram: Generate aflowchart, used to display the steps and sequence of a process.generate_funnel_chart: Generate afunnelchart, used to display data loss at different stages.generate_histogram_chart: Generate ahistogram, used to display the distribution of data by dividing it into intervals and counting the number of data points in each interval.generate_line_chart: Generate alinechart, used to display the trend of data over time or another continuous variable.generate_liquid_chart: Generate aliquidchart, used to display the proportion of data, visually representing percentages in the form of water-filled spheres.generate_mind_map: Generate amind-map, used to display thought processes and hierarchical information.generate_network_graph: Generate anetworkgraph, used to display relationships and connections between nodes.generate_organization_chart: Generate anorganizationalchart, used to display the structure of an organization and personnel relationships.generate_path_map- Generate apath-map, used to display route planning results for POIs.generate_pie_chart: Generate apiechart, used to display the proportion of data, dividing it into parts represented by sectors showing the percentage of each part.generate_pin_map- Generate apin-map, used to show the distribution of POIs.generate_radar_chart: Generate aradarchart, used to display multi-dimensional data comprehensively, showing multiple dimensions in a radar-like format.generate_sankey_chart: Generate asankeychart, used to display data flow and volume, representing the movement of data between different nodes in a Sankey-style format.generate_scatter_chart: Generate ascatterplot, used to display the relationship between two variables, showing data points as scattered dots on a coordinate system.generate_treemap_chart: Generate atreemap, used to display hierarchical data, showing data in rectangular forms where the size of rectangles represents the value of the data.generate_venn_chart: Generate avenndiagram, used to display relationships between sets, including intersections, unions, and differences.generate_violin_chart: Generate aviolinplot, used to display the distribution of data, combining features of boxplots and density plots to provide a more detailed view of the data distribution.generate_word_cloud_chart: Generate aword-cloud, used to display the frequency of words in textual data, with font sizes indicating the frequency of each word.
安装
npm install -g @antv/mcp-server-chart
启动
# sse, http://localhost:1122/sse
mcp-server-chart --transport sse
# http streamable, http://localhost:1122/mcp
mcp-server-chart --transport streamable
调用
先安装依赖
npm i @modelcontextprotocol/sdk
初始化client后调用
// mcp
import { Client } from '@modelcontextprotocol/sdk/client/index.js';
import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamableHttp.js';
// transport, mcpUrl为上面启动后的url
const transport = new StreamableHTTPClientTransport(new URL(mcpUrl));
// client
const client = new Client({ name: '', version: '' });
client.onmessage = (msg) => {};
client.onerror = (err) => {};
// client connect
await client.connect(transport);
// client list tools
await client.listTools();
// client call tool
await client.callTool({
name: name,
arguments: parameters,
});
// client close
await client.close();
在线体验
推荐一个在线体验的地址:mcp-servers.online
更多推荐



所有评论(0)