MCP HubMCP Hub
isaacwasserman

mcp-vegalite-server

by: isaacwasserman

mcp vegalite server

52created 12/12/2024
Visit
vegalite
visualization

📌Overview

Purpose: To provide a Model Context Protocol (MCP) server that enables the visualization of data using Vega-Lite syntax for large language models (LLMs).

Overview: The Data Visualization MCP Server is designed to facilitate data management and visualization, allowing users to save data tables and generate visual representations in a straightforward manner using Vega-Lite specifications.

Key Features:

  • Data Saving Tool (save_data): This tool allows users to save data tables for later use in visualizations. It stores the data with a specific name and provides confirmation upon successful saving.

  • Data Visualization Tool (visualize_data): This feature enables the visualization of saved data tables based on Vega-Lite specifications. It can output the results in either a textual format containing the Vega-Lite specification or as a base64 encoded PNG image of the visualization, catering to different user needs.


Data Visualization MCP Server

Overview

A Model Context Protocol (MCP) server implementation that provides an interface for visualizing data using Vega-Lite syntax.

Components

Tools

The server offers two core tools:

  • save_data

    • Saves a table of data aggregations to the server for later visualization.
    • Input:
      • name (string): Name of the data table.
      • data (array): Array of objects representing the data table.
    • Returns: Success message.
  • visualize_data

    • Visualizes a table of data using Vega-Lite syntax.
    • Input:
      • data_name (string): Name of the data table to visualize.
      • vegalite_specification (string): JSON string representing the Vega-Lite specification.
    • Returns:
      • If --output_type is text, returns a success message with a complete Vega-Lite specification with data.
      • If --output_type is png, returns a base64 encoded PNG image of the visualization.

Usage with Claude Desktop

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