@umengfe/mcp-server-chart 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -68,7 +68,7 @@ To use with `Desktop APP`, such as Claude, VSCode, [Cline](https://cline.bot/mcp
68
68
  "mcpServers": {
69
69
  "mcp-server-chart": {
70
70
  "command": "npx",
71
- "args": ["-y", "@antv/mcp-server-chart"]
71
+ "args": ["-y", "@umengfe/mcp-server-chart"]
72
72
  }
73
73
  }
74
74
  }
@@ -81,7 +81,7 @@ On Window system:
81
81
  "mcpServers": {
82
82
  "mcp-server-chart": {
83
83
  "command": "cmd",
84
- "args": ["/c", "npx", "-y", "@antv/mcp-server-chart"]
84
+ "args": ["/c", "npx", "-y", "@umengfe/mcp-server-chart"]
85
85
  }
86
86
  }
87
87
  }
@@ -96,7 +96,7 @@ Also, you can use it on [aliyun](https://bailian.console.aliyun.com/?tab=mcp#/mc
96
96
  Install the package globally.
97
97
 
98
98
  ```bash
99
- npm install -g @antv/mcp-server-chart
99
+ npm install -g @umengfe/mcp-server-chart
100
100
  ```
101
101
 
102
102
  Run the server with your preferred transport option:
@@ -167,7 +167,7 @@ Options:
167
167
  "mcpServers": {
168
168
  "mcp-server-chart": {
169
169
  "command": "npx",
170
- "args": ["-y", "@antv/mcp-server-chart"],
170
+ "args": ["-y", "@umengfe/mcp-server-chart"],
171
171
  "env": {
172
172
  "VIS_REQUEST_SERVER": "<YOUR_VIS_REQUEST_SERVER>"
173
173
  }
@@ -203,7 +203,7 @@ Next, you need to add the `SERVICE_ID` environment variable to the MCP server co
203
203
  "mcpServers": {
204
204
  "AntV Map": {
205
205
  "command": "npx",
206
- "args": ["-y", "@antv/mcp-server-chart"],
206
+ "args": ["-y", "@umengfe/mcp-server-chart"],
207
207
  "env": {
208
208
  "SERVICE_ID": "***********************************"
209
209
  }
@@ -225,7 +225,7 @@ You can disable specific chart generation tools using the `DISABLED_TOOLS` envir
225
225
  "mcpServers": {
226
226
  "mcp-server-chart": {
227
227
  "command": "npx",
228
- "args": ["-y", "@antv/mcp-server-chart"],
228
+ "args": ["-y", "@umengfe/mcp-server-chart"],
229
229
  "env": {
230
230
  "DISABLED_TOOLS": "generate_fishbone_diagram,generate_mind_map"
231
231
  }
@@ -0,0 +1,47 @@
1
+ import { z } from "zod";
2
+ export declare const heatmap: {
3
+ schema: {
4
+ data: z.ZodArray<z.ZodObject<{
5
+ x: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
6
+ y: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
7
+ value: z.ZodNumber;
8
+ }, "strip", z.ZodTypeAny, {
9
+ value: number;
10
+ x: string | number;
11
+ y: string | number;
12
+ }, {
13
+ value: number;
14
+ x: string | number;
15
+ y: string | number;
16
+ }>, "atleastone">;
17
+ style: z.ZodOptional<z.ZodObject<{
18
+ backgroundColor: z.ZodOptional<z.ZodString>;
19
+ palette: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
20
+ texture: z.ZodDefault<z.ZodOptional<z.ZodEnum<["default", "rough"]>>>;
21
+ }, "strip", z.ZodTypeAny, {
22
+ texture: "default" | "rough";
23
+ backgroundColor?: string | undefined;
24
+ palette?: string[] | undefined;
25
+ }, {
26
+ backgroundColor?: string | undefined;
27
+ palette?: string[] | undefined;
28
+ texture?: "default" | "rough" | undefined;
29
+ }>>;
30
+ theme: z.ZodDefault<z.ZodOptional<z.ZodEnum<["default", "academy", "dark"]>>>;
31
+ width: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
32
+ height: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
33
+ title: z.ZodDefault<z.ZodOptional<z.ZodString>>;
34
+ axisXTitle: z.ZodDefault<z.ZodOptional<z.ZodString>>;
35
+ axisYTitle: z.ZodDefault<z.ZodOptional<z.ZodString>>;
36
+ };
37
+ tool: {
38
+ name: string;
39
+ description: string;
40
+ inputSchema: import("zod-to-json-schema").JsonSchema7Type & {
41
+ $schema?: string | undefined;
42
+ definitions?: {
43
+ [key: string]: import("zod-to-json-schema").JsonSchema7Type;
44
+ } | undefined;
45
+ };
46
+ };
47
+ };
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.heatmap = void 0;
4
+ const zod_1 = require("zod");
5
+ const utils_1 = require("../utils/index.js");
6
+ const base_1 = require("./base.js");
7
+ // Heatmap chart data schema
8
+ const data = zod_1.z.object({
9
+ x: zod_1.z.union([zod_1.z.number(), zod_1.z.string()]).describe("X coordinate or category"),
10
+ y: zod_1.z.union([zod_1.z.number(), zod_1.z.string()]).describe("Y coordinate or category"),
11
+ value: zod_1.z.number().describe("Value for the heatmap cell"),
12
+ });
13
+ // Heatmap chart input schema
14
+ const schema = {
15
+ data: zod_1.z
16
+ .array(data)
17
+ .describe("Data for heatmap chart, such as, [{ x: 1, y: 1, value: 10 }, { x: 1, y: 2, value: 20 }].")
18
+ .nonempty({ message: "Heatmap chart data cannot be empty." }),
19
+ style: zod_1.z
20
+ .object({
21
+ backgroundColor: base_1.BackgroundColorSchema,
22
+ palette: base_1.PaletteSchema,
23
+ texture: base_1.TextureSchema,
24
+ })
25
+ .optional()
26
+ .describe("Style configuration for the chart with a JSON object, optional."),
27
+ theme: base_1.ThemeSchema,
28
+ width: base_1.WidthSchema,
29
+ height: base_1.HeightSchema,
30
+ title: base_1.TitleSchema,
31
+ axisXTitle: base_1.AxisXTitleSchema,
32
+ axisYTitle: base_1.AxisYTitleSchema,
33
+ };
34
+ // Heatmap chart tool descriptor
35
+ const tool = {
36
+ name: "generate_heatmap_chart",
37
+ description: "Generate a heatmap chart to visualize data through variations in coloring within a matrix. Suitable for showing patterns, correlations, or intensity in 2-dimensional data.",
38
+ inputSchema: (0, utils_1.zodToJsonSchema)(schema),
39
+ };
40
+ exports.heatmap = {
41
+ schema,
42
+ tool,
43
+ };
@@ -0,0 +1,28 @@
1
+ import { z } from "zod";
2
+ import { type TreeDataType } from "../utils/validator";
3
+ export declare const IndentedTreeNodeSchema: z.ZodType<TreeDataType>;
4
+ export declare const indentedTree: {
5
+ schema: {
6
+ data: z.ZodEffects<z.ZodType<TreeDataType, z.ZodTypeDef, TreeDataType>, TreeDataType, TreeDataType>;
7
+ style: z.ZodOptional<z.ZodObject<{
8
+ texture: z.ZodDefault<z.ZodOptional<z.ZodEnum<["default", "rough"]>>>;
9
+ }, "strip", z.ZodTypeAny, {
10
+ texture: "default" | "rough";
11
+ }, {
12
+ texture?: "default" | "rough" | undefined;
13
+ }>>;
14
+ theme: z.ZodDefault<z.ZodOptional<z.ZodEnum<["default", "academy", "dark"]>>>;
15
+ width: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
16
+ height: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
17
+ };
18
+ tool: {
19
+ name: string;
20
+ description: string;
21
+ inputSchema: import("zod-to-json-schema").JsonSchema7Type & {
22
+ $schema?: string | undefined;
23
+ definitions?: {
24
+ [key: string]: import("zod-to-json-schema").JsonSchema7Type;
25
+ } | undefined;
26
+ };
27
+ };
28
+ };
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.indentedTree = exports.IndentedTreeNodeSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const utils_1 = require("../utils/index.js");
6
+ const validator_1 = require("../utils/validator.js");
7
+ const base_1 = require("./base.js");
8
+ // Indented tree node schema
9
+ // The recursive schema is not supported by gemini, and other clients, so we use a non-recursive schema which can represent a tree structure with a fixed depth.
10
+ // Ref: https://github.com/antvis/mcp-server-chart/issues/155
11
+ // Ref: https://github.com/antvis/mcp-server-chart/issues/132
12
+ exports.IndentedTreeNodeSchema = zod_1.z.object({
13
+ name: zod_1.z.string(),
14
+ children: zod_1.z
15
+ .array(zod_1.z.object({
16
+ name: zod_1.z.string(),
17
+ children: zod_1.z
18
+ .array(zod_1.z.object({
19
+ name: zod_1.z.string(),
20
+ children: zod_1.z
21
+ .array(zod_1.z.object({
22
+ name: zod_1.z.string(),
23
+ }))
24
+ .optional(),
25
+ }))
26
+ .optional(),
27
+ }))
28
+ .optional(),
29
+ });
30
+ // Indented tree chart input schema
31
+ const schema = {
32
+ data: exports.IndentedTreeNodeSchema.describe("Data for indented tree chart which is a hierarchical structure, such as, { name: 'main topic', children: [{ name: 'topic 1', children: [{ name: 'subtopic 1-1' }] }] }, and the maximum depth is 3.").refine(validator_1.validatedTreeDataSchema, {
33
+ message: "Invalid parameters: node name is not unique.",
34
+ path: ["data"],
35
+ }),
36
+ style: zod_1.z
37
+ .object({
38
+ texture: base_1.TextureSchema,
39
+ })
40
+ .optional()
41
+ .describe("Style configuration for the chart with a JSON object, optional."),
42
+ theme: base_1.ThemeSchema,
43
+ width: base_1.WidthSchema,
44
+ height: base_1.HeightSchema,
45
+ };
46
+ // Indented tree chart tool descriptor
47
+ const tool = {
48
+ name: "generate_indented_tree",
49
+ description: "Generate an indented tree chart to display hierarchical data in an indented outline format, suitable for showing organizational structures, file directories, or any tree-like data where nesting levels are represented by indentation.",
50
+ inputSchema: (0, utils_1.zodToJsonSchema)(schema),
51
+ };
52
+ exports.indentedTree = {
53
+ schema,
54
+ tool,
55
+ };
@@ -11,7 +11,9 @@ export { fishboneDiagram as "fishbone-diagram" } from "./fishbone-diagram";
11
11
  export { flowDiagram as "flow-diagram" } from "./flow-diagram";
12
12
  export { funnel } from "./funnel";
13
13
  export { histogram } from "./histogram";
14
+ export { indentedTree as "indented-tree" } from "./indented-tree";
14
15
  export { line } from "./line";
16
+ export { heatmap } from "./heatmap";
15
17
  export { liquid } from "./liquid";
16
18
  export { mindMap as "mind-map" } from "./mind-map";
17
19
  export { networkGraph as "network-graph" } from "./network-graph";
@@ -22,6 +24,7 @@ export { pinMap as "pin-map" } from "./pin-map";
22
24
  export { radar } from "./radar";
23
25
  export { sankey } from "./sankey";
24
26
  export { scatter } from "./scatter";
27
+ export { table } from "./table";
25
28
  export { treemap } from "./treemap";
26
29
  export { venn } from "./venn";
27
30
  export { violin } from "./violin";
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports["word-cloud"] = exports.violin = exports.venn = exports.treemap = exports.scatter = exports.sankey = exports.radar = exports["pin-map"] = exports.pie = exports["path-map"] = exports["organization-chart"] = exports["network-graph"] = exports["mind-map"] = exports.liquid = exports.line = exports.histogram = exports.funnel = exports["flow-diagram"] = exports["fishbone-diagram"] = exports["dual-axes"] = exports["district-map"] = exports.column = exports.boxplot = exports.bar = exports.area = void 0;
3
+ exports["word-cloud"] = exports.violin = exports.venn = exports.treemap = exports.table = exports.scatter = exports.sankey = exports.radar = exports["pin-map"] = exports.pie = exports["path-map"] = exports["organization-chart"] = exports["network-graph"] = exports["mind-map"] = exports.liquid = exports.heatmap = exports.line = exports["indented-tree"] = exports.histogram = exports.funnel = exports["flow-diagram"] = exports["fishbone-diagram"] = exports["dual-axes"] = exports["district-map"] = exports.column = exports.boxplot = exports.bar = exports.area = void 0;
4
4
  /**
5
5
  * export all charts as named exports to match the chart type
6
6
  */
@@ -24,8 +24,12 @@ var funnel_1 = require("./funnel.js");
24
24
  Object.defineProperty(exports, "funnel", { enumerable: true, get: function () { return funnel_1.funnel; } });
25
25
  var histogram_1 = require("./histogram.js");
26
26
  Object.defineProperty(exports, "histogram", { enumerable: true, get: function () { return histogram_1.histogram; } });
27
+ var indented_tree_1 = require("./indented-tree.js");
28
+ Object.defineProperty(exports, "indented-tree", { enumerable: true, get: function () { return indented_tree_1.indentedTree; } });
27
29
  var line_1 = require("./line.js");
28
30
  Object.defineProperty(exports, "line", { enumerable: true, get: function () { return line_1.line; } });
31
+ var heatmap_1 = require("./heatmap.js");
32
+ Object.defineProperty(exports, "heatmap", { enumerable: true, get: function () { return heatmap_1.heatmap; } });
29
33
  var liquid_1 = require("./liquid.js");
30
34
  Object.defineProperty(exports, "liquid", { enumerable: true, get: function () { return liquid_1.liquid; } });
31
35
  var mind_map_1 = require("./mind-map.js");
@@ -46,6 +50,8 @@ var sankey_1 = require("./sankey.js");
46
50
  Object.defineProperty(exports, "sankey", { enumerable: true, get: function () { return sankey_1.sankey; } });
47
51
  var scatter_1 = require("./scatter.js");
48
52
  Object.defineProperty(exports, "scatter", { enumerable: true, get: function () { return scatter_1.scatter; } });
53
+ var table_1 = require("./table.js");
54
+ Object.defineProperty(exports, "table", { enumerable: true, get: function () { return table_1.table; } });
49
55
  var treemap_1 = require("./treemap.js");
50
56
  Object.defineProperty(exports, "treemap", { enumerable: true, get: function () { return treemap_1.treemap; } });
51
57
  var venn_1 = require("./venn.js");
@@ -0,0 +1,33 @@
1
+ import { z } from "zod";
2
+ export declare const table: {
3
+ schema: {
4
+ data: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodAny>, "atleastone">;
5
+ style: z.ZodOptional<z.ZodObject<{
6
+ backgroundColor: z.ZodOptional<z.ZodString>;
7
+ palette: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
8
+ texture: z.ZodDefault<z.ZodOptional<z.ZodEnum<["default", "rough"]>>>;
9
+ }, "strip", z.ZodTypeAny, {
10
+ texture: "default" | "rough";
11
+ backgroundColor?: string | undefined;
12
+ palette?: string[] | undefined;
13
+ }, {
14
+ backgroundColor?: string | undefined;
15
+ palette?: string[] | undefined;
16
+ texture?: "default" | "rough" | undefined;
17
+ }>>;
18
+ theme: z.ZodDefault<z.ZodOptional<z.ZodEnum<["default", "academy", "dark"]>>>;
19
+ width: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
20
+ height: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
21
+ title: z.ZodDefault<z.ZodOptional<z.ZodString>>;
22
+ };
23
+ tool: {
24
+ name: string;
25
+ description: string;
26
+ inputSchema: import("zod-to-json-schema").JsonSchema7Type & {
27
+ $schema?: string | undefined;
28
+ definitions?: {
29
+ [key: string]: import("zod-to-json-schema").JsonSchema7Type;
30
+ } | undefined;
31
+ };
32
+ };
33
+ };
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.table = void 0;
4
+ const zod_1 = require("zod");
5
+ const utils_1 = require("../utils/index.js");
6
+ const base_1 = require("./base.js");
7
+ // Table chart data item schema - allows any string keys with any values
8
+ const dataItem = zod_1.z.record(zod_1.z.string(), zod_1.z.any());
9
+ // Table chart input schema
10
+ const schema = {
11
+ data: zod_1.z
12
+ .array(dataItem)
13
+ .describe("Data for table chart, such as, [{ \"Name\": \"胡彦斌\", \"Age\": 32, \"Address\": \"西湖区湖底公园1号\" }, { \"Name\": \"吴彦祖\", \"Age\": 42, \"Address\": \"西湖区湖底公园1号\" }]. Each item in the array represents a row, and the keys of each item represent the column names.")
14
+ .nonempty({ message: "Table chart data cannot be empty." }),
15
+ style: zod_1.z
16
+ .object({
17
+ backgroundColor: base_1.BackgroundColorSchema,
18
+ palette: base_1.PaletteSchema,
19
+ texture: base_1.TextureSchema,
20
+ })
21
+ .optional()
22
+ .describe("Style configuration for the chart with a JSON object, optional."),
23
+ theme: base_1.ThemeSchema,
24
+ width: base_1.WidthSchema,
25
+ height: base_1.HeightSchema,
26
+ title: base_1.TitleSchema,
27
+ };
28
+ // Table chart tool descriptor
29
+ const tool = {
30
+ name: "generate_table",
31
+ description: "Generate a table chart to display structured data in rows and columns, suitable for presenting detailed information and precise values.",
32
+ inputSchema: (0, utils_1.zodToJsonSchema)(schema),
33
+ };
34
+ exports.table = {
35
+ schema,
36
+ tool,
37
+ };
package/build/server.js CHANGED
@@ -59,7 +59,7 @@ const logger_1 = require("./utils/logger.js");
59
59
  function createServer() {
60
60
  const server = new index_js_1.Server({
61
61
  name: "umeng-mcp-server-chart",
62
- version: "0.0.2",
62
+ version: "0.0.3",
63
63
  description: "本工具返回内容为 Markdown 格式,建议客户端按 Markdown 渲染",
64
64
  }, {
65
65
  capabilities: {
@@ -12,7 +12,7 @@ export declare function callTool(tool: string, args?: object): Promise<{
12
12
  _meta: {
13
13
  description: string;
14
14
  spec: {
15
- type: "area" | "bar" | "boxplot" | "column" | "district-map" | "dual-axes" | "fishbone-diagram" | "flow-diagram" | "funnel" | "histogram" | "line" | "liquid" | "mind-map" | "network-graph" | "organization-chart" | "path-map" | "pie" | "pin-map" | "radar" | "sankey" | "scatter" | "treemap" | "venn" | "violin" | "word-cloud";
15
+ type: "area" | "bar" | "boxplot" | "column" | "district-map" | "dual-axes" | "fishbone-diagram" | "flow-diagram" | "funnel" | "histogram" | "line" | "liquid" | "mind-map" | "network-graph" | "organization-chart" | "path-map" | "pie" | "pin-map" | "radar" | "sankey" | "scatter" | "treemap" | "venn" | "violin" | "word-cloud" | "table" | "indented-tree" | "heatmap";
16
16
  };
17
17
  };
18
18
  }>;
@@ -50,31 +50,34 @@ const logger_1 = require("./logger.js");
50
50
  const validator_1 = require("./validator.js");
51
51
  // Chart type mapping
52
52
  const CHART_TYPE_MAP = {
53
- generate_area_chart: "area",
54
- generate_bar_chart: "bar",
55
- generate_boxplot_chart: "boxplot",
56
- generate_column_chart: "column",
53
+ generate_area_chart: "area", //✅
54
+ generate_bar_chart: "bar", //✅
55
+ generate_boxplot_chart: "boxplot", //✅
56
+ generate_column_chart: "column", //✅
57
57
  generate_district_map: "district-map",
58
- generate_dual_axes_chart: "dual-axes",
59
- generate_fishbone_diagram: "fishbone-diagram",
60
- generate_flow_diagram: "flow-diagram",
61
- generate_funnel_chart: "funnel",
62
- generate_histogram_chart: "histogram",
63
- generate_line_chart: "line",
64
- generate_liquid_chart: "liquid",
65
- generate_mind_map: "mind-map",
66
- generate_network_graph: "network-graph",
67
- generate_organization_chart: "organization-chart",
68
- generate_path_map: "path-map",
69
- generate_pie_chart: "pie",
70
- generate_pin_map: "pin-map",
71
- generate_radar_chart: "radar",
72
- generate_sankey_chart: "sankey",
73
- generate_scatter_chart: "scatter",
74
- generate_treemap_chart: "treemap",
75
- generate_venn_chart: "venn",
76
- generate_violin_chart: "violin",
77
- generate_word_cloud_chart: "word-cloud",
58
+ generate_dual_axes_chart: "dual-axes", //✅
59
+ generate_fishbone_diagram: "fishbone-diagram", //✅
60
+ generate_flow_diagram: "flow-diagram", //✅
61
+ generate_funnel_chart: "funnel", //✅
62
+ generate_histogram_chart: "histogram", //✅
63
+ generate_line_chart: "line", //✅
64
+ generate_liquid_chart: "liquid", //✅
65
+ generate_mind_map: "mind-map", //✅
66
+ generate_network_graph: "network-graph", //✅
67
+ generate_organization_chart: "organization-chart", //✅
68
+ generate_path_map: "path-map", //✅
69
+ generate_pie_chart: "pie", //✅
70
+ generate_pin_map: "pin-map", //✅
71
+ generate_radar_chart: "radar", //✅
72
+ generate_sankey_chart: "sankey", //✅
73
+ generate_scatter_chart: "scatter", //✅
74
+ generate_treemap_chart: "treemap", //✅
75
+ generate_venn_chart: "venn", //✅
76
+ generate_violin_chart: "violin", //✅
77
+ generate_word_cloud_chart: "word-cloud", //✅
78
+ generate_table: "table", //✅
79
+ generate_indented_tree: "indented-tree", //✅
80
+ generate_heatmap: "heatmap", //✅
78
81
  };
79
82
  /**
80
83
  * Call a tool to generate a chart based on the provided name and arguments.
@@ -106,7 +109,7 @@ function callTool(tool_1) {
106
109
  content: [
107
110
  {
108
111
  type: "text",
109
- text: `'\`\`\`vis-chart\n${JSON.stringify(Object.assign({ type: chartType }, args))}\n\`\`\`'`,
112
+ text: `\`\`\`vis-chart\n${JSON.stringify(Object.assign({ type: chartType }, args))}\n\`\`\``,
110
113
  },
111
114
  ],
112
115
  _meta: {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@umengfe/mcp-server-chart",
3
3
  "description": "A Model Context Protocol server for generating charts using AntV. This is a TypeScript-based MCP server that provides chart generation capabilities. It allows you to create various types of charts through MCP tools.",
4
- "version": "0.0.2",
4
+ "version": "0.0.3",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
7
7
  "exports": {