Skip to content

calebax/mcp-chart-option

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

  1. create_pie_chart_option
  2. create_line_chart_option
  3. create_column_chart_option
  4. create_area_chart_option
  5. create_bar_chart_option
  6. create_radar_chart_option
  7. create_funnel_chart_option
  8. create_histogram_chart_option
  9. create_scatter_chart_option
  10. 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

About

An MCP server for generating dynamic chart options for ECharts and other chart libraries.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published