chart-mcp-server

qnnpnet/chart-mcp-server

3.1

If you are the rightful owner of chart-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

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

The MCP Server for Generating Chart Image is a specialized server that utilizes the Model Context Protocol (MCP) to generate chart images from Python code. It leverages FastMCP and FastAPI to provide a robust and efficient platform for creating visual representations of data. The server is designed to handle requests for chart generation, process the provided Python code, and return a URL to the generated image. This setup is ideal for developers and data scientists who need to quickly visualize data without manually creating charts.

Features

  • Python 3.11+ compatibility for modern development environments.
  • Integration with FastMCP and FastAPI for efficient request handling.
  • Support for generating charts using matplotlib, a popular Python plotting library.
  • Ability to run the server locally using uvicorn, a lightning-fast ASGI server.
  • Environment configuration using python-dotenv for easy setup and management.

Usages

local integration stdio

python
mcp.run(transport='stdio')  # Tools defined via @mcp.tool() decorator

local integration subprocess

python
command='uv', args=['run', 'main.py']  # Launch using virtual environment

remote integration sse

python
mcp.run(transport='sse', host="0.0.0.0", port=8107)  # Specify SSE endpoint

remote integration streamable http

yaml
paths:
  /mcp:
    post:
      x-ms-agentic-protocol: mcp-streamable-1.0  # Copilot Studio integration

fastmcp development

python
from mcp.server import FastMCP
app = FastMCP('chart')
@app.tool()
async def generate_chart(): ...