Wraps matplotlib and Mermaid to generate charts from structured data via MCP tools. You get render_chart for bar, line, pie, scatter, and heatmap plots with configurable field mappings and theme options. Outputs either Mermaid diagrams that render inline in Cursor, base64 PNG images for vision model analysis, or plain text. Includes suggest_fields to infer appropriate column roles from sample rows and list_chart_types to see what's available. Ships with uvx support for zero-install usage and stdio transport for direct spawning from MCP clients. Useful when you need quick visual feedback on tabular data without leaving your chat context or writing plotting code yourself.
pip install mcp-plots
mcp-plots # Start the server
pip install mcp-plots~/.cursor/mcp.json):
{
"mcpServers": {
"plots": {
"command": "mcp-plots",
"args": ["--transport", "stdio"]
}
}
}
Alternative (zero-install via uvx + PyPI):
{
"mcpServers": {
"plots": {
"command": "uvx",
"args": ["mcp-plots", "--transport", "stdio"]
}
}
}
uvx --from git+https://github.com/mr901/mcp-plots.git run-server.py
Documentation → | Quick Start → | API Reference →
This server is published under the MCP registry identifier io.github.MR901/mcp-plots. You can discover/verify it via the official registry API:
curl "https://registry.modelcontextprotocol.io/v0/servers?search=io.github.MR901/mcp-plots"
Registry metadata for this project is tracked in server.json.
This repository includes a smithery.yaml for easy setup with Smithery.
smithery.yamlExample install using the Smithery CLI (adjust --client as needed, e.g. cursor, claude):
npx -y @smithery/cli install \
https://raw.githubusercontent.com/mr901/mcp-plots/main/smithery.yaml \
--client cursor
After installation, your MCP client should be able to start the server over stdio using the command defined in smithery.yaml.
src/
app/ # Server construction and runtime
server.py
capabilities/ # MCP tools and prompts
tools.py
prompts.py
visualization/ # Plotting engines and configurations
chart_config.py
generator.py
requirements.txtThe easiest way to run the MCP server without managing Python environments:
# Run directly with uvx (no installation needed)
uvx --from git+https://github.com/mr901/mcp-plots.git run-server.py
# Or install and run the command
uvx --from git+https://github.com/mr901/mcp-plots.git mcp-plots
# With custom options
uvx --from git+https://github.com/mr901/mcp-plots.git mcp-plots --port 8080 --log-level DEBUG
Why uvx?
pip install -r requirements.txt
python -m src --transport streamable-http --host 0.0.0.0 --port 8000 --log-level INFO
python -m src --transport stdio
git clone https://github.com/mr901/mcp-plots.git
cd mcp-plots
pip install -e .
python -m src --transport stdio --log-level DEBUG
docker build -t mcp-plots .
docker run -p 8000:8000 mcp-plots
Environment variables (optional):
MCP_TRANSPORT (streamable-http|stdio)MCP_HOST (default 0.0.0.0)MCP_PORT (default 8000)LOG_LEVEL (default INFO)list_chart_types() → returns available chart typeslist_themes() → returns available themessuggest_fields(sample_rows) → suggests field roles based on data samplesrender_chart(chart_type, data, field_map, config_overrides?, options?, output_format?) → returns MCP contentgenerate_test_image() → generates a test image (red circle) to verify MCP image supportThis MCP server is fully compatible with Cursor's image support! When you use the render_chart tool:
The server returns images in the MCP format Cursor requires:
{
"content": [
{
"type": "image",
"data": "<base64-encoded-png>",
"mimeType": "image/png"
}
]
}
Example call (pseudo):
render_chart(
chart_type="bar",
data=[{"category":"A","value":10},{"category":"B","value":20}],
field_map={"category_field":"category","value_field":"value"},
config_overrides={"title":"Example Bar","width":800,"height":600,"output_format":"MCP_IMAGE"}
)
Return shape (PNG):
{
"status": "success",
"content": [{"type":"image","data":"<base64>","mimeType":"image/png"}]
}
The server can be configured via environment variables or command line arguments:
MCP_TRANSPORT - Transport type: streamable-http or stdio (default: streamable-http)MCP_HOST - Host address (default: 0.0.0.0)MCP_PORT - Port number (default: 8000)LOG_LEVEL - Logging level: DEBUG, INFO, WARNING, ERROR, CRITICAL (default: INFO)MCP_DEBUG - Enable debug mode: true or false (default: false)CHART_DEFAULT_WIDTH - Default chart width in pixels (default: 800)CHART_DEFAULT_HEIGHT - Default chart height in pixels (default: 600)CHART_DEFAULT_DPI - Default chart DPI (default: 100)CHART_MAX_DATA_POINTS - Maximum data points per chart (default: 10000)With uvx (recommended):
uvx --from git+https://github.com/mr901/mcp-plots.git mcp-plots --help
# Examples:
uvx --from git+https://github.com/mr901/mcp-plots.git mcp-plots --port 8080 --log-level DEBUG
uvx --from git+https://github.com/mr901/mcp-plots.git mcp-plots --chart-width 1200 --chart-height 800
Traditional Python:
python -m src --help
# Examples:
python -m src --transport streamable-http --host 0.0.0.0 --port 8000
python -m src --log-level DEBUG --chart-width 1200 --chart-height 800
Build image:
docker build -t mcp-plots .
Run container with custom configuration:
docker run --rm -p 8000:8000 \
-e MCP_TRANSPORT=streamable-http \
-e MCP_HOST=0.0.0.0 \
-e MCP_PORT=8000 \
-e LOG_LEVEL=INFO \
-e CHART_DEFAULT_WIDTH=1000 \
-e CHART_DEFAULT_HEIGHT=700 \
-e CHART_DEFAULT_DPI=150 \
-e CHART_MAX_DATA_POINTS=5000 \
mcp-plots
The Plots MCP Server is designed to work seamlessly with Cursor's MCP support. Here's how to integrate it:
Add this to your Cursor MCP configuration file (~/.cursor/mcp.json or similar):
{
"mcpServers": {
"plots": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/mr901/mcp-plots.git@main",
"mcp-plots",
"--transport",
"stdio"
],
"env": {
"LOG_LEVEL": "INFO",
"CHART_DEFAULT_WIDTH": "800",
"CHART_DEFAULT_HEIGHT": "600"
}
}
}
}
For HTTP-based integration:
{
"mcpServers": {
"plots-http": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/mr901/mcp-plots.git@main",
"mcp-plots",
"--transport",
"streamable-http",
"--host",
"127.0.0.1",
"--port",
"8000"
]
}
}
}
For local development (if you have the code cloned):
{
"mcpServers": {
"plots-dev": {
"command": "python",
"args": ["-m", "src", "--transport", "stdio"],
"cwd": "/path/to/mcp-plots",
"env": {
"LOG_LEVEL": "DEBUG"
}
}
}
}
After adding the configuration:
Create a bar chart showing sales data: A=100, B=150, C=80
This server prioritizes MERMAID output by default because:
Chart Types with Native MERMAID Support:
line, bar, pie, area → xychart-beta formathistogram → xychart-beta with automatic binningfunnel → Styled flowchart with color gradientsgauge → Flowchart with color-coded value indicatorssankey → Flow diagrams with source/target stylingrender_chartMain chart generation tool with MERMAID-first approach.
Parameters:
chart_type - Chart type (line, bar, pie, scatter, heatmap, etc.)data - List of data objectsfield_map - Field mappings (x_field, y_field, category_field, etc.)config_overrides - Chart configuration overridesoutput_format - Output format (mermaid [default], mcp_image, mcp_text)Special Modes:
chart_type="help" - Show available chart types and themeschart_type="suggest" - Analyze data and suggest field mappingsconfigure_preferencesInteractive configuration tool for setting user preferences.
Parameters:
output_format - Default output format (mermaid, mcp_image, mcp_text)theme - Default theme (default, dark, seaborn, minimal)chart_width - Default chart width in pixelschart_height - Default chart height in pixelsreset_to_defaults - Reset all preferences to system defaultsFeatures:
~/.plots_mcp_config.jsonconfig_overrides for one-off changesBasic Bar Chart:
{
"chart_type": "bar",
"data": [
{"category": "Sales", "value": 120},
{"category": "Marketing", "value": 80},
{"category": "Support", "value": 60}
],
"field_map": {
"category_field": "category",
"value_field": "value"
}
}
Time Series Line Chart:
{
"chart_type": "line",
"data": [
{"date": "2024-01", "revenue": 1000},
{"date": "2024-02", "revenue": 1200},
{"date": "2024-03", "revenue": 1100}
],
"field_map": {
"x_field": "date",
"y_field": "revenue"
}
}
Funnel Chart:
{
"chart_type": "funnel",
"data": [
{"stage": "Awareness", "value": 1000},
{"stage": "Interest", "value": 500},
{"stage": "Purchase", "value": 100}
],
"field_map": {
"category_field": "stage",
"value_field": "value"
}
}
MCP_TRANSPORT - Transport type (streamable-http | stdio)MCP_HOST - Host address (default: 0.0.0.0)MCP_PORT - Port number (default: 8000)LOG_LEVEL - Logging level (default: INFO)MCP_DEBUG - Enable debug mode (true | false)CHART_DEFAULT_WIDTH - Default chart width in pixels (default: 800)CHART_DEFAULT_HEIGHT - Default chart height in pixels (default: 600)CHART_DEFAULT_DPI - Default chart DPI (default: 100)CHART_MAX_DATA_POINTS - Maximum data points per chart (default: 10000)Personal preferences are stored in ~/.plots_mcp_config.json:
{
"defaults": {
"output_format": "mermaid",
"theme": "default",
"chart_width": 800,
"chart_height": 600
},
"user_preferences": {
"output_format": "mcp_image",
"theme": "dark"
}
}
Available themes: default, dark, seaborn, minimal, whitegrid, darkgrid, ticks
uvx --from git+https://github.com/mr901/mcp-plots.git mcp-plots \
--chart-width 1920 \
--chart-height 1080 \
--chart-dpi 300
max_data_points to limit large datasetsIssue: Charts not rendering in Cursor
output_format="mermaid" (default)Issue: uvx command not found
curl -LsSf https://astral.sh/uv/install.sh | shIssue: Port already in use
--port 8001Issue: Large datasets slow
--max-data-pointsuvx --from git+https://github.com/mr901/mcp-plots.git mcp-plots \
--debug \
--log-level DEBUG
config_overridescom.mcparmory/google-sheets
domdomegg/google-sheets-mcp
henilcalagiya/google-sheets-mcp
cct15/war-dashboard-data
moooonad/mcp-google-sheets-full
io.github.br0ski777/csv-to-json