这是一个使用 QuickChart.io 生成图表的 Model Context Protocol 服务器。
这是一个基于 TypeScript 的 MCP 服务器,提供了图表生成功能。它允许您通过 MCP 工具创建各种类型的图表。
该服务器集成了 QuickChart.io 基于 URL 的图表生成功能,使用 Chart.js 配置来创建图表图像。用户可以通过提供数据和样式参数来生成各种类型的图表,服务器会将这些参数转换为图表 URL 或可下载的图像。
generate_chart
- 使用 QuickChart.io 生成图表 URL
download_chart
- 将图表图像下载到本地文件
服务器使用 Chart.js 配置格式。以下是一个基本示例:
{
"type": "bar",
"data": {
"labels": ["January", "February", "March"],
"datasets": [{
"label": "Sales",
"data": [65, 59, 80],
"backgroundColor": "rgb(75, 192, 192)"
}]
},
"options": {
"title": {
"display": true,
"text": "Monthly Sales"
}
}
}

服务器将您的配置转换为 QuickChart URL:
https://quickchart.io/chart?c={...encoded configuration...}
安装依赖项:
npm install
构建服务器:
npm run build
npm install @gongrzhe/quickchart-mcp-server
通过 Smithery 自动安装适用于 Claude Desktop 的 QuickChart 服务器:
npx -y @smithery/cli install @gongrzhe/quickchart-mcp-server --client claude
要与 Claude Desktop 一起使用,请添加服务器配置:
在 MacOS 上:~/Library/Application Support/Claude/claude_desktop_config.json
在 Windows 上:%APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"quickchart-server": {
"command": "node",
"args": ["/path/to/quickchart-server/build/index.js"]
}
}
}

或
{
"mcpServers": {
"quickchart-server": {
"command": "npx",
"args": [
"-y",
"@gongrzhe/quickchart-mcp-server"
]
}
}
}

本项目采用 MIT 许可证。