echarts-mcp
A Model Context Protocol server that renders Apache ECharts options to SVG, enabling AI agents to generate deterministic charts server-side without a browser.
README
echarts-mcp
A modern, open-source Apache ECharts MCP server. It exposes type-safe tools that let AI agents and chat UIs render rich, deterministic charts server-side — no browser, no native canvas dependency.
Built against the Model Context Protocol v2 SDK (@modelcontextprotocol/server@2) and
Apache ECharts 6.1.0 (pinned), supporting both stdio and Streamable HTTP transports.
Highlights
- SVG-first rendering —
echarts.init(null, theme, { renderer: "svg", ssr: true })+renderToSVGString()produces clean, scalable vector output with zero native dependencies and no DOM. Deterministic by default (animation: false). - Fully stateless — every tool result is self-contained (raw SVG + echoed option). No files, no session state, horizontally scalable over HTTP.
- Type-safe tool surface — JSON Schema derived from Zod v4 (
Standard Schema), so agents get precise, machine-readable input/output contracts. - Passthrough fidelity —
render_echartaccepts any ECharts v6 option; it does not restrict chart types (seelist_chart_typesfor discoverability only).
Tools
| Tool | Purpose |
|---|---|
render_echart |
Renders an ECharts option to SVG. Returns the raw SVG + echoed option. |
validate_echart_option |
Dry-run structural + semantic validation (pinned to echarts@6.1.0) without rendering. |
list_chart_types |
Lists common series types for agent discoverability (not an allowlist). |
render_echart inputs
| Param | Type | Default | Notes |
|---|---|---|---|
option |
object | required | Full ECharts v6 option (passthrough). |
renderer |
"svg" | "canvas" | "dual" |
"svg" |
canvas/raster ships in v1.1. |
width / height |
int | 800 / 500 | Render dimensions in pixels. |
devicePixelRatio |
number | 2 | Raster only (deferred). |
theme |
string | object | "light" |
Built-in name or inline theme JSON object. |
background |
string | "transparent" |
e.g. "#ffffff" or "transparent". |
animation |
boolean | false |
Emit an animated SVG when true. |
The result carries an MCP text content block (the raw SVG) plus structuredContent
with svg, width, height, renderer, theme, background, and version.
Quick start
Requires Node.js 20+ (developed on Node 24) and pnpm.
pnpm install
pnpm build # compiles src/ -> dist/
pnpm dev # run via tsx (stdio)
pnpm start # run the compiled dist (stdio)
Run the server over stdio (the default) from an MCP client by pointing it at dist/index.js.
Install from npm
npm install -g @ryuk3nd0/echarts-mcp
# then use it from any MCP client:
echarts-mcp
# or ad-hoc without a global install:
npx -y @ryuk3nd0/echarts-mcp
Streamable HTTP
MCP_TRANSPORT=streamable-http MCP_HTTP_PORT=3030 node dist/index.js
The MCP endpoint is then available at http://localhost:3030/mcp.
Configuration
Configuration is resolved in this precedence order (highest first):
- Environment variables
- A JSON config file (
MCP_CONFIGpath, or./config.jsonwhen present) - Built-in defaults
| Env var | Config key | Default |
|---|---|---|
MCP_TRANSPORT |
transport |
stdio |
MCP_HTTP_HOST |
http.host |
0.0.0.0 |
MCP_HTTP_PORT |
http.port |
3030 |
MCP_HTTP_PATH |
http.path |
/mcp |
MCP_API_TOKEN |
http.authToken |
null (disabled) |
See config.example.json for the full shape.
Authentication (Streamable HTTP only)
By default the HTTP endpoint is open (intended for trusted localhost). To protect it,
set MCP_API_TOKEN (or http.authToken in config.json). Clients must then send
Authorization: Bearer <token>; requests without a matching token receive 401.
Development
pnpm typecheck # tsc --noEmit
pnpm lint # eslint
pnpm test # vitest run
pnpm format # prettier
Docker
docker build -t echarts-mcp .
# stdio
docker run -i --rm echarts-mcp
# streamable HTTP
docker run -p 3030:3030 -e MCP_TRANSPORT=streamable-http echarts-mcp
Roadmap / deferred
- Canvas/PNG raster engine (v1.1): requires a DOM shim +
@napi-rs/canvas+echarts.setPlatformAPI({ createCanvas, loadImage, measureText })+ font registration. - Full OAuth 2.1 resource-server auth (optional bearer token today).
License
Apache-2.0. See LICENSE.
Integrations
Ready-to-paste client config snippets live in integrations/:
integrations/claude-desktop.json— Claude Desktop stdio entry.integrations/mcp.json— generic stdio entry (Claude Code, Cursor, and others).integrations/streamable-http.json— remote Streamable HTTP endpoint for gateways and hosted LLM tool integrations.
A machine-readable SKILL.md at the repo root describes the server for Agent Skills systems.
The same guidance is exposed to MCP clients via the server's instructions field.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。