ChartQuery

com.chartquery由 chartquery.com 发布官方发布者v0.1.0更新于 Nov 7, 2026

Generate chart images, diagrams, barcodes, QR codes and thermal labels on demand. PNG, SVG or PDF o…

已验证Streamable HTTP可网页运行开发者工具媒体与设计

概览

AI 生成的概览

ChartQuery MCP 服务器,让助手通过 ChartQuery API 生成图表、示意图、条形码、二维码和热敏标签图片。

可以做什么
  • 渲染 Chart.js 图表、Mermaid/D2 示意图、条形码、样式化二维码和热敏标签预览,输出 PNG、SVG 或 PDF
  • 用 AI 工具根据自然语言描述生成图表和示意图
  • 按 ID 重新渲染或查看已保存的图表、示意图和标签,输出图片或可嵌入的 HTML 页面
  • 将标签编译为打印机指令,并转换、解析或校验 ZPL、EPL、TSC 等指令语言
  • 查询账户积分余额与用量,以及引擎健康统计
适用场景
适合助手需要产出可视化内容(图表、示意图、二维码、条形码或物流/商品标签)而本地没有渲染库时,或需要处理热敏打印机指令语言时使用。
运行要求
需要 ChartQuery API 密钥:托管端点通过 x-api-key 请求头传递,本地包通过环境变量 CHARTQUERY_API_KEY 设置。本地 npm 包需要 Node.js 20 或更高版本;托管端点 mcp.chartquery.com 无需安装。声明要求 OAuth 认证。
安装前请注意
每次调用 API 都会消耗付费积分(按工具不同每次 3 至 10 积分),会产生费用。API 密钥属于机密,应通过请求头或环境变量传入,不要外泄。部分渲染和查看工具为公开接口,无需密钥。stats 工具不限于你的账户范围。

安装

在 SourceWeft 中

  1. 打开 控制台中的 ChartQuery,将其添加到工作区。
  2. 连接 所需的 凭据。它们会被私密存储,绝不会在公开页面上展示。
  3. 为需要使用其工具的对话启用该服务。

Web executable,通过 Streamable HTTP。 远程服务在工作区中配置后即可从网页运行时运行。

交给智能体安装

把这段提示词粘贴到 Claude Code、Codex、Cursor 等智能体,或 SourceWeft 对话中。智能体会读取该服务器的安装指南,先向你展示发布者、端点和登录方式,经你同意后再把它添加到你的客户端。密钥不会写进任何命令。

阅读 https://sourceweft.com/mcp/com.chartquery%2Fmcp/install.md,并按其中说明把这个 MCP 服务器接入我的客户端。修改任何配置之前,先告诉我它的发布者、端点和登录方式,等我确认。不要把 API 密钥写进命令或我会提交的文件;问我密钥应从哪里获取。

查看智能体所依据的安装指南

其他 MCP 客户端

把它添加到你客户端的 mcpServers 配置中。 客户端会在首次连接时完成 OAuth 登录。

{
  "mcpServers": {
    "chartquery": {
      "type": "http",
      "url": "https://mcp.chartquery.com/"
    }
  }
}

README

ChartQuery MCP Server

Official Model Context Protocol server for the ChartQuery chart and QR code API.

Generate chart images, diagrams, barcodes, QR codes and thermal labels on demand. PNG, SVG or PDF output.

It lets Claude, Cursor, VS Code, Windsurf and any MCP client call the API as tools. Runs over stdio (local) or Streamable HTTP (self-hosted).

Requirements

  • Node.js 20 or newer
  • a ChartQuery API key — sign up, then copy it from the dashboard

Hosted server (recommended)

ChartQuery runs this server for you at https://mcp.chartquery.com/ (Streamable HTTP). Send your API key in the x-api-key header; nothing to install.

sh
claude mcp add --transport http chartquery https://mcp.chartquery.com/ --header "x-api-key: YOUR_API_KEY"
json
{  "mcpServers": {    "chartquery": {      "url": "https://mcp.chartquery.com/",      "headers": {        "x-api-key": "YOUR_API_KEY"      }    }  }}

The hosted server and this package expose the same API; run the package locally when you want stdio, your own network egress, or to self-host it.

Run it locally

Claude Code

sh
claude mcp add chartquery --env CHARTQUERY_API_KEY=YOUR_API_KEY -- npx -y @chartquery/mcp

Claude Desktop, Cursor, Windsurf and other clients

Add the server to the client's MCP configuration (claude_desktop_config.json, .cursor/mcp.json…):

json
{  "mcpServers": {    "chartquery": {      "command": "npx",      "args": ["-y", "@chartquery/mcp"],      "env": {        "CHARTQUERY_API_KEY": "YOUR_API_KEY"      }    }  }}

VS Code

json
{  "servers": {    "chartquery": {      "type": "stdio",      "command": "npx",      "args": ["-y", "@chartquery/mcp"],      "env": {        "CHARTQUERY_API_KEY": "${input:chartquery-api-key}"      }    }  },  "inputs": [    {      "type": "promptString",      "id": "chartquery-api-key",      "description": "ChartQuery API key",      "password": true    }  ]}

Claude Desktop extension

Download the .mcpb bundle from the releases page and open it; Claude Desktop asks for your API key.

Docker

sh
docker build -t chartquery-mcp .docker run -i --rm -e CHARTQUERY_API_KEY=YOUR_API_KEY chartquery-mcp

Tools

ToolDescription
barcodeGenerate a barcode image via GET. Output: SVG (default) or PNG. Supports 25+ formats: EAN-13, Code 128, ITF-14, GS1-128, postal codes and more.
chartRender a Chart.js image via GET. Pass the full chart object as URL-encoded JSON in query. Prefer format png for ChatGPT. POST sends the same object as a JSON body, not query.
chart_aiDescribe a chart in plain English via GET and get a rendered image back. Powered by AI.
chart_renderRender a previously saved chart by ID. Public, no API key required. Supports URL overrides for templates (?data1=, ?labels=, ?title=…).
chart_viewView a previously saved chart as an interactive HTML page. Public, no API key required. Iframe-embeddable.
diagramRender a diagram via GET. Use type (mermaid, d2, …), query (source code), and format=png for ChatGPT. POST uses diagram_type and diagram_source instead.
diagram_aiDescribe a diagram in plain English via GET and get a rendered image back. Powered by AI.
diagram_renderRender a previously saved diagram by ID. Public, no API key required. Supports ?format= and ?query= overrides.
diagram_viewView a previously saved diagram as an HTML page. Public, no API key required. Iframe-embeddable with inline SVG rendering.
labelPreview a thermal label via GET. Pass the same label object as a URL-encoded JSON string in query. Inside that JSON, text items use content and size (1-10), not text or fontSize. Prefer format=png fo…
label_compileCompile a label to printer commands (tsc, zpl, epl, …). POST width, language, and elements. Text uses content and size (1-10), not text or fontSize. No barcode element. Example: {"width":40,"height":…
label_convertConvert printer commands from one language to another. POST source, from, and to. from is the source language (tsc, zpl, epl, …). to is the target (tsc, zpl, escpos, …).
label_parseParse printer commands into structured elements. POST source and language (tsc, zpl, epl, …).
label_renderRender a previously saved label by ID. Public, no API key required. Supports ?format= override.
label_validateValidate printer commands. POST source (the raw commands) and language (tsc, zpl, epl, …).
label_viewView a previously saved label as an HTML page. Public, no API key required. Iframe-embeddable with inline SVG rendering.
qrcodeGenerate a styled QR code via GET. Output: SVG (default) or PNG. Supports dot styles, gradients, custom corners and all QR versions.
statsInfrastructure health for an engine or endpoint over the last hour. Not scoped to your account or tenant. Enabled per account: HTTP 403 means contact support to activate it.
usageReturn this account's Chartquery usage and credit balance. No body. Requires an API key.

Every tool that calls the API consumes credits. JSON results are returned as text; images are returned inline and other files (PDF…) as embedded resources, up to 4 MB.

Streamable HTTP

sh
npx @chartquery/mcp --http --port 3000

The endpoint is POST /mcp (stateless, JSON responses). Each client sends its own key in the x-api-key header (or Authorization: Bearer <key>); the server never uses a key of its own. It binds to 127.0.0.1 by default and rejects browser origins unless you allow them — put it behind TLS before exposing it.

createHttpHandler() is exported for Fetch-compatible runtimes (Cloudflare Workers, Deno, Bun):

ts
import { createHttpHandler } from "@chartquery/mcp";
export default { fetch: createHttpHandler({ allowedOrigins: [] }) };

Security

  • The API key is read from CHARTQUERY_API_KEY (stdio) or the request headers (HTTP) and removed from error messages.
  • Content fetched from websites is untrusted: the server instructions tell the model to treat it as data, not instructions.
  • See SECURITY.md to report a vulnerability.

Development

sh
npm installnpm testnpm run buildnpx @modelcontextprotocol/inspector node dist/stdio.js

Built on the SDK

The server uses the official Node.js SDK (@chartquery/sdk).

All ChartQuery SDKs

SDKPackageInstall
Node.js@chartquery/sdknpm install @chartquery/sdk
Pythonchartquerypip install chartquery
Gochartquery-gogo get github.com/chartquery/chartquery-go
.NETChartQuerydotnet add package ChartQuery
Rubychartquerygem install chartquery
PHPchartquery/sdkcomposer require chartquery/sdk
Javachartquery-javabuild from source, see its README
CLI@chartquery/clinpm install -g @chartquery/cli
MCP server@chartquery/mcpnpx -y @chartquery/mcp

License

MIT — see LICENSE.

来源:README.md,提交 ff22f49

工具

19

barcode

Barcode

Barcode. Generate a barcode image via GET. Output: SVG (default) or PNG. Supports 25+ formats: EAN-13, Code 128, ITF-14, GS1-128, postal codes and more. Credit cost: 3 credits per call.

输入参数data必填desctypeunitcolorsharetitlefieldsformatheightmarginbar_gap另有 14 个

chart

Chart

Chart. Render a Chart.js image via GET. Pass the full chart object as URL-encoded JSON in query. Prefer format png for ChatGPT. POST sends the same object as a JSON body, not query. Credit cost: 5 credits per call.

输入参数query必填sharefieldsversion

chart_ai

Chart AI

Chart AI. Describe a chart in plain English via GET and get a rendered image back. Powered by AI. Credit cost: 10 credits per call.

输入参数sharetitlewidthfieldsformatheightlegendprompt必填raw_datasubtitlebackgrounddevice_pixel_ratio

chart_render

Chart Render

Chart Render. Render a previously saved chart by ID. Public, no API key required. Supports URL overrides for templates (?data1=, ?labels=, ?title=…).

输入参数id必填data1titlewidthfieldsformatheightlabels

chart_view

Chart View

Chart View. View a previously saved chart as an interactive HTML page. Public, no API key required. Iframe-embeddable.

输入参数id必填sharefields

diagram

Diagram

Diagram. Render a diagram via GET. Use type (mermaid, d2, …), query (source code), and format=png for ChatGPT. POST uses diagram_type and diagram_source instead. Credit cost: 5 credits per call.

输入参数type必填query必填sharefieldsformat

diagram_ai

Diagram AI

Diagram AI. Describe a diagram in plain English via GET and get a rendered image back. Powered by AI. Credit cost: 10 credits per call.

输入参数sharefieldsprompt必填diagram_typeoutput_format

diagram_render

Diagram Render

Diagram Render. Render a previously saved diagram by ID. Public, no API key required. Supports ?format= and ?query= overrides.

输入参数id必填querysharefieldsformat

diagram_view

Diagram View

Diagram View. View a previously saved diagram as an HTML page. Public, no API key required. Iframe-embeddable with inline SVG rendering.

输入参数id必填sharefields

label

Label Preview

Label Preview. Preview a thermal label via GET. Pass the same label object as a URL-encoded JSON string in query. Inside that JSON, text items use content and size (1-10), not text or fontSize. Prefer format=png for ChatGPT. Credit cost: 3 credits per call.

输入参数query必填sharefieldsformat

label_compile

Label Compile

Label Compile. Compile a label to printer commands (tsc, zpl, epl, …). POST width, language, and elements. Text uses content and size (1-10), not text or fontSize. No barcode element. Example: {"width":40,"height":30,"unit":"mm","language":"zpl","element… Credit cost: 3 credits per call.

输入参数dpigapunitspeedwidth必填copiesfieldsheightdensityprinterelements必填language必填另有 1 个

label_convert

Label Convert

Label Convert. Convert printer commands from one language to another. POST source, from, and to. from is the source language (tsc, zpl, epl, …). to is the target (tsc, zpl, escpos, …). Credit cost: 5 credits per call.

输入参数to必填dpifrom必填speedcopiesfieldssource必填density

label_parse

Label Parse

Label Parse. Parse printer commands into structured elements. POST source and language (tsc, zpl, epl, …). Credit cost: 1 credit per call.

输入参数fieldssource必填language必填

label_render

Label Render

Label Render. Render a previously saved label by ID. Public, no API key required. Supports ?format= override.

输入参数id必填fieldsformat

label_validate

Label Validate

Label Validate. Validate printer commands. POST source (the raw commands) and language (tsc, zpl, epl, …). Credit cost: 1 credit per call.

输入参数fieldssource必填language必填

label_view

Label View

Label View. View a previously saved label as an HTML page. Public, no API key required. Iframe-embeddable with inline SVG rendering.

输入参数id必填fields

qrcode

QR Code

QR Code. Generate a styled QR code via GET. Output: SVG (default) or PNG. Supports dot styles, gradients, custom corners and all QR versions. Credit cost: 3 credits per call.

输入参数data必填descmaskmodesizeunitcolorshapesharetitlefieldsformat另有 8 个

stats

Stats

Stats. Infrastructure health for an engine or endpoint over the last hour. Not scoped to your account or tenant. Enabled per account: HTTP 403 means contact support to activate it.

输入参数pathengine

usage

Usage

Usage. Return this account's Chartquery usage and credit balance. No body. Requires an API key.

无需输入参数。

版本历史

1
  1. v0.1.0最新Nov 7, 2026

评分

已满足适用检查项的 100%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通必需25 分
  • 已声明认证方式必需10 分
  • 已列出工具15 分
  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分