AN

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.

Quick Install
npx -y @antvis/mcp-server-chart

Overview

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
npm install @antv/mcp-server-chart

# or yarn
yarn add @antv/mcp-server-chart

Run in development (typical npm script):

# from project root
npm run dev
# or
yarn dev

Build and run production:

npm run build
npm start

Common environment variables

# If routing visualization requests through a private visualization server
export VIS_REQUEST_SERVER="https://visual-server.example.com"

# Set a SERVICE_ID for record generation or telemetry
export SERVICE_ID="my-chart-service"

# Comma separated list to disable specific tools
export DISABLED_TOOLS="generate_word_cloud_chart,generate_mind_map"

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 namePurpose
generate_line_chartTime series / continuous trends
generate_bar_chartCategory comparisons (vertical)
generate_column_chartCategory comparisons (horizontal)
generate_area_chartCumulative/continuous trends
generate_scatter_chartBivariate relationship
generate_histogram_chartDistribution visualization
generate_boxplot_chartDistribution summary with outliers
generate_violin_chartDensity + distribution
generate_pie_chartProportions and shares
generate_funnel_chartStage-based losses
generate_dual_axes_chartTwo series with different units
generate_sankey_chartFlow and quantity between nodes
generate_treemap_chartHierarchical value display
generate_network_graphNode relationships
generate_word_cloud_chartText frequency visualization
generate_pin_map / generate_path_map / generate_district_mapGeospatial visualizations
generate_fishbone_diagram / generate_flow_diagram / generate_mind_mapDiagram 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):

{
  "tool": "generate_line_chart",
  "input": {
    "data": [
      {"date": "2023-01-01", "sales": 120},
      {"date": "2023-02-01", "sales": 150},
      {"date": "2023-03-01", "sales": 170}
    ],
    "x": "date",
    "y": "sales",
    "options": {"title": "Monthly Sales"}
  }
}

Response:

{
  "type": "chart",
  "spec": { /* AntV/G2-compatible chart specification */ },
  "insights": "Sales increased steadily from Jan to Mar, with a 41% rise overall. Consider investigating promotions or seasonality for March."
}

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.