/ Directory / Playground / MCP ECharts
● Community hustcc ⚡ Instant

MCP ECharts

by hustcc · hustcc/mcp-echarts

ECharts via MCP — agents pick the right chart (line, bar, pie, scatter, heatmap, sankey, radar…) and return PNG/SVG or a raw option object.

hustcc/mcp-echarts wraps Apache ECharts behind an MCP server. 15+ chart tools cover the standard ECharts family — line, bar, area, pie, scatter, radar, heatmap, sankey, funnel, treemap, sunburst, and more — with full ECharts syntax passthrough. Renders locally (zero cloud), exports to PNG / SVG, or returns the raw ECharts option object so you can paste it into your own ECharts instance. Optional MinIO integration uploads generated images to object storage for sharing.

Why use it

Key features

Live Demo

What it looks like in practice

mcp-echarts.replay ▶ ready
0/0

Install

Pick your client

~/Library/Application Support/Claude/claude_desktop_config.json  · Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "mcp-echarts": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-echarts"
      ]
    }
  }
}

Open Claude Desktop → Settings → Developer → Edit Config. Restart after saving.

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "mcp-echarts": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-echarts"
      ]
    }
  }
}

Cursor uses the same mcpServers schema as Claude Desktop. Project config wins over global.

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "mcp-echarts": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-echarts"
      ]
    }
  }
}

Click the MCP Servers icon in the Cline sidebar, then "Edit Configuration".

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "mcp-echarts": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-echarts"
      ]
    }
  }
}

Same shape as Claude Desktop. Restart Windsurf to pick up changes.

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "mcp-echarts",
      "command": "npx",
      "args": [
        "-y",
        "mcp-echarts"
      ]
    }
  ]
}

Continue uses an array of server objects rather than a map.

~/.config/zed/settings.json
{
  "context_servers": {
    "mcp-echarts": {
      "command": {
        "path": "npx",
        "args": [
          "-y",
          "mcp-echarts"
        ]
      }
    }
  }
}

Add to context_servers. Zed hot-reloads on save.

claude mcp add mcp-echarts -- npx -y mcp-echarts

One-liner. Verify with claude mcp list. Remove with claude mcp remove.

Use Cases

Real-world ways to use MCP ECharts

Turn a table of numbers into a chart in one tool call

👤 Analysts, PMs, and engineers working in chat ⏱ ~5 min beginner

When to use: You have a small dataset and want a visual without opening a spreadsheet.

Prerequisites
  • Node 18+ — nvm install 18
Flow
  1. Describe the chart
    Bar chart of weekly active users: Mon 820, Tue 905, Wed 1120, Thu 980, Fri 1340, Sat 780, Sun 610. Title it 'WAU by day'.✓ Copied
    → Agent picks generate_bar_chart with correct x-axis labels and values
  2. Export the PNG
    Export as PNG and save it to ~/charts/wau.png.✓ Copied
    → File returned; png_path in tool result

Outcome: A chart you can drop into a deck or doc without leaving chat.

Pitfalls
  • Asking for a pie chart on a dataset with 30+ categories — Agent should suggest bar/heatmap instead; force it with 'use bar chart, pie is unreadable'
Combine with: filesystem

Get the raw ECharts option to paste into a React/Vue dashboard

👤 Frontend devs building internal tooling ⏱ ~15 min intermediate

When to use: You want Claude to draft the chart config so you only tweak it in your app.

Prerequisites
  • A frontend using ECharts — npm install echarts
Flow
  1. Ask for option JSON
    Generate an ECharts option for a stacked area chart: three series (direct, organic, paid), monthly for 2025.✓ Copied
    → Return shape is an option object with series[].type:'line', areaStyle, and stack:'total'
  2. Drop into your component
    Now emit it as a TypeScript const named exportOption.✓ Copied
    → TS const ready to paste

Outcome: Production-ready ECharts config without hand-crafting the boilerplate.

Pitfalls
  • Agent returning PNG when you wanted the option — Say 'return option JSON only — no rendering'
Combine with: antv-chart

Visualize a flow (funnel, journey, conversion) as a sankey

👤 Growth/product analysts ⏱ ~10 min beginner

When to use: You need a flow diagram for a deck and sankey is the right tool.

Flow
  1. Describe nodes and flows
    Sankey: Landing (1000) → Signup (420) → Activated (310) → Paid (95). Show dropoff percentages.✓ Copied
    → Correct node/link structure; labels include the counts
  2. Export SVG
    Export SVG so it scales in Keynote.✓ Copied
    → SVG path saved

Outcome: A crisp sankey for a funnel review, without Figma.

Combine with: markmap-mcp-server

Publish generated charts to MinIO for sharing

👤 Teams running a self-hosted object store ⏱ ~20 min intermediate

When to use: You want reproducible URLs for charts you'll reference from Slack/Notion.

Prerequisites
  • MinIO endpoint + credentials — Provision MINIO_* env vars in your MCP client config
Flow
  1. Configure env
    Set MINIO_ENDPOINT, MINIO_ACCESS_KEY, MINIO_SECRET_KEY, MINIO_BUCKET_NAME in the MCP config.✓ Copied
    → Server reports MinIO enabled at startup
  2. Generate and upload
    Chart the revenue by region; upload to MinIO and give me the URL.✓ Copied
    → Public (or presigned) URL returned

Outcome: Stable links for charts that won't break after chat rolls.

Pitfalls
  • Leaking credentials in config — Use a dedicated bucket-scoped IAM user, not the MinIO root key
Combine with: s3-like MCPs

Combinations

Pair with other MCPs for X10 leverage

mcp-echarts + filesystem

Read a CSV, extract columns, chart them

Read data/sales.csv, chart the 'revenue' column by 'region' as a bar chart.✓ Copied
mcp-echarts + bigquery-server

Run SQL then chart the result

Query last 30 days of signups from BigQuery; plot daily counts as a line.✓ Copied
mcp-echarts + antv-chart

Pick between ECharts and AntV by use case

For a Chinese-audience dashboard prefer ECharts; for data-ink-minimal pick AntV.✓ Copied

Tools

What this MCP exposes

ToolInputsWhen to callCost
generate_line_chart xAxis: array, series: array<number[]>, title?: str Trend over an ordered axis (time, position) 0
generate_bar_chart categories, values, stack?: bool Compare discrete categories 0
generate_pie_chart items: [{name, value}] Share-of-total with ≤8 slices 0
generate_scatter_chart points: [[x,y]] Correlation or clustering visualizations 0
generate_heatmap matrix: number[][], rows, cols Density or confusion matrices 0
generate_sankey nodes, links Flow/funnel between discrete states 0
generate_echarts_option free-form option object When you want full ECharts syntax, not a templated chart 0

Cost & Limits

What this costs to run

API quota
None — local render
Tokens per call
Small: option object in, path out
Monetary
Free
Tip
Ask for option JSON when you'll reuse it many times; ask for PNG for one-off shares.

Security

Permissions, secrets, blast radius

Credential storage: MinIO creds in env vars only. No server-side storage of your data beyond the rendered chart.
Data egress: No egress by default. MinIO export uploads to your configured endpoint only.

Troubleshooting

Common errors and fixes

PNG render is blank

Ensure series data types match (numbers, not strings) and x-axis length equals series length.

Verify: Inspect the option JSON; types should be number arrays
MinIO upload failed: signature mismatch

Check MINIO_USE_SSL, MINIO_PORT, and that access/secret keys belong to the same MinIO instance.

Verify: mc admin info myminio/
Fonts missing / CJK characters as boxes

Install a CJK-capable font in the environment running the MCP server (e.g., Noto Sans CJK).

Verify: fc-list | grep -i cjk

Alternatives

MCP ECharts vs others

AlternativeWhen to use it insteadTradeoff
antv-chartYou prefer AntV's opinionated defaults and Chinese docsSmaller chart vocabulary
markmap-mcp-serverYou need a hierarchy, not statistical chartsDifferent output class
mermaid-skillYou need flowcharts/sequence diagrams, not data chartsDiagrams ≠ charts

More

Resources

📖 Read the official README on GitHub

🐙 Browse open issues

🔍 Browse all 400+ MCP servers and Skills