Save a table of data aggregations to the server for later visualization
Visualize a table of data using Vega-Lite syntax
The Vega-Lite Data Visualization MCP server provides a powerful interface for LLMs to create and display data visualizations. It allows models to save data tables and generate customized visualizations using the expressive Vega-Lite grammar, enabling rich data exploration and presentation capabilities. With this MCP, AI assistants can transform raw data into meaningful visual representations, supporting a wide range of chart types and customization options. The server can return either text-based specifications or rendered PNG images, making it versatile for different use cases and client applications.
To use the Vega-Lite Data Visualization MCP server, you'll need to add it to your Claude Desktop configuration or other compatible MCP client.
Add the following configuration to your claude_desktop_config.json
file:
{
"mcpServers": {
"datavis": {
"command": "uv",
"args": [
"--directory",
"/absolute/path/to/mcp-vegalite-server",
"run",
"mcp_server_vegalite",
"--output_type",
"png" // or "text" if you prefer text output
]
}
}
}
Replace /absolute/path/to/mcp-vegalite-server
with the actual path where you cloned the repository.
The server supports two output types:
text
: Returns the complete Vega-Lite specification with data as textpng
: Returns a base64-encoded PNG image of the visualization using the MPC ImageContent
containerThe Vega-Lite Data Visualization MCP provides a two-step workflow for creating visualizations:
save_data
toolvisualize_data
tool// Step 1: Save your data
save_data(
name: "sales_data",
data: [
{"month": "Jan", "sales": 100},
{"month": "Feb", "sales": 120},
{"month": "Mar", "sales": 90},
{"month": "Apr", "sales": 150}
]
)
// Step 2: Create a visualization
visualize_data(
data_name: "sales_data",
vegalite_specification: {
"mark": "bar",
"encoding": {
"x": {"field": "month", "type": "nominal"},
"y": {"field": "sales", "type": "quantitative"}
}
}
)
The vegalite_specification
parameter accepts standard Vega-Lite JSON specifications. You can create a wide variety of visualizations including:
For detailed information on Vega-Lite syntax and capabilities, refer to the Vega-Lite documentation.