Tool

LLM Data Visualization Integration Workflow

A page for connecting LLM workflows to structured data visualization outputs, shown as source code with no unsupported runtime claim.

LLM data visualization illustration with model node, structured table, Vega chart, and validation trace

This page links a public repository, Mavline/mcp-server-vegalite, for LLM-connected data visualization. It is a Python Model Context Protocol server that turns saved tabular data plus a Vega-Lite specification into a chart.

What the source code shows

The server keeps the data handoff explicit by exposing two tools. save_data stores a named table; visualize_data renders a Vega-Lite specification against that saved table:

# src/mcp_server_vegalite/server.py (sanitized excerpt)
types.Tool(
    name="save_data",
    description=SAVE_DATA_TOOL_DESCRIPTION,
    inputSchema={ ... },          # name + rows of JSON-like records
),
types.Tool(
    name="visualize_data",
    description=VISUALIZE_DATA_TOOL_DESCRIPTION,
    inputSchema={
        "data_name": "The name of the data table to visualize",
        # plus the Vega-Lite specification
    },
)

The repository also ships a visualizations/ directory with generated chart PNGs from earlier runs (for example order-status and work-centre distributions), which show that the save-then-visualize path produces real output.

How this maps to client work

The same contract supports AI-assisted reporting and LLM integration work: structured data is saved under a name, a chart specification is generated and rendered, and the output can be reviewed before it enters a business workflow. This page shows source code, not a hosted production analytics product; a guided walkthrough can be arranged on request.

Problem

Teams want AI-assisted analytics interfaces that can turn questions and structured data into reliable visual outputs without hiding the data contract.

Context

The public repository Mavline/mcp-server-vegalite is an LLM-connected data visualization workflow using Vega-Lite. The README documents a Model Context Protocol server that exposes two tools: one saves a named table of records, the other renders a Vega-Lite specification against that saved data and returns a chart spec or PNG. This page links that public repository directly, not as a separate MCP commercial service and not as a measured production result.

Inputs

Technical approach

The repository implements an MCP server in Python that makes the data handoff explicit. The save_data tool stores a named dataset; the visualize_data tool takes a Vega-Lite specification, attaches the saved data, renders it with vl-convert, and returns either the chart specification or a PNG. A stdio transport serves local MCP clients, and an SSE/FastAPI path exists for integration experiments. The reusable pattern is the contract between prompt, saved structured data, generated chart specification, and reviewable output.

Stack

What was built

An MCP server with two tools, save_data and visualize_data, that turn saved tabular data plus a Vega-Lite specification into reviewable chart output (spec or PNG). The public repository also ships a visualizations/ directory containing generated chart outputs from earlier runs, which show what the save-then-visualize path produces.

Deployment

No hosted demo. The repository ships source and a local run path (uv sync, uv run mcp_server_vegalite).

What can be reused

Boundaries

Related

Make a request to build