LLM Data Visualization Integration Workflow
A source-backed proof page for connecting LLM workflows to structured data visualization outputs, shown as repository-code proof with no unsupported runtime claim.
This proof page links a verified public repository, Mavline/mcp-server-vegalite, as repository-code proof 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 serve as technical-trace evidence 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 is a code and trace boundary, not a hosted production analytics product; a guided walkthrough can be arranged on request.
Proof assets and links
- repo-code-proof: public repository Mavline/mcp-server-vegalite, README documents the save_data and visualize_data tools and the Python stack
- repo-code-proof: src/mcp_server_vegalite/server.py registers the save_data and visualize_data MCP tools with input schemas
- technical-trace-proof: the repository visualizations/ directory contains generated Vega-Lite PNG outputs from prior runs
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 source is the public repository Mavline/mcp-server-vegalite, described as 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 as an integration proof boundary, not as a separate MCP commercial service and not as a measured production result.
Inputs
- A named table of JSON-like records saved by the save_data tool
- A Vega-Lite specification supplied to the visualize_data tool
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
- Python 3.10+
- Model Context Protocol Python SDK
- FastAPI and uvicorn (SSE path)
- Vega-Lite via vl-convert-python
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 act as technical-trace evidence of the workflow.
Deployment
Repository-code proof only. The repository ships source and a local run path (uv sync, uv run mcp_server_vegalite); no hosted demo URL is claimed.
What can be reused
- Explicit save-data then visualize-data contract
- Vega-Lite specification rendered to spec or PNG via vl-convert
- Reviewable generated chart artifacts before they enter a workflow
Boundaries
- Repository-code proof, not a deployed dashboard claim
- MCP is treated as an integration layer, not a client-facing service category
- No private data or unsupported runtime trace is exposed