@iflow-mcp/kamranbiglari-mcp-server-chart 1.0.0 → 1.0.2

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/bin/run.sh ADDED
@@ -0,0 +1,2 @@
1
+ #!/bin/bash
2
+ node "$(dirname "$0")/../dist/stdio-server.js" "$@"
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import('./dist/stdio-server.js');
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name": "@iflow-mcp/kamranbiglari-mcp-server-chart", "version": "1.0.0", "type": "module", "scripts": {"deploy": "wrangler deploy", "dev": "wrangler dev", "format": "biome format --write", "lint:fix": "biome lint --fix", "start": "wrangler dev", "cf-typegen": "wrangler types", "type-check": "tsc --noEmit"}, "bin": {"iflow-mcp-kamranbiglari-mcp-server-chart": "./dist/stdio-server.js"}, "dependencies": {"@modelcontextprotocol/sdk": "^1.13.0", "agents": "^0.0.95", "zod": "^3.25.67", "zod-to-json-schema": "^3.24.6"}, "devDependencies": {"@biomejs/biome": "^2.0.4", "@types/node": "^25.2.1", "typescript": "^5.8.3", "wrangler": "^4.20.5"}}
1
+ {"name":"@iflow-mcp/kamranbiglari-mcp-server-chart","version":"1.0.2","type":"module","scripts":{"deploy":"wrangler deploy","dev":"wrangler dev","format":"biome format --write","lint:fix":"biome lint --fix","start":"wrangler dev","cf-typegen":"wrangler types","type-check":"tsc --noEmit"},"bin":{"iflow-mcp-kamranbiglari-mcp-server-chart":"./bin/run.sh"},"dependencies":{"@modelcontextprotocol/sdk":"^1.13.0","agents":"^0.0.95","zod":"^3.25.67","zod-to-json-schema":"^3.24.6"},"devDependencies":{"@biomejs/biome":"^2.0.4","@types/node":"^25.2.1","typescript":"^5.8.3","wrangler":"^4.20.5"}}
@@ -0,0 +1 @@
1
+ {"serverConfig": "{\"mcpServers\":{\"chart-server\":{\"command\":\"npx\",\"args\":[\"-y\",\"@iflow-mcp/kamranbiglari-mcp-server-chart\"],\"values\":{}}}}"}
@@ -1,43 +0,0 @@
1
- import { z } from "zod";
2
- import { zodToJsonSchema } from "../utils/index.js";
3
- // Define the schema for the bar chart
4
- // {
5
- // type: 'bar',
6
- // data: {
7
- // labels: ['January', 'February', 'March', 'April', 'May'],
8
- // datasets: [
9
- // { label: 'Dogs', data: [50, 60, 70, 180, 190] },
10
- // { label: 'Cats', data: [100, 200, 300, 400, 500] },
11
- // ],
12
- // },
13
- // }
14
- const schema = {
15
- type: z.literal("bar").default("bar"),
16
- data: z.object({
17
- labels: z.array(z.string()).describe("Labels for the x-axis"),
18
- datasets: z.array(z.object({
19
- label: z.string().describe("Label for the dataset"),
20
- data: z.array(z.number()).describe("Data points for the dataset"),
21
- })),
22
- }),
23
- };
24
- const tool = {
25
- name: "bar",
26
- description: `Generates a bar chart with the provided data.
27
- example input:
28
- \`\`\`json
29
- {
30
- "labels": ["January", "February", "March", "April", "May"],
31
- "datasets": [
32
- { "label": "Dogs", "data": [50, 60, 70, 180, 190] },
33
- { "label": "Cats", "data": [100, 200, 300, 400, 500] }
34
- ]
35
- }
36
- \`\`\`
37
- `,
38
- inputSchema: zodToJsonSchema(schema),
39
- };
40
- export const bar = {
41
- schema,
42
- tool,
43
- };
@@ -1,71 +0,0 @@
1
- import { z } from "zod";
2
- import { zodToJsonSchema } from "../utils/index.js";
3
- // Define the schema for the bubble chart
4
- // {
5
- // type: 'bubble',
6
- // data: {
7
- // datasets: [
8
- // {
9
- // label: 'Data 1',
10
- // data: [
11
- // { x: 1, y: 4, r: 9 },
12
- // { x: 2, y: 4, r: 6 },
13
- // { x: 3, y: 8, r: 30 },
14
- // { x: 0, y: 10, r: 1 },
15
- // { x: 10, y: 5, r: 5 },
16
- // ],
17
- // },
18
- // ],
19
- // },
20
- // }
21
- const bubbleDataPointSchema = z.object({
22
- x: z.number(),
23
- y: z.number(),
24
- r: z.number().describe("Radius of the bubble"),
25
- });
26
- const schema = {
27
- type: z.literal("bubble").default("bubble"),
28
- data: z.object({
29
- datasets: z.array(z.object({
30
- label: z.string().describe("Label for the dataset"),
31
- data: z.array(bubbleDataPointSchema).describe("Array of {x, y, r} bubble points"),
32
- backgroundColor: z.string().optional().describe("Background color of the bubbles"),
33
- borderColor: z.string().optional().describe("Border color of the bubbles"),
34
- borderWidth: z.number().optional().describe("Width of the bubble borders"),
35
- hoverBackgroundColor: z.string().optional().describe("Background color when hovering"),
36
- hoverBorderColor: z.string().optional().describe("Border color when hovering"),
37
- hoverBorderWidth: z.number().optional().describe("Border width when hovering"),
38
- hoverRadius: z.number().optional().describe("Radius when hovering"),
39
- })),
40
- }),
41
- };
42
- const tool = {
43
- name: "bubble",
44
- description: `Generates a bubble chart with the provided data points.
45
- example input:
46
- \`\`\`json
47
- {
48
- "type": "bubble",
49
- "data": {
50
- "datasets": [
51
- {
52
- "label": "Data 1",
53
- "data": [
54
- {"x": 1, "y": 4, "r": 9},
55
- {"x": 2, "y": 4, "r": 6},
56
- {"x": 3, "y": 8, "r": 30},
57
- {"x": 0, "y": 10, "r": 1},
58
- {"x": 10, "y": 5, "r": 5}
59
- ]
60
- }
61
- ]
62
- }
63
- }
64
- \`\`\`
65
- `,
66
- inputSchema: zodToJsonSchema(schema),
67
- };
68
- export const bubble = {
69
- schema,
70
- tool,
71
- };
@@ -1,104 +0,0 @@
1
- import { z } from "zod";
2
- import { zodToJsonSchema } from "../utils/index.js";
3
- // Define the schema for the doughnut chart
4
- // {
5
- // type: 'doughnut',
6
- // data: {
7
- // labels: ['January', 'February', 'March', 'April', 'May'],
8
- // datasets: [{ data: [50, 60, 70, 180, 190] }],
9
- // },
10
- // options: {
11
- // plugins: {
12
- // doughnutlabel: {
13
- // labels: [{ text: '550', font: { size: 20 } }, { text: 'total' }],
14
- // },
15
- // },
16
- // },
17
- // }
18
- const fontSchema = z.object({
19
- size: z.number().optional(),
20
- weight: z.string().optional(),
21
- });
22
- const doughnutLabelItemSchema = z.object({
23
- text: z.string(),
24
- font: fontSchema.optional(),
25
- color: z.string().optional(),
26
- });
27
- const datalabelsSchema = z.object({
28
- color: z.string().optional(),
29
- anchor: z.string().optional(),
30
- align: z.string().optional(),
31
- formatter: z.function().optional(),
32
- font: fontSchema.optional(),
33
- });
34
- const pluginsSchema = z.object({
35
- doughnutlabel: z.object({
36
- labels: z.array(doughnutLabelItemSchema).optional(),
37
- }).optional(),
38
- datalabels: datalabelsSchema.optional(),
39
- });
40
- const layoutSchema = z.object({
41
- padding: z.number().optional(),
42
- });
43
- const legendSchema = z.object({
44
- display: z.boolean().optional(),
45
- });
46
- const optionsSchema = z.object({
47
- circumference: z.number().optional(),
48
- rotation: z.number().optional(),
49
- cutoutPercentage: z.number().optional(),
50
- layout: layoutSchema.optional(),
51
- legend: legendSchema.optional(),
52
- plugins: pluginsSchema.optional(),
53
- });
54
- const schema = {
55
- type: z.literal("doughnut").default("doughnut"),
56
- data: z.object({
57
- labels: z.array(z.string()).describe("Labels for each doughnut slice"),
58
- datasets: z.array(z.object({
59
- data: z.array(z.number()).describe("Data values for each slice"),
60
- label: z.string().optional().describe("Label for the dataset"),
61
- backgroundColor: z.union([z.string(), z.array(z.string())]).optional().describe("Background colors for slices"),
62
- borderColor: z.union([z.string(), z.array(z.string())]).optional().describe("Border colors for slices"),
63
- borderWidth: z.number().optional().describe("Width of the slice borders"),
64
- hoverBackgroundColor: z.array(z.string()).optional().describe("Background colors when hovering"),
65
- hoverBorderColor: z.array(z.string()).optional().describe("Border colors when hovering"),
66
- hoverBorderWidth: z.number().optional().describe("Border width when hovering"),
67
- })),
68
- }),
69
- options: optionsSchema.optional(),
70
- };
71
- const tool = {
72
- name: "doughnut",
73
- description: `Generates a doughnut chart with the provided data.
74
- example input:
75
- \`\`\`json
76
- {
77
- "type": "doughnut",
78
- "data": {
79
- "labels": ["January", "February", "March", "April", "May"],
80
- "datasets": [
81
- {
82
- "data": [50, 60, 70, 180, 190]
83
- }
84
- ]
85
- },
86
- "options": {
87
- "plugins": {
88
- "doughnutlabel": {
89
- "labels": [
90
- {"text": "550", "font": {"size": 20}},
91
- {"text": "total"}
92
- ]
93
- }
94
- }
95
- }
96
- }
97
- \`\`\`
98
- `,
99
- inputSchema: zodToJsonSchema(schema),
100
- };
101
- export const doughnut = {
102
- schema,
103
- tool,
104
- };
@@ -1,84 +0,0 @@
1
- import { z } from "zod";
2
- import { zodToJsonSchema } from "../utils/index.js";
3
- // Define the schema for the gauge chart
4
- // {
5
- // type: 'gauge',
6
- // data: {
7
- // datasets: [
8
- // {
9
- // value: 50,
10
- // data: [20, 40, 60],
11
- // backgroundColor: ['green', 'orange', 'red'],
12
- // borderWidth: 2,
13
- // },
14
- // ],
15
- // },
16
- // options: {
17
- // valueLabel: {
18
- // fontSize: 22,
19
- // backgroundColor: 'transparent',
20
- // color: '#000',
21
- // formatter: function (value, context) {
22
- // return value + ' mph';
23
- // },
24
- // bottomMarginPercentage: 10,
25
- // },
26
- // },
27
- // }
28
- const valueLabelSchema = z.object({
29
- fontSize: z.number().optional(),
30
- backgroundColor: z.string().optional(),
31
- color: z.string().optional(),
32
- formatter: z.function().optional(),
33
- bottomMarginPercentage: z.number().optional(),
34
- });
35
- const optionsSchema = z.object({
36
- valueLabel: valueLabelSchema.optional(),
37
- });
38
- const schema = {
39
- type: z.literal("gauge").default("gauge"),
40
- data: z.object({
41
- datasets: z.array(z.object({
42
- value: z.number().describe("Current value of the gauge"),
43
- data: z.array(z.number()).describe("Threshold values for different sections"),
44
- backgroundColor: z.array(z.string()).describe("Background colors for each section"),
45
- borderWidth: z.number().optional().describe("Width of the gauge border"),
46
- label: z.string().optional().describe("Label for the dataset"),
47
- })),
48
- }),
49
- options: optionsSchema.optional(),
50
- };
51
- const tool = {
52
- name: "gauge",
53
- description: `Generates a gauge chart with the provided value and thresholds.
54
- example input:
55
- \`\`\`json
56
- {
57
- "type": "gauge",
58
- "data": {
59
- "datasets": [
60
- {
61
- "value": 50,
62
- "data": [20, 40, 60],
63
- "backgroundColor": ["green", "orange", "red"],
64
- "borderWidth": 2
65
- }
66
- ]
67
- },
68
- "options": {
69
- "valueLabel": {
70
- "fontSize": 22,
71
- "backgroundColor": "transparent",
72
- "color": "#000",
73
- "bottomMarginPercentage": 10
74
- }
75
- }
76
- }
77
- \`\`\`
78
- `,
79
- inputSchema: zodToJsonSchema(schema),
80
- };
81
- export const gauge = {
82
- schema,
83
- tool,
84
- };
@@ -1,15 +0,0 @@
1
- export { bar } from "./bar.js";
2
- export { bubble } from "./bubble.js";
3
- export { doughnut } from "./doughnut.js";
4
- export { gauge } from "./gauge.js";
5
- export { line } from "./line.js";
6
- export { ohlc } from "./ohlc.js";
7
- export { pie } from "./pie.js";
8
- export { polarArea } from "./polarArea.js";
9
- export { progressBar } from "./progressBar.js";
10
- export { radar } from "./radar.js";
11
- export { radialGauge } from "./radialGauge.js";
12
- export { sankey } from "./sankey.js";
13
- export { scatter } from "./scatter.js";
14
- export { sparkline } from "./sparkline.js";
15
- export { violin } from "./violin.js";
@@ -1,74 +0,0 @@
1
- import { z } from "zod";
2
- import { zodToJsonSchema } from "../utils/index.js";
3
- // Define the schema for the line chart
4
- // {
5
- // type: 'line',
6
- // data: {
7
- // labels: ['January', 'February', 'March', 'April', 'May'],
8
- // datasets: [
9
- // {
10
- // label: 'Dogs',
11
- // data: [50, 60, 70, 180, 190],
12
- // fill: false,
13
- // borderColor: 'blue',
14
- // },
15
- // {
16
- // label: 'Cats',
17
- // data: [100, 200, 300, 400, 500],
18
- // fill: false,
19
- // borderColor: 'green',
20
- // },
21
- // ],
22
- // },
23
- // }
24
- const schema = {
25
- type: z.literal("line").default("line"),
26
- data: z.object({
27
- labels: z.array(z.string()).describe("Labels for the x-axis"),
28
- datasets: z.array(z.object({
29
- label: z.string().describe("Label for the dataset"),
30
- data: z.array(z.number()).describe("Data points for the dataset"),
31
- fill: z.boolean().optional().describe("Whether to fill the area under the line"),
32
- borderColor: z.string().optional().describe("Color of the line border"),
33
- backgroundColor: z.string().optional().describe("Background color of the line"),
34
- borderWidth: z.number().optional().describe("Width of the line border"),
35
- pointRadius: z.number().optional().describe("Radius of the data points"),
36
- pointBackgroundColor: z.string().optional().describe("Background color of the data points"),
37
- pointBorderColor: z.string().optional().describe("Border color of the data points"),
38
- tension: z.number().optional().describe("Bezier curve tension of the line"),
39
- })),
40
- }),
41
- };
42
- const tool = {
43
- name: "line",
44
- description: `Generates a line chart with the provided data.
45
- example input:
46
- \`\`\`json
47
- {
48
- "type": "line",
49
- "data": {
50
- "labels": ["January", "February", "March", "April", "May"],
51
- "datasets": [
52
- {
53
- "label": "Dogs",
54
- "data": [50, 60, 70, 180, 190],
55
- "fill": false,
56
- "borderColor": "blue"
57
- },
58
- {
59
- "label": "Cats",
60
- "data": [100, 200, 300, 400, 500],
61
- "fill": false,
62
- "borderColor": "green"
63
- }
64
- ]
65
- }
66
- }
67
- \`\`\`
68
- `,
69
- inputSchema: zodToJsonSchema(schema),
70
- };
71
- export const line = {
72
- schema,
73
- tool,
74
- };