M
MCP Server Chart Option
作者 @calebax
An MCP server for generating dynamic chart options for ECharts and other chart libraries.
创建于 11/8/2025
更新于 about 1 month ago
README
Repository documentation and setup instructions
MCP Server Chart Option
English | 中文
An MCP (Model Context Protocol) service that dynamically generates chart configuration options for various charting libraries based on input data.
Key Features
- Dynamically generates chart configurations supporting multiple chart types
- Provides a unified interface format for easy integration with various front-end charting libraries
Supported Chart Libraries
API Methods
- create_pie_chart_option
- create_line_chart_option
- create_column_chart_option
- create_area_chart_option
- create_bar_chart_option
- create_radar_chart_option
- create_funnel_chart_option
- create_histogram_chart_option
- create_scatter_chart_option
- create_boxplot_chart_option
Integration
The MCP Server can be automatically invoked by multiple MCP-compatible clients, such as:
- Claude Desktop / VSCode / Cursor / Cherry Studio / Cline, and others.
macOS Configuration
{
"mcpServers": {
"mcp-chart-option": {
"command": "npx",
"args": ["-y", "mcp-chart-option"]
}
}
}
Windows Configuration
{
"mcpServers": {
"mcp-chart-option": {
"command": "cmd",
"args": ["/c", "npx", "-y", "mcp-chart-option"]
}
}
}
When the MCP client starts, it will automatically execute:
npx -y mcp-chart-option
to launch the service.
Run in Streamable Mode
Run Directly
Install globally:
npm install -g mcp-chart-option
Start the server:
# Run with Streamable transport
mcp-chart-option --transport streamable
After startup, the service will be available at:
- Streamable endpoint:
http://localhost:1755/mcp
Docker Deployment
Enter the docker directory:
cd docker
Start the container:
docker compose up -d
Access the service at:
- Streamable endpoint:
http://localhost:1755/mcp
CLI Options
MCP Chart Option CLI
Options:
--transport, -t Specify the transport protocol: "stdio" or "streamable" (default: "stdio")
--host, -h Specify the host for streamable transport (default: localhost)
--port, -p Specify the port for streamable transport (default: 1755)
--endpoint, -e Specify the transport endpoint (default: "/mcp")
--component, -c Specify the chart component library to use, e.g., "echarts" (default: "echarts")
--help, -H Show this help message
Example
Input Example:
{
"name": "create_pie_chart_option",
"arguments": {
"data": [
{ "name": "Category A", "value": 17 },
{ "name": "Category B", "value": 55 }
]
}
}
Output Example (ECharts option):
{
"series": [
{
"type": "pie",
"data": [
{ "name": "Category A", "value": 17 },
{ "name": "Category B", "value": 55 }
]
}
]
}
Reference
快速设置
此服务器的安装指南
安装包 (如果需要)
npx @modelcontextprotocol/server-mcp-server-chart-option
Cursor 配置 (mcp.json)
{
"mcpServers": {
"calebax-mcp-server-chart-option": {
"command": "npx",
"args": [
"calebax-mcp-server-chart-option"
]
}
}
}