plotting
MCP server that transforms CSV data into visualizations
claude mcp add --transport stdio stackloklabs-plotting-mcp uvx --from /path/to/plotting-mcp plotting-mcp --transport=stdio
How to use
The Plotting MCP Server ingests CSV data and returns visualizations as base64-encoded PNG images. It supports multiple plot types, including line charts, bar graphs, pie charts, and world maps with optional geospatial features powered by Cartopy. You provide CSV data along with a plot_type and a JSON configuration string (json_kwargs) to customize appearance such as colors, axes, and sizing. This makes it easy to generate charts within AI chat interfaces or other MCP-enabled workflows without leaving the conversation. The server returns the image in a format ready to embed directly into UIs or chat clients.
To use it, send the CSV data and specify the desired plot_type (line, bar, pie, worldmap). For world maps, the server can automatically detect latitude and longitude columns (lat/latitude/y and lon/longitude/x) and then apply styling parameters like size (s), color (c), transparency (alpha), and marker style. For line and bar charts you can map data columns to x, y, and hue to create expressive visualizations. Pie charts support single-column value counts or two-column label/value pairs. The output is a base64-encoded PNG suitable for embedding in LibreChat, Claude Desktop workflows, or other MCP consumers.
How to install
Prerequisites:
- Python 3.13+ and a compatible Python environment
- Optional: uv (uvx) for fast packaging and management
- Git to clone or pull repository
- Dependencies for plotting: matplotlib, seaborn, cartopy, and pandas
Installation steps:
-
Clone the repository: git clone https://github.com/stackloklabs/stackloklabs-plotting-mcp.git cd stackloklabs-plotting-mcp
-
Install dependencies via Makefile (preferred): make install
This should install Python deps and set up the MCP environment
-
Alternatively, install with uv if you’re not using the Makefile: uv sync
-
Run the MCP server (default port 9090): uv run plotting-mcp
-
Verify the server is running by sending a test MCP request or by hitting the configured transport endpoint. The server name for MCP usage is plotting-mcp as shown in the integration guide.
Additional notes
Tips and notes:
- World maps require Cartopy; ensure a writable filesystem if you plan to cache map data (e.g., when deploying via Kubernetes with persistent storage).
- Base64-encoded PNGs are ideal for chat interfaces and can be embedded directly in messages.
- The default server port is 9090; adjust as needed in your transport configuration.
- If using ToolHive or Kubernetes, ensure the plotting libraries have access to Proj data caches and fonts, which may affect rendering in some environments.
- For epistemic control over visuals, use json_kwargs to tune DPI, figure size (e.g., width and height), and style parameters compatible with Seaborn/Matplotlib.
- When integrating with AI assistants, consider streaming or chunking large images if there are transport constraints; the MCP response is a single base64 image per request.
- If you encounter issues with Cartopy installation, refer to system-level dependencies and ensure you have the necessary geospatial libraries installed on the host.
Related MCP Servers
web-eval-agent
An MCP server that autonomously evaluates web applications.
mcp-neo4j
Neo4j Labs Model Context Protocol servers
mcp
Baidu Map MCP Server
Gitingest
mcp server for gitingest
fhir
FHIR MCP Server – helping you expose any FHIR Server or API as a MCP Server.
unitree-go2
The Unitree Go2 MCP Server is a server built on the MCP that enables users to control the Unitree Go2 robot using natural language commands interpreted by a LLM.