mcp-vegalite-server

This repository provides a Model Context Protocol (MCP) server that enables LLMs to visualize data using Vega-Lite. It offers tools to save data and generate visualizations, returning either Vega-Lite specifications

55
8

Data Visualization MCP Server

Overview

This is a Model Context Protocol (MCP) server designed to enable Large Language Models (LLMs) to visualize data using Vega-Lite specifications. It provides an interface for data storage and visualization, enhancing LLM capabilities in data analysis and presentation.

Components

Tools

The server provides two main tools:

  • save_data:
    • Stores a table of aggregated data on the server for subsequent visualization.
    • Input: name (string) for the data table's name and data (array) representing the data table.
    • Returns: A success message upon completion.
  • visualize_data:
    • Visualizes a stored data table using a Vega-Lite specification.
    • Input: data_name (string) for the data table's name and vegalite_specification (string) containing the Vega-Lite JSON.
    • Returns: A success message with the complete Vega-Lite specification (including data) in the artifact key if --output_type is text. If --output_type is png, it returns a base64 encoded PNG image of the visualization using the MPC ImageContent container.

Usage with Claude Desktop

// Example configuration for claude_desktop_config.json
{
  "mcpServers": {
    "datavis": {
        "command": "uv",
        "args": [
            "--directory",
            "/absolute/path/to/mcp-datavis-server",
            "run",
            "mcp_server_datavis",
            "--output_type",
            "png" // or "text"
        ]
    }
  }
}

Repository

IS
isaacwasserman

isaacwasserman/mcp-vegalite-server

Created

December 12, 2024

Updated

March 27, 2025

Language

Python

Category

AI