Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,40 @@ Start the MCP server:
npm run start
```

### run mcp server

if you want test sse server or streamable server, you can use the following command:

```bash
npm run dev:sse
# or
npm run dev:streamable
```

and then change the transport type and url in the MCP Inspector configuration, such as:

SSE

```json
{
"transport": {
"type": "sse",
"url": "http://localhost:1122/sse"
}
}
```

streamable

```json
{
"transport": {
"type": "streamable",
"url": "http://localhost:1122/streamable"
}
}
```

## 📄 License

MIT@[AntV](https://github.com/antvis).
83 changes: 53 additions & 30 deletions __tests__/charts/area.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,30 @@
"name": "generate_area_chart",
"description": "Generate a area chart to show data trends under continuous independent variables and observe the overall data trend, such as, displacement = velocity (average or instantaneous) × time: s = v × t. If the x-axis is time (t) and the y-axis is velocity (v) at each moment, an area chart allows you to observe the trend of velocity over time and infer the distance traveled by the area's size.",
"inputSchema": {
"$schema": "http://json-schema.org/draft-07/schema#",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"data": {
"description": "Data for area chart, such as, [{ time: '2018', value: 99.9 }].",
"type": "array",
"minItems": 1,
"prefixItems": [
{
"type": "object",
"properties": {
"time": {
"type": "string"
},
"value": {
"type": "number"
},
"group": {
"type": "string"
}
},
"required": ["time", "value"],
"additionalProperties": false
}
],
"items": {
"type": "object",
"properties": {
Expand All @@ -21,70 +39,75 @@
"type": "string"
}
},
"required": ["time", "value"]
"required": ["time", "value"],
"additionalProperties": false
},
"description": "Data for area chart, such as, [{ time: '2018', value: 99.9 }]."
"minItems": 1
},
"stack": {
"type": "boolean",
"default": false,
"description": "Whether stacking is enabled. When enabled, area charts require a 'group' field in the data."
"description": "Whether stacking is enabled. When enabled, area charts require a 'group' field in the data.",
"type": "boolean"
},
"style": {
"description": "Custom style configuration for the chart.",
"type": "object",
"properties": {
"backgroundColor": {
"description": "Background color of the chart, such as, '#fff'.",
"type": "string"
},
"palette": {
"description": "Color palette for the chart, it is a collection of colors.",
"type": "array",
"items": {
"type": "string"
},
"type": "array"
}
},
"texture": {
"default": "default",
"description": "Set the texture for the chart, optional, default is 'default'. 'rough' refers to hand-drawn style.",
"enum": ["default", "rough"],
"type": "string"
"type": "string",
"enum": ["default", "rough"]
}
},
"type": "object"
"required": ["texture"],
"additionalProperties": false
},
"theme": {
"default": "default",
"description": "Set the theme for the chart, optional, default is 'default'.",
"enum": ["default", "academy", "dark"],
"type": "string"
"type": "string",
"enum": ["default", "academy", "dark"]
},
"width": {
"type": "number",
"description": "Set the width of chart, default is 600.",
"default": 600
"type": "number"
},
"height": {
"type": "number",
"description": "Set the height of chart, default is 400.",
"default": 400
"type": "number"
},
"title": {
"type": "string",
"default": "",
"description": "Set the title of chart."
"description": "Set the title of chart.",
"type": "string"
},
"axisXTitle": {
"type": "string",
"default": "",
"description": "Set the x-axis title of chart."
"description": "Set the x-axis title of chart.",
"type": "string"
},
"axisYTitle": {
"type": "string",
"default": "",
"description": "Set the y-axis title of chart."
"description": "Set the y-axis title of chart.",
"type": "string"
}
},
"required": ["data"]
"required": [
"data",
"stack",
"theme",
"width",
"height",
"title",
"axisXTitle",
"axisYTitle"
],
"additionalProperties": false
}
}
89 changes: 56 additions & 33 deletions __tests__/charts/bar.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,30 @@
"name": "generate_bar_chart",
"description": "Generate a horizontal bar chart to show data for numerical comparisons among different categories, such as, comparing categorical data and for horizontal comparisons.",
"inputSchema": {
"$schema": "http://json-schema.org/draft-07/schema#",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"data": {
"description": "Data for bar chart, such as, [{ category: '分类一', value: 10 }, { category: '分类二', value: 20 }], when grouping or stacking is needed for bar, the data should contain a `group` field, such as, when [{ category: '北京', value: 825, group: '油车' }, { category: '北京', value: 1000, group: '电车' }].",
"type": "array",
"minItems": 1,
"prefixItems": [
{
"type": "object",
"properties": {
"category": {
"type": "string"
},
"value": {
"type": "number"
},
"group": {
"type": "string"
}
},
"required": ["category", "value"],
"additionalProperties": false
}
],
"items": {
"type": "object",
"properties": {
Expand All @@ -21,75 +39,80 @@
"type": "string"
}
},
"required": ["category", "value"]
"required": ["category", "value"],
"additionalProperties": false
},
"description": "Data for bar chart, such as, [{ category: '分类一', value: 10 }, { category: '分类二', value: 20 }], when grouping or stacking is needed for bar, the data should contain a `group` field, such as, when [{ category: '北京', value: 825, group: '油车' }, { category: '北京', value: 1000, group: '电车' }]."
"minItems": 1
},
"group": {
"type": "boolean",
"default": false,
"description": "Whether grouping is enabled. When enabled, bar charts require a 'group' field in the data. When `group` is true, `stack` should be false."
"description": "Whether grouping is enabled. When enabled, bar charts require a 'group' field in the data. When `group` is true, `stack` should be false.",
"type": "boolean"
},
"stack": {
"type": "boolean",
"default": true,
"description": "Whether stacking is enabled. When enabled, bar charts require a 'group' field in the data. When `stack` is true, `group` should be false."
"description": "Whether stacking is enabled. When enabled, bar charts require a 'group' field in the data. When `stack` is true, `group` should be false.",
"type": "boolean"
},
"style": {
"description": "Custom style configuration for the chart.",
"type": "object",
"properties": {
"backgroundColor": {
"description": "Background color of the chart, such as, '#fff'.",
"type": "string"
},
"palette": {
"description": "Color palette for the chart, it is a collection of colors.",
"type": "array",
"items": {
"type": "string"
},
"type": "array"
}
},
"texture": {
"default": "default",
"description": "Set the texture for the chart, optional, default is 'default'. 'rough' refers to hand-drawn style.",
"enum": ["default", "rough"],
"type": "string"
"type": "string",
"enum": ["default", "rough"]
}
},
"type": "object"
"required": ["texture"],
"additionalProperties": false
},
"theme": {
"default": "default",
"description": "Set the theme for the chart, optional, default is 'default'.",
"enum": ["default", "academy", "dark"],
"type": "string"
"type": "string",
"enum": ["default", "academy", "dark"]
},
"width": {
"type": "number",
"description": "Set the width of chart, default is 600.",
"default": 600
"type": "number"
},
"height": {
"type": "number",
"description": "Set the height of chart, default is 400.",
"default": 400
"type": "number"
},
"title": {
"type": "string",
"default": "",
"description": "Set the title of chart."
"description": "Set the title of chart.",
"type": "string"
},
"axisXTitle": {
"type": "string",
"default": "",
"description": "Set the x-axis title of chart."
"description": "Set the x-axis title of chart.",
"type": "string"
},
"axisYTitle": {
"type": "string",
"default": "",
"description": "Set the y-axis title of chart."
"description": "Set the y-axis title of chart.",
"type": "string"
}
},
"required": ["data"]
"required": [
"data",
"group",
"stack",
"theme",
"width",
"height",
"title",
"axisXTitle",
"axisYTitle"
],
"additionalProperties": false
}
}
Loading