Get the FREE Ultimate OpenClaw Setup Guide →

plotting

MCP server that transforms CSV data into visualizations

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
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:

  1. Clone the repository: git clone https://github.com/stackloklabs/stackloklabs-plotting-mcp.git cd stackloklabs-plotting-mcp

  2. Install dependencies via Makefile (preferred): make install

    This should install Python deps and set up the MCP environment

  3. Alternatively, install with uv if you’re not using the Makefile: uv sync

  4. Run the MCP server (default port 9090): uv run plotting-mcp

  5. 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

Sponsor this space

Reach thousands of developers