使用说明
ECharts MCP服务器
用于生成图表的模型上下文协议服务器 EC图表 灵感源自 AntV.
这是一个基于TypeScript的MCP服务器,提供图表生成功能。它允许您通过MCP工具创建各种类型的图表。您还可以在 迪菲.
✨ 特性
几乎支持所有类型的图表。 每个工具都会返回一个图表预览URL,即echarts官方图表预览页面。
例如,这个 饼图
generate_bar_chart-生成一个bar图表。generate_line_chart-生成一个line图表。generate_pie_chart-生成一个pie图表。generate_scatter_chart-生成一个scatter图表。generate_radar_chart-生成一个radar图表。generate_heatmap_chart-生成一个heatmap图表。generate_general_chart-生成一个effectScatter, tree, treemap, sunburst, boxplot, candlestick, graph, sankey, funnel, gauge or themeRiver图表。
🤖 用法
与一起使用 Desktop APP例如克劳德、VSCode、, 克莱恩Cherry Studio、Cursor等,在下面添加MCP服务器配置。
{
"mcpServers": {
"echarts-server": {
"command": "node",
"args": [
"your-path/echarts-mcp-server/build/index.js"
]
}
}
}
或
{
"mcpServers": {
"echarts-server": {
"command": "npx",
"args": [
"-y",
"echarts-mcp-server"
]
}
}
}
此外,您还可以在 阿里云, 魔搭, glama.ai, 史密斯艾 或使用HTTP、SSE协议的其他协议。
🚰 使用SSE或流媒体传输运行
全局安装该软件包。
npm install -g echarts-mcp-server
使用首选传输选项运行服务器:
# For SSE transport (default endpoint: /sse)
echarts-mcp-server --transport sse
# For Streamable transport with custom endpoint
echarts-mcp-server --transport streamable
然后,您可以访问服务器:
- SSE运输:
http://localhost:1122/sse - 可流动运输:
http://localhost:1122/mcp
🎮 CLI选项
运行MCP服务器时,您还可以使用以下CLI选项。使用run-cli命令选项 -h.
MCP Server Chart CLI
Options:
--transport, -t Specify the transport protocol: "stdio", "sse", or "streamable" (default: "stdio")
--port, -p Specify the port for SSE or streamable transport (default: 1122)
--endpoint, -e Specify the endpoint for the transport:
- For SSE: default is "/sse"
- For streamable: default is "/mcp"
--help, -h Show this help message
🔨 发展
安装依赖项:
npm install
构建服务器:
npm run build
启动MCP服务器:
npm run start
