MCPcopy Index your code
hub / github.com/VisActor/vchart-mcp-server

github.com/VisActor/vchart-mcp-server @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
30 symbols 98 edges 36 files 11 documented · 37%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

VisActor Logo VisActor Logo

vchart-mcp-server

一个基于 @visactor/vchart 的 Model Context Protocol (MCP) 服务器,支持 AI 助手生成交互式图表和可视化。

MCP Server npm 版本 npm 许可证 smithery badge

English | 简体中文

目录

功能特性

图表输出格式

每个图表都可以生成多种格式:

  • Image - PNG/JPG 图像格式,用于嵌入(默认值)
  • Spec - VChart 规范对象,用于编程使用
  • HTML - 交互式 HTML 图表,用于网页显示

所有图表都支持的公共参数

参数名 说明 类型/可选值 默认值
output 输出格式 "spec" | "image" | "html" "image"
width 图表宽度 数值 500
height 图表高度 数值 500
title 图表标题 字符串 可选
subTitle 图表副标题 字符串 可选
titleOrient 标题位置 字符串 可选
chartTheme 图表主题 字符串 可选
background 背景色 字符串 可选
colors 色板配置 数组/字符串 可选

支持的图表类型和工具

generate_cartesian_chart

用于生成直角坐标系图表,包含面积图、柱状图、折线图、水波图、漏斗图、动态条形图。

参数名 说明 类型 是否必需
dataTable 数据对象数组 数组 必需
chartType 图表类型 "line" | "area" | "bar" | "waterfall" | "funnel" | "ranking_bar" 必需
xField X 轴字段名 string 必需
yField Y 轴字段名 string 必需
colorField 颜色映射字段 string 可选
timeField 时间字段,用于给动态条形图设置时间字段 string 可选
stackOrPercent 堆叠或百分比模式 "stack" | "percent" 可选
transpose 设置柱状图是否按照水平方向展示,也就是条形图 boolean 可选
xAxisType X 轴类型 "band" | "linear" 可选
xAxisOrient X 轴位置 "top" | "bottom" 可选
xAxisTitle X 轴标题 string 可选
xAxisHasGrid X 轴是否显示网格线 boolean 可选
xAxisHasLabel X 轴是否显示标签 boolean 可选
xAxisHasTick X 轴是否显示刻度 boolean 可选
yAxisType Y 轴类型 "band" | "linear" 可选
yAxisOrient Y 轴位置 "left" | "right" 可选
yAxisTitle Y 轴标题 string 可选
yAxisHasGrid Y 轴是否显示网格线 boolean 可选
yAxisHasLabel Y 轴是否显示标签 boolean 可选
yAxisHasTick Y 轴是否显示刻度 boolean 可选

generate_polar_chart

用于生成极坐标系图表,包含雷达图和玫瑰图。 | 参数名 | 说明 | 类型/可选值 | 是否必需 | |---------------------|------------------------|-----------------------------------------------|----------| | dataTable | 数据对象数组 | 数组 | 必需 | | chartType | 图表类型 | "radar" | "rose" | "pie" | 必需 | | categoryField | 类别字段名 | string | 必需 | | valueField | 数值字段名 | string | 必需 | | colorField | 颜色映射字段 | string | 可选 | | angleAxisTitle | 角度轴标题 | string | 可选 | | angleAxisHasGrid | 角度轴是否显示网格线 | boolean | 可选 | | angleAxisHasLabel | 角度轴是否显示标签 | booean | 可选 | | angleAxisHasTick | 角度轴是否显示刻度 | boolean | 可选 | | angleAxisType | 角度轴类型 | "band" | "linear" | 可选 | | radiusAxisTitle | 半径轴标题 | string | 可选 | | radiusAxisHasGrid | 半径轴是否显示网格线 | boolean | 可选 | | radiusAxisHasLabel| 半径轴是否显示标签 | boolean | 可选 | | radiusAxisHasTick | 半径轴是否显示刻度 | boolean | 可选 | | radiusAxisType | 半径轴类型 | "band" | "linear" | 可选 |

generate_hierarchical_chart

用于生成分层结构图表,包含矩形树图、圆形闭包图、旭日图。

参数名 说明 类型/可选值 是否必需
dataTable 数据对象数组 数组 必需
chartType 图表类型 "sunburst" | "treemap" | "circle_packing" 必需
colorField 颜色映射字段 string 必需
valueField 数值映射字段 string 必需

generate_progress_chart

生成进度条图表,包括环形进度条和线性进度条、仪表盘图。

参数名 说明 类型/可选值 是否必需
dataTable 数据对象数组 数组 必需
chartType 图表类型 "linear_progress" | "circular_progress" | "gauge" | "liquid" 必需
valueField 进度值数据字段名 string 必需
colorField 颜色映射字段,对于水波图是可选配置,其他图表是必传的配置 string 可选

generate_wordcloud_venn

用于生成词云图表/韦恩图,适合展示文本数据的关键词和频率。

参数:

参数名 说明 类型/可选值 是否必需
dataTable 数据对象数组 数组 必需
chartType 图表类型 "wordcloud" | "venn" 必需
colorField 文本字段名或者韦恩图的集合字段名 string 必需
valueField 数值字段名,在韦恩图中必传 string 可选

generate_range_column_chart

生成横向的范围柱状图,适合展示数据范围和对比。

参数名 说明 TS 类型/可选值 是否必需
dataTable 数据对象数组 any[] 必需
xField 类别字段名 string 必需
yField 数值字段名 [string, string] 必需
colorField 颜色映射字段 string 可选
xAxisType X 轴类型 "band" | "linear" 可选
xAxisOrient X 轴位置 "top" | "bottom" 可选
xAxisTitle X 轴标题 string 可选
xAxisHasGrid X 轴是否显示网格线 boolean 可选
xAxisHasLabel X 轴是否显示标签 boolean 可选
xAxisHasTick X 轴是否显示刻度 boolean 可选
yAxisType Y 轴类型 "band" | "linear" 可选
yAxisOrient Y 轴位置 "left" | "right" 可选
yAxisTitle Y 轴标题 string 可选
yAxisHasGrid Y 轴是否显示网格线 boolean 可选
yAxisHasLabel Y 轴是否显示标签 boolean 可选
yAxisHasTick Y 轴是否显示刻度 boolean 可选

generate_dual_axis_chart

具有两个 Y 轴的组合图表,用于比较两个具有不同量纲的指标。

参数名 说明 TS 类型 是否必需
dataTable 数据对象数组 any[] 必需
xField X 轴字段名 string 必需
yField 两个 Y 轴字段名数组 [string, string] 必需
colorField 颜色映射字段 string 可选
stackOrPercent 堆叠或百分比模式 "stack" | "percent" 可选
xAxisOrient X 轴位置 "top" | "bottom" 可选
xAxisTitle X 轴标题 string 可选
xAxisHasGrid X 轴是否显示网格线 boolean 可选
xAxisHasLabel X 轴是否显示标签 boolean 可选
xAxisHasTick X 轴是否显示刻度 boolean 可选
leftYAxisTitle 左 Y 轴标题 string 可选
leftYAxisHasGrid 左 Y 轴是否显示网格线 boolean 可选
leftYAxisHasLabel 左 Y 轴是否显示标签 boolean 可选
leftYAxisHasTick 左 Y 轴是否显示刻度 boolean 可选
rightYAxisTitle 右 Y 轴标题 string 可选
rightYAxisHasGrid 右 Y 轴是否显示网格线 boolean 可选
rightYAxisHasLabel 右 Y 轴是否显示标签 boolean 可选
rightYAxisHasTick 右 Y 轴是否显示刻度 boolean 可选

generate_scatter_chart

用于展示两个变量之间的相关关系,适合发现数据中的模式和异常值。

参数名 说明 TS 类型 是否必需
dataTable 数据对象数组 any[] 必需
xField X 轴字段名 string 必需
yField Y 轴字段名 string 必需
colorField 颜色映射字段 string 可选
sizeField

Extension points exported contracts — how you extend this code

RequestHandlers (Interface)
(no doc)
src/utils/httpServer.ts

Core symbols most depended-on inside this repo

convertZodToJsonSchema
called by 16
src/utils/schema.ts
filterValidAttributes
called by 7
src/utils/generateChart.ts
createMCPServer
called by 2
src/server.ts
createBaseHttpServer
called by 2
src/utils/httpServer.ts
parseArgs
called by 1
src/index.ts
showHelp
called by 1
src/index.ts
main
called by 1
src/index.ts
gentrateChartImageOrHtml
called by 1
src/utils/generateChart.ts

Shape

Function 23
Method 4
Class 2
Interface 1

Languages

TypeScript100%

Modules by API surface

src/utils/httpServer.ts7 symbols
src/utils/InMemoryEventStore.ts6 symbols
src/utils/generateChart.ts3 symbols
src/services/streamable.ts3 symbols
src/services/sse.ts3 symbols
src/index.ts3 symbols
src/utils/schema.ts1 symbols
src/utils/getBody.ts1 symbols
src/utils/env.ts1 symbols
src/services/stdio.ts1 symbols
src/server.ts1 symbols

For agents

$ claude mcp add vchart-mcp-server \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact