All notable changes to the plotnine MCP server will be documented in this file.
All features below are in active development and will be released as v1.0.0.
-
preview_data: Inspect data before plotting
- Shows dataset shape, column types, first N rows
- Displays statistics for numeric columns
- Reports missing values
- Configurable number of preview rows
-
list_themes: List all available themes
- Shows all base themes with descriptions
- Lists customization options
- Includes example usage
-
export_plot_config: Save plot configurations to JSON
- Export any plot config for reuse
- Configurable output directory
- Auto-adds .json extension
-
import_plot_config: Load and use saved configurations
- Import previously saved configs
- Support for parameter overrides
- Maintains backward compatibility
-
Fuzzy Matching: Smart suggestions for typos
- Column name suggestions (e.g., "hieght" → "height")
- Geometry type suggestions (e.g., "scater" → "jitter")
- Theme name suggestions
-
Better Validation: Column existence check before plotting
- Validates all aesthetic column references
- Validates facet column references
- Early error detection with helpful messages
-
New Module:
error_utils.pysuggest_column_name(): Fuzzy match column namesformat_column_error(): Format helpful column errorssuggest_geom_type(): Fuzzy match geom typesformat_geom_error(): Format helpful geom errorssuggest_theme_name(): Fuzzy match themesformat_theme_error(): Format helpful theme errors
- Extracted
THEME_MAPas module-level constant inplot_builder.py - Added comprehensive column validation in
build_plot() - Improved error messages throughout the codebase
- New test suite:
test_new_features.py- 7 test cases covering all new features
- Tests for data preview, theme listing
- Tests for fuzzy matching and error messages
- Tests for config export/import
- All tests passing ✓
- Updated README.md with new tools documentation
- Added examples for using new tools
- Updated feature highlights
- Added usage examples in chat format
-
list_plot_templates: Browse 9 preset plot templates
- time_series, scatter_with_trend, distribution_comparison
- category_breakdown, correlation_heatmap, boxplot_comparison
- multi_line, histogram_with_density, before_after
-
create_plot_from_template: Use templates easily
- Just provide data and aesthetics
- Template handles geometry, theme, and scales
- Optional overrides for customization
-
suggest_plot_templates: AI-powered template recommendations
- Analyzes data characteristics (numeric/categorical/time columns)
- Optionally considers user goals
- Returns top 5 recommendations with reasoning
-
list_color_palettes: Browse 21 color palettes
- 6 categories: colorblind_safe, scientific, categorical, corporate, sequential, diverging
- Category filtering
- Preview colors in response
-
Templates module (
templates.py):- 9 pre-configured plot templates
- Template application with validation
- Smart suggestion algorithm
-
Palettes module (
palettes.py):- 21 carefully curated color palettes
- Scale configuration helpers
- Accessibility-focused options
-
batch_create_plots: Create multiple plots in one operation
- Process array of plot configurations
- Detailed summary of successes/failures
- Perfect for exploratory analysis
-
Data Transformations (integrated into
create_plot):- 12 transformation types via
transformsparameter - filter: Query-based filtering
- group_summarize: Group by and aggregate
- sort: Sort by columns
- select: Choose specific columns
- rename: Rename columns
- mutate: Create/modify columns with expressions
- drop_na: Remove missing values
- fill_na: Fill missing values
- sample: Random sampling
- unique: Remove duplicates
- rolling: Rolling window calculations
- pivot: Reshape data
- Chained transformations support
- 12 transformation types via
-
Transforms module (
transforms.py):- All transformation logic
- Pandas-based implementation
- Comprehensive error handling
Now 11 tools (was 2, added 9):
- create_plot (enhanced with transforms support)
- list_geom_types
- preview_data
- list_themes
- export_plot_config
- import_plot_config
- list_plot_templates (NEW - Phase 2)
- create_plot_from_template (NEW - Phase 2)
- suggest_plot_templates (NEW - Phase 2)
- list_color_palettes (NEW - Phase 2)
- batch_create_plots (NEW - Phase 3)
- Lines of code added: ~3500+
- New files: 6 (error_utils.py, templates.py, palettes.py, transforms.py, test_new_features.py, test_phase2_phase3.py)
- Tests added: 24 new test cases (7 Phase 1 + 17 Phase 2&3)
- All existing tests still passing (backward compatible)
- Total test coverage: 29 tests across 3 test suites
- Multi-layer plot support: Combine multiple geometries in single plot
geomsparameter (array) for multi-layer plots- Backward compatibility with
geomparameter - Documentation for multi-layer usage
- Test cases for multi-layer plots
- Enhanced plot_builder.py to handle multiple geoms
- Updated README with multi-layer examples
- MCP server implementation
- 20+ geometry types
- Multiple data sources (file, URL, inline)
- Full ggplot2 feature parity
- Comprehensive theming system
- Documentation and examples
- Basic test suite