|
| 1 | + |
| 2 | +> 注:当前项目为 Serverless Devs 应用,由于应用中会存在需要初始化才可运行的变量(例如应用部署地区、函数名等等),所以**不推荐**直接 Clone 本仓库到本地进行部署或直接复制 s.yaml 使用,**强烈推荐**通过 `s init ${模版名称}` 的方法或应用中心进行初始化,详情可参考[部署 & 体验](#部署--体验) 。 |
| 3 | +
|
| 4 | +# start-mcp-quickchart 帮助文档 |
| 5 | + |
| 6 | +<description> |
| 7 | + |
| 8 | +quickchart-server MCP Server |
| 9 | + |
| 10 | +</description> |
| 11 | + |
| 12 | + |
| 13 | +## 资源准备 |
| 14 | + |
| 15 | +使用该项目,您需要有开通以下服务并拥有对应权限: |
| 16 | + |
| 17 | +<service> |
| 18 | + |
| 19 | + |
| 20 | + |
| 21 | +| 服务/业务 | 权限 | 相关文档 | |
| 22 | +| --- | --- | --- | |
| 23 | +| 函数计算 | AliyunFCFullAccess | [帮助文档](https://help.aliyun.com/product/2508973.html) [计费文档](https://help.aliyun.com/document_detail/2512928.html) | |
| 24 | + |
| 25 | +</service> |
| 26 | + |
| 27 | +<remark> |
| 28 | + |
| 29 | + |
| 30 | + |
| 31 | +</remark> |
| 32 | + |
| 33 | +<disclaimers> |
| 34 | + |
| 35 | + |
| 36 | + |
| 37 | +</disclaimers> |
| 38 | + |
| 39 | +## 部署 & 体验 |
| 40 | + |
| 41 | +<appcenter> |
| 42 | + |
| 43 | +- :fire: 通过 [云原生应用开发平台 CAP](https://cap.console.aliyun.com/template-detail?template=start-mcp-quickchart) ,[](https://cap.console.aliyun.com/template-detail?template=start-mcp-quickchart) 该应用。 |
| 44 | + |
| 45 | +</appcenter> |
| 46 | +<deploy> |
| 47 | + |
| 48 | + |
| 49 | +</deploy> |
| 50 | + |
| 51 | +## 案例介绍 |
| 52 | + |
| 53 | +<appdetail id="flushContent"> |
| 54 | + |
| 55 | +# quickchart-server MCP Server |
| 56 | + |
| 57 | +A Model Context Protocol server for generating charts using QuickChart.io |
| 58 | + |
| 59 | +This is a TypeScript-based MCP server that provides chart generation capabilities. It allows you to create various types of charts through MCP tools. |
| 60 | + |
| 61 | +## Overview |
| 62 | + |
| 63 | +This server integrates with QuickChart.io's URL-based chart generation service to create chart images using Chart.js configurations. Users can generate various types of charts by providing data and styling parameters, which the server converts into chart URLs or downloadable images. |
| 64 | + |
| 65 | +## Features |
| 66 | + |
| 67 | +### Tools |
| 68 | +- `generate_chart` - Generate a chart URL using QuickChart.io |
| 69 | + - Supports multiple chart types: bar, line, pie, doughnut, radar, polarArea, scatter, bubble, radialGauge, speedometer |
| 70 | + - Customizable with labels, datasets, colors, and additional options |
| 71 | + - Returns a URL to the generated chart |
| 72 | + |
| 73 | +- `download_chart` - Download a chart image to a local file |
| 74 | + - Takes chart configuration and output path as parameters |
| 75 | + - Saves the chart image to the specified location |
| 76 | + |
| 77 | + |
| 78 | + |
| 79 | + |
| 80 | + |
| 81 | +## Supported Chart Types |
| 82 | +- Bar charts: For comparing values across categories |
| 83 | +- Line charts: For showing trends over time |
| 84 | +- Pie charts: For displaying proportional data |
| 85 | +- Doughnut charts: Similar to pie charts with a hollow center |
| 86 | +- Radar charts: For showing multivariate data |
| 87 | +- Polar Area charts: For displaying proportional data with fixed-angle segments |
| 88 | +- Scatter plots: For showing data point distributions |
| 89 | +- Bubble charts: For three-dimensional data visualization |
| 90 | +- Radial Gauge: For displaying single values within a range |
| 91 | +- Speedometer: For speedometer-style value display |
| 92 | + |
| 93 | +## Usage |
| 94 | + |
| 95 | +### Chart Configuration |
| 96 | +The server uses Chart.js configuration format. Here's a basic example: |
| 97 | + |
| 98 | +```javascript |
| 99 | +{ |
| 100 | + "type": "bar", |
| 101 | + "data": { |
| 102 | + "labels": ["January", "February", "March"], |
| 103 | + "datasets": [{ |
| 104 | + "label": "Sales", |
| 105 | + "data": [65, 59, 80], |
| 106 | + "backgroundColor": "rgb(75, 192, 192)" |
| 107 | + }] |
| 108 | + }, |
| 109 | + "options": { |
| 110 | + "title": { |
| 111 | + "display": true, |
| 112 | + "text": "Monthly Sales" |
| 113 | + } |
| 114 | + } |
| 115 | +} |
| 116 | +``` |
| 117 | + |
| 118 | +### URL Generation |
| 119 | +The server converts your configuration into a QuickChart URL: |
| 120 | +``` |
| 121 | +https://quickchart.io/chart?c={...encoded configuration...} |
| 122 | +``` |
| 123 | + |
| 124 | +## Development |
| 125 | + |
| 126 | +Install dependencies: |
| 127 | +```bash |
| 128 | +npm install |
| 129 | +``` |
| 130 | + |
| 131 | +Build the server: |
| 132 | +```bash |
| 133 | +npm run build |
| 134 | +``` |
| 135 | + |
| 136 | +## Installation |
| 137 | + |
| 138 | +### Installing |
| 139 | + |
| 140 | + ```bash |
| 141 | + npm install @gongrzhe/quickchart-mcp-server |
| 142 | + ``` |
| 143 | + |
| 144 | +### Installing via Smithery |
| 145 | + |
| 146 | + To install QuickChart Server for Claude Desktop automatically via [Smithery](https://smithery.ai/server/@GongRzhe/Quickchart-MCP-Server): |
| 147 | + |
| 148 | + ```bash |
| 149 | + npx -y @smithery/cli install @gongrzhe/quickchart-mcp-server --client claude |
| 150 | + ``` |
| 151 | + |
| 152 | +To use with Claude Desktop, add the server config: |
| 153 | + |
| 154 | +On MacOS: `~/Library/Application Support/Claude/claude_desktop_config.json` |
| 155 | +On Windows: `%APPDATA%/Claude/claude_desktop_config.json` |
| 156 | + |
| 157 | +```json |
| 158 | +{ |
| 159 | + "mcpServers": { |
| 160 | + "quickchart-server": { |
| 161 | + "command": "node", |
| 162 | + "args": ["/path/to/quickchart-server/build/index.js"] |
| 163 | + } |
| 164 | + } |
| 165 | +} |
| 166 | +``` |
| 167 | + |
| 168 | +or |
| 169 | + |
| 170 | +```json |
| 171 | +{ |
| 172 | + "mcpServers": { |
| 173 | + "quickchart-server": { |
| 174 | + "command": "npx", |
| 175 | + "args": [ |
| 176 | + "-y", |
| 177 | + "@gongrzhe/quickchart-mcp-server" |
| 178 | + ] |
| 179 | + } |
| 180 | + } |
| 181 | +} |
| 182 | +``` |
| 183 | + |
| 184 | + |
| 185 | +## Documentation References |
| 186 | +- [QuickChart Documentation](https://quickchart.io/documentation/) |
| 187 | +- [Chart Types Reference](https://quickchart.io/documentation/chart-types/) |
| 188 | + |
| 189 | +## 📜 License |
| 190 | + |
| 191 | +This project is licensed under the MIT License. |
| 192 | + |
| 193 | +</appdetail> |
| 194 | + |
| 195 | + |
| 196 | + |
| 197 | + |
| 198 | + |
| 199 | + |
| 200 | + |
| 201 | +## 使用流程 |
| 202 | + |
| 203 | +<usedetail id="flushContent"> |
| 204 | + |
| 205 | +部署完成拿到 URL 后,准备好支持 SSE 的 MCP Client,通过 SSETransport 进行连接。 |
| 206 | + |
| 207 | +</usedetail> |
| 208 | + |
| 209 | + |
| 210 | + |
| 211 | + |
| 212 | + |
| 213 | + |
| 214 | + |
| 215 | + |
| 216 | + |
0 commit comments