FP

fervoyush/plotnine-mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

6 stars 3 forks 质量 74 趋势 14MIT

MCP server bringing ggplot2's grammar of graphics to Python via plotnine. Create publication-quality statistical visualizations through natural language with AI assisted IDEs like Claude-Code, Cursor...

概览

Create publication-quality statistical graphics through chat using plotnine's Python implementation of R's beloved ggplot2. This modular MCP server allows Claude and other AI assistants to generate highly customizable visualizations by composing layers through the grammar of graphics paradigm. - : Combine multiple geometries in a single plot (scatter + trend lines, boxplots + jitter, etc.) - : Compose plots using aesthetics, geometries, scales, themes, facets, and coordinates - : Points, lines, bars, histograms, boxplots, violins, and more - : Load data from files (CSV, JSON, Parquet, Excel), URLs, or inline JSON - : PNG, PDF, SVG with configurable dimensions and DPI - : Pre-configured templates for common patterns (time series, scatter with trend, distribution comparison, etc.

README

以下为原文 README 节选,完整内容请查看原文。

Plotnine MCP Server

A Model Context Protocol (MCP) server that brings ggplot2’s grammar of graphics to Python through plotnine, enabling AI-powered data visualization via natural language.

Create publication-quality statistical graphics through chat using plotnine’s Python implementation of R’s beloved ggplot2. This modular MCP server allows Claude and other AI assistants to generate highly customizable visualizations by composing layers through the grammar of graphics paradigm.

Features

Core Visualization

  • 🎨 Multi-Layer Plots: Combine multiple geometries in a single plot (scatter + trend lines, boxplots + jitter, etc.)
  • Grammar of Graphics: Compose plots using aesthetics, geometries, scales, themes, facets, and coordinates
  • 20+ Geometry Types: Points, lines, bars, histograms, boxplots, violins, and more
  • Multiple Data Sources: Load data from files (CSV, JSON, Parquet, Excel), URLs, or inline JSON
  • Multiple Output Formats: PNG, PDF, SVG with configurable dimensions and DPI

Smart Features (NEW!)

  • 📋 9 Plot Templates: Pre-configured templates for common patterns (time series, scatter with trend, distribution comparison, etc.)
  • 🤖 AI Template Suggestions: Analyzes your data and recommends appropriate plot types
  • 🎨 21 Color Palettes: Colorblind-safe, scientific, categorical, corporate, sequential, and diverging palettes
  • 📊 Data Preview: Inspect data before plotting with comprehensive summaries
  • 🎯 Smart Error Messages: Fuzzy matching suggests corrections for typos in column names, geom types, and themes
  • 💾 Config Export/Import: Save and reuse plot configurations as JSON files

Data Manipulation (NEW!)

  • 🔄 12 Data Transformations: filter, group_summarize, sort, select, rename, mutate, drop_na, fill_na, sample, unique, rolling, pivot
  • ⚡ Batch Processing: Create multiple plots in one operation
  • 🔗 Chained Transforms: Apply multiple transformations in sequence

Theming & Customization

  • Flexible Theming: Built-in themes with extensive customization options
  • Statistical Transformations: Add smoothing, binning, density estimation, and summaries
  • Faceting: Split plots by categorical variables using wrap or grid layouts

Installation

1. Clone or download this repository

cd plotnine-mcp

2. Install dependencies

Using pip:

pip install -e .

For full functionality (parquet and Excel support):

pip install -e ".[full]"

3. Configure Your MCP Client

Finding Your Installation Path

First, find where the plotnine-mcp command was installed:

which plotnine-mcp

This will show something like /path/to/python/bin/plotnine-mcp. Use this full path in the configurations below.

在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "plotnine": { "command": "/path/to/your/python/bin/plotnine-mcp", "args": [] } } }