Skip to content
Open
Show file tree
Hide file tree
Changes from 4 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).
12 changes: 10 additions & 2 deletions __tests__/charts/district-map.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,22 @@
"type": "object",
"properties": {
"name": {
"$ref": "#/properties/data/properties/name"
"type": "string",
"description": "Keywords for the Chinese name of an administrative region (must be within China), and must be one of China, province, city, district, or county. The name should be more specific and add attributive descriptions, for example, \"西安市\" is better than \"西安\", \"杭州西湖区\" is better than \"西湖区\". It cannot be a specific place name or a vague name, such as \"其它\"."
},
"dataValue": {
"type": "string",
"description": "Data value, numeric string or enumeration string."
},
"style": {
"$ref": "#/properties/data/properties/style"
"type": "object",
"properties": {
"fillColor": {
"type": "string",
"description": "Fill color, rgb or rgba format."
}
},
"description": "Style settings."
}
},
"required": ["name"]
Expand Down
60 changes: 32 additions & 28 deletions __tests__/charts/fishbone-diagram.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,54 +14,58 @@
"children": {
"type": "array",
"items": {
"properties": {
"name": {
"type": "string"
},
"children": {
"type": "array",
"items": {
"$ref": "#/properties/data/properties/children/items"
}
}
},
"required": ["name"],
"type": "object"
"$ref": "#/definitions/__schema0"
}
}
},
"required": ["name"],
"description": "Data for fishbone diagram chart, such as, { name: 'main topic', children: [{ name: 'topic 1', children: [{ name: 'subtopic 1-1' }] }."
"required": ["name"]
},
"style": {
"description": "Custom style configuration for the chart.",
"type": "object",
"properties": {
"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"
"default": "default",
"type": "string",
"enum": ["default", "rough"]
}
},
"type": "object"
}
},
"theme": {
"default": "default",
"description": "Set the theme for the chart, optional, default is 'default'.",
"enum": ["default", "academy", "dark"],
"type": "string"
"default": "default",
"type": "string",
"enum": ["default", "academy", "dark"]
},
"width": {
"type": "number",
"description": "Set the width of chart, default is 600.",
"default": 600
"default": 600,
"type": "number"
},
"height": {
"type": "number",
"description": "Set the height of chart, default is 400.",
"default": 400
"default": 400,
"type": "number"
}
},
"required": ["data"]
"required": ["data"],
"definitions": {
"__schema0": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"children": {
"type": "array",
"items": {
"$ref": "#/definitions/__schema0"
}
}
},
"required": ["name"]
}
}
}
}
3 changes: 0 additions & 3 deletions __tests__/charts/histogram.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@
{
"type": "number"
},
{
"not": {}
},
{
"type": "null"
}
Expand Down
66 changes: 35 additions & 31 deletions __tests__/charts/mind-map.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,54 +14,58 @@
"children": {
"type": "array",
"items": {
"properties": {
"children": {
"items": {
"$ref": "#/properties/data/properties/children/items"
},
"type": "array"
},
"name": {
"type": "string"
}
},
"required": ["name"],
"type": "object"
"$ref": "#/definitions/__schema0"
}
}
},
"required": ["name"],
"description": "Data for mind map chart, such as, { name: 'main topic', children: [{ name: 'topic 1', children: [{ name:'subtopic 1-1' }] }."
},
"theme": {
"default": "default",
"description": "Set the theme for the chart, optional, default is 'default'.",
"enum": ["default", "academy", "dark"],
"type": "string"
"required": ["name"]
},
"style": {
"description": "Custom style configuration for the chart.",
"type": "object",
"properties": {
"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"
"default": "default",
"type": "string",
"enum": ["default", "rough"]
}
},
"type": "object"
}
},
"theme": {
"description": "Set the theme for the chart, optional, default is 'default'.",
"default": "default",
"type": "string",
"enum": ["default", "academy", "dark"]
},
"width": {
"type": "number",
"description": "Set the width of chart, default is 600.",
"default": 600
"default": 600,
"type": "number"
},
"height": {
"type": "number",
"description": "Set the height of chart, default is 400.",
"default": 400
"default": 400,
"type": "number"
}
},
"required": ["data"]
"required": ["data"],
"definitions": {
"__schema0": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"children": {
"type": "array",
"items": {
"$ref": "#/definitions/__schema0"
}
}
},
"required": ["name"]
}
}
}
}
92 changes: 43 additions & 49 deletions __tests__/charts/organization-chart.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,78 +2,72 @@
"name": "generate_organization_chart",
"description": "Generate an organization chart to visualize the hierarchical structure of an organization, such as, a diagram showing the relationship between a CEO and their direct reports.",
"inputSchema": {
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"data": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"children": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"children": {
"type": "array",
"items": {
"$ref": "#/properties/data/properties/children/items"
}
}
},
"required": ["name"]
}
"description": "Data for organization chart, such as, { name: 'CEO', description: 'Chief Executive Officer', children: [{ name: 'CTO', description: 'Chief Technology Officer', children: [{ name: 'Dev Manager', description: 'Development Manager' }] }] }.",
"allOf": [
{
"$ref": "#/definitions/__schema0"
}
},
"required": ["name"],
"description": "Data for organization chart, such as, { name: 'CEO', description: 'Chief Executive Officer', children: [{ name: 'CTO', description: 'Chief Technology Officer', children: [{ name: 'Dev Manager', description: 'Development Manager' }] }] }."
]
},
"orient": {
"type": "string",
"enum": ["horizontal", "vertical"],
"description": "Orientation of the organization chart, either horizontal or vertical. Default is vertical, when the level of the chart is more than 3, it is recommended to use horizontal orientation.",
"default": "vertical",
"description": "Orientation of the organization chart, either horizontal or vertical. Default is vertical, when the level of the chart is more than 3, it is recommended to use horizontal orientation."
},
"theme": {
"type": "string",
"enum": ["default", "academy", "dark"],
"default": "default",
"description": "Set the theme for the chart, optional, default is 'default'."
"enum": ["horizontal", "vertical"]
},
"style": {
"description": "Custom style configuration for the chart.",
"type": "object",
"properties": {
"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"
"default": "default",
"type": "string",
"enum": ["default", "rough"]
}
},
"type": "object"
}
},
"theme": {
"description": "Set the theme for the chart, optional, default is 'default'.",
"default": "default",
"type": "string",
"enum": ["default", "academy", "dark"]
},
"width": {
"type": "number",
"description": "Set the width of chart, default is 600.",
"default": 600,
"description": "Set the width of chart, default is 600."
"type": "number"
},
"height": {
"type": "number",
"description": "Set the height of chart, default is 400.",
"default": 400,
"description": "Set the height of chart, default is 400."
"type": "number"
}
},
"required": ["data"],
"$schema": "http://json-schema.org/draft-07/schema#"
"definitions": {
"__schema0": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"children": {
"type": "array",
"items": {
"$ref": "#/definitions/__schema0"
}
}
},
"required": ["name"]
}
}
}
}
Loading