这是一个模型上下文协议(MCP)服务器实现,为大型语言模型(LLM)提供了使用Vega-Lite语法进行数据可视化的接口。
该服务器提供两个核心工具:
save_data
name
(字符串):要保存的数据表的名称data
(数组):表示数据表的数组对象visualize_data
data_name
(字符串):要可视化的数据表的名称vegalite_specification
(字符串):表示Vega-Lite规范的JSON字符串--output_type
设置为text
,则返回带有附加artifact
键的成功消息,该键包含带有数据的完整Vega-Lite规范。如果--output_type
设置为png
,则使用MPC ImageContent
容器返回可视化的base64编码PNG图像。# 将服务器添加到您的claude_desktop_config.json
{
"mcpServers": {
"datavis": {
"command": "uv",
"args": [
"--directory",
"/absolute/path/to/mcp-datavis-server",
"run",
"mcp_server_datavis",
"--output_type",
"png" # 或 "text"
]
}
}
}
