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