ChartQuery MCP Server
Renders Chart.js chart images from a full Chart.js chart configuration object supplied as URL-encoded JSON, with PNG or SVG output and optional AI-generated charts from plain-English descriptions.
Renders Mermaid diagrams from diagram source code, returning images in formats such as PNG or SVG, and can also generate diagrams from plain-English descriptions.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@ChartQuery MCP Servermake a bar chart of monthly sales from January to June as a PNG"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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
Related MCP server: image-builder
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.
claude mcp add --transport http chartquery https://mcp.chartquery.com/ --header "x-api-key: YOUR_API_KEY"{
"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
claude mcp add chartquery --env CHARTQUERY_API_KEY=YOUR_API_KEY -- npx -y @chartquery/mcpClaude Desktop, Cursor, Windsurf and other clients
Add the server to the client's MCP configuration (claude_desktop_config.json, .cursor/mcp.json…):
{
"mcpServers": {
"chartquery": {
"command": "npx",
"args": ["-y", "@chartquery/mcp"],
"env": {
"CHARTQUERY_API_KEY": "YOUR_API_KEY"
}
}
}
}VS Code
{
"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
docker build -t chartquery-mcp .
docker run -i --rm -e CHARTQUERY_API_KEY=YOUR_API_KEY chartquery-mcpTools
Tool | Description |
| 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. |
| 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. |
| Describe a chart in plain English via GET and get a rendered image back. Powered by AI. |
| Render a previously saved chart by ID. Public, no API key required. Supports URL overrides for templates (?data1=, ?labels=, ?title=…). |
| View a previously saved chart as an interactive HTML page. Public, no API key required. Iframe-embeddable. |
| 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. |
| Describe a diagram in plain English via GET and get a rendered image back. Powered by AI. |
| Render a previously saved diagram by ID. Public, no API key required. Supports ?format= and ?query= overrides. |
| View a previously saved diagram as an HTML page. Public, no API key required. Iframe-embeddable with inline SVG rendering. |
| 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 fo… |
| 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":… |
| 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, …). |
| Parse printer commands into structured elements. POST source and language (tsc, zpl, epl, …). |
| Render a previously saved label by ID. Public, no API key required. Supports ?format= override. |
| Validate printer commands. POST source (the raw commands) and language (tsc, zpl, epl, …). |
| View a previously saved label as an HTML page. Public, no API key required. Iframe-embeddable with inline SVG rendering. |
| Generate a styled QR code via GET. Output: SVG (default) or PNG. Supports dot styles, gradients, custom corners and all QR versions. |
| 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. |
| Return 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
npx @chartquery/mcp --http --port 3000The 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):
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
npm install
npm test
npm run build
npx @modelcontextprotocol/inspector node dist/stdio.jsBuilt on the SDK
The server uses the official Node.js SDK (@chartquery/sdk).
All ChartQuery SDKs
SDK | Package | Install |
Node.js |
| |
Python |
| |
Go |
| |
.NET |
| |
Ruby |
| |
PHP |
| |
Java | build from source, see its README | |
CLI |
| |
MCP server |
|
License
MIT — see LICENSE.
Available Tools
19 toolsbarcodeBarcodeARead-onlyInspect
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.
Inputs: data (required), desc, type, unit, +22 more.
chartChartARead-onlyInspect
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.
Inputs: query (required), share, fields, version.
chart_aiChart AIARead-onlyInspect
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.
Inputs: prompt (required), share, title, width, +8 more.
chart_renderChart RenderARead-onlyInspect
Chart Render. Render a previously saved chart by ID. Public, no API key required. Supports URL overrides for templates (?data1=, ?labels=, ?title=…).
Inputs: id (required), data1, title, width, +4 more.
chart_viewChart ViewARead-onlyInspect
Chart View. View a previously saved chart as an interactive HTML page. Public, no API key required. Iframe-embeddable.
Inputs: id (required), share, fields.
diagramDiagramBRead-onlyInspect
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.
Inputs: type (required), query (required), share, fields, +1 more.
diagram_aiDiagram AIARead-onlyInspect
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.
Inputs: prompt (required), share, fields, diagram_type, +1 more.
diagram_renderDiagram RenderARead-onlyInspect
Diagram Render. Render a previously saved diagram by ID. Public, no API key required. Supports ?format= and ?query= overrides.
Inputs: id (required), query, share, fields, +1 more.
diagram_viewDiagram ViewARead-onlyInspect
Diagram View. View a previously saved diagram as an HTML page. Public, no API key required. Iframe-embeddable with inline SVG rendering.
Inputs: id (required), share, fields.
labelLabel PreviewBRead-onlyInspect
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.
Inputs: query (required), share, fields, format.
label_compileLabel CompileBRead-onlyInspect
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.
Inputs: width (required), elements (required), language (required), dpi, +9 more.
label_convertLabel ConvertBRead-onlyInspect
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.
Inputs: to (required), from (required), source (required), dpi, +4 more.
label_parseLabel ParseARead-onlyInspect
Label Parse. Parse printer commands into structured elements. POST source and language (tsc, zpl, epl, …). Credit cost: 1 credit per call.
Inputs: source (required), language (required), fields.
label_renderLabel RenderBRead-onlyInspect
Label Render. Render a previously saved label by ID. Public, no API key required. Supports ?format= override.
Inputs: id (required), fields, format.
label_validateLabel ValidateBRead-onlyInspect
Label Validate. Validate printer commands. POST source (the raw commands) and language (tsc, zpl, epl, …). Credit cost: 1 credit per call.
Inputs: source (required), language (required), fields.
label_viewLabel ViewBRead-onlyInspect
Label View. View a previously saved label as an HTML page. Public, no API key required. Iframe-embeddable with inline SVG rendering.
Inputs: id (required), fields.
qrcodeQR CodeARead-onlyInspect
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.
Inputs: data (required), desc, mask, mode, +16 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
TDQS
Scored across 19 tools
The tools are grouped by clear output domains (chart, diagram, label, barcode, QR code) and action suffixes such as render/view/compile/validate help distinguish most usage. Some pairs, especially chart_render vs chart_view and label_preview vs label_compile, could still be confused at a glance, but their descriptions clarify the difference.
Most names follow a predictable noun plus action pattern in snake_case, such as chart_render, diagram_view, label_compile, and label_validate. The main deviations are bare noun tools like barcode, chart, usage, qrcode, and stats, which are readable but less consistent than the suffixed variants.
At 19 tools the set is on the heavy side, and the repeated render/view/ai pattern across chart, diagram, and label contributes to bloat. Most tools are purposeful, but the surface is close to the borderline where a smaller unified abstraction would be easier to use.
The server covers generation, AI-assisted creation, saved rendering/viewing, and detailed label printer-command workflows, so core lifecycle needs are addressed. Minor gaps remain around explicitly listing, saving, deleting, or managing saved chart/diagram/label resources.
Related MCP Connectors
Screenshots, PDFs, image editing, QR codes, email validation and more through one hosted MCP server.
Create, inspect, manage, and render charts and data visualizations as SVG/PNG or interactive embeds.
Image processing over MCP: compress and split images, generate images and QR codes.
Render API: chart images, invoice and receipt PDFs with the math done, social images and video.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables AI clients to generate over 26 chart types via MCP, automatically starting a private rendering service.271MIT
- AlicenseNot gradedqualityCmaintenanceEnables agents to manage templates and images, create and update image drafts, and render them to PNG, ZIP, or PDF exports via MCP.4 npmMIT
- AlicenseAqualityBmaintenanceEnables MCP clients to inspect, convert, resize, compress, crop, rotate, watermark, background-remove, and batch-process images with secure path confinement and result verification.14MIT
- AlicenseNot gradedqualityCmaintenanceEnables LLM clients to create hand-drawn study-notes style graphics, including charts, concept maps, mind maps, timelines, sketch notes, and 2×2 matrices, as PNG images via MCP.1MIT