chart

内容来源:README.md(说明文档) · 原始地址 · 查看安装指南

原始内容

MCP Server for Generating Chart Image (FastMCP + FastAPI)

This is a MCP Server for generating chart images from Python code

Requirements

Usage

$ git clone https://github.com/qnnpnet/chart-mcp-server.git
$ cd chart-mcp-server
$ uv sync
$ uv run main.py

Generate Chart Image

$ curl -X POST http://localhost:8107/generate_chart \
  -H "Content-Type: application/json" \
  -d '{"code": "import matplotlib.pyplot as plt\nplt.plot([1,2,3],[4,5,6])\nplt.title(\"My Chart\")"}'

Response

{ "image_url": "http://localhost:8107/static/images/20250419160332_d8b758e9.png" }

Result

result