AntV Chart MCP Server for Visualization and Analysis
Generate AntV charts and insights with an MCP server for fast visualization, chart generation, and data analysis to explore and interpret your datasets.
npx -y @antvis/mcp-server-chartOverview
AntV Chart MCP Server is a TypeScript-based Model Context Protocol (MCP) server that generates AntV visualizations and contextual insights from structured datasets. It exposes a collection of chart-generation “tools” that an LLM or orchestration layer can call to produce chart specifications (AntV/G2-compatible) and short analytical commentary. The server is designed for fast visualization, chart generation, and data analysis workflows where models need programmatic access to charting capabilities.
The server is useful when you want an LLM-driven pipeline to:
- turn tabular data into visualizations (line, bar, scatter, map, etc.),
- produce quick interpretive text or observations alongside charts,
- integrate chart generation into chatbot plugins, visualization assistants, or analytics platforms (for example, Dify plugin integrations).
Features
- TypeScript implementation with 26+ chart generation tools
- Generates AntV-compatible chart specs suitable for rendering in web frontends
- Produces short textual insights/explanations alongside chart specs
- Supports a wide range of chart types: area, bar, boxplot, line, pie, radar, sankey, treemap, word cloud, maps (pin, path, district), and more
- Can be integrated as an MCP server for LLM tool calling or as a plugin in third-party assistants
- Supports streaming responses (SSE / streamable transports) for interactive experiences
- Simple controls for enabling/disabling tools and for private deployments
Installation / Configuration
Install the package from npm (or add the repository to your project):
# npm
# or yarn
Run in development (typical npm script):
# from project root
# or
Build and run production:
Common environment variables
# If routing visualization requests through a private visualization server
# Set a SERVICE_ID for record generation or telemetry
# Comma separated list to disable specific tools
Note: the server supports streaming transports (SSE or other streamable protocols). Configure your client to accept server-sent events or incremental JSON chunks to stream chart generation and analysis results.
Available Tools / Resources
The server exposes a tool per chart type. Each tool accepts structured input (data, encodings, chart options) and returns a chart spec plus insight text. Key tools include:
| Tool name | Purpose |
|---|---|
| generate_line_chart | Time series / continuous trends |
| generate_bar_chart | Category comparisons (vertical) |
| generate_column_chart | Category comparisons (horizontal) |
| generate_area_chart | Cumulative/continuous trends |
| generate_scatter_chart | Bivariate relationship |
| generate_histogram_chart | Distribution visualization |
| generate_boxplot_chart | Distribution summary with outliers |
| generate_violin_chart | Density + distribution |
| generate_pie_chart | Proportions and shares |
| generate_funnel_chart | Stage-based losses |
| generate_dual_axes_chart | Two series with different units |
| generate_sankey_chart | Flow and quantity between nodes |
| generate_treemap_chart | Hierarchical value display |
| generate_network_graph | Node relationships |
| generate_word_cloud_chart | Text frequency visualization |
| generate_pin_map / generate_path_map / generate_district_map | Geospatial visualizations |
| generate_fishbone_diagram / generate_flow_diagram / generate_mind_map | Diagram and process visualizations |
| … | (26+ total tools) |
Refer to the GitHub repository for example inputs and full tool signatures: https://github.com/antvis/mcp-server-chart
Example request / response (conceptual)
Request (tool call from an LLM orchestration layer):
Response:
Use Cases
- Exploratory data analysis: Have an LLM call specific chart tools to visualize distributions, trends, and correlations and return human-readable observations.
- Chatbot visualization assistant: Integrate the MCP server so a conversational agent can produce charts on demand in response to user queries (e.g., “Show monthly revenue and highlight anomalies”).
- Embedding in analytics platforms: Use the server to programmatically generate AntV specs for rendering dashboards, reports, and interactive visualizations.
- Private deployments: Route visualization processing through a private VIS_REQUEST_SERVER for compliance or data locality; disable unwanted tools via DISABLED_TOOLS for hardened deployments.
Getting Help and Contributing
See the project repository for examples, tests, and contribution guidelines: https://github.com/antvis/mcp-server-chart. Open issues or PRs if you find bugs, want additional chart types, or need integration examples for specific LLM stacks.