MCP Server for Generating Chart Image (FastMCP + FastAPI)
LocalAbout MCP Server for Generating Chart Image (FastMCP + FastAPI)
A Python-based MCP server that generates chart images from submitted code, for developers who need to render plots through an HTTP endpoint. It returns a URL for the generated image.
Key features
- 01Generate chart images from Python code
- 02HTTP endpoint for chart generation
- 03Return generated image URL
Use cases
- 01Render a Matplotlib plot from Python code
- 02Retrieve a URL to a generated chart
MCP support
Exposes chart generation through an MCP server; the README also documents an HTTP endpoint for submitting code and receiving an image URL.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.
Tools
Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.
Details
From the project READMEMCP Server for Generating Chart Image (FastMCP + FastAPI)
This is a MCP Server for generating chart images from Python code
Requirements
- Python 3.11+
- FastMCP
- FastAPI
- uvicorn
- python-dotenv
- requests
- matplotlib
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

Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.