Model Context Protocol

Give your assistant a chart it can hand straight to a human

ChartRelay has an MCP server with one tool, render_chart. The model sends a small JSON spec and gets back durable PNG and SVG URLs, alt text, and a structural quality review it can act on before anyone sees the chart.

Not on npm, and the repository is private: the MCP server is available to beta users on request today. The HTTP API behind it is open to anyone with a free key.

Monthly recurring revenueMonthly recurring revenue. MRR peaks at 33,900 for Sep and bottoms at 18,400 for Apr. It increased 84.2% from first to last point.Monthly recurring revenueRevenue grew 84% over six months33.9K25.4K16.9K8.5K0AprMayJunJulAugSepMRR, Apr: 18,40018.4KMRR, May: 21,30021.3KMRR, Jun: 24,70024.7KMRR, Jul: 26,90026.9KMRR, Aug: 31,20031.2KMRR, Sep: 33,90033.9KMRR
Availability

You cannot install this yet, and here is the honest state of it

The rest of this page describes the tool accurately — what it sends, what comes back, what it costs you in quota. What it cannot do is hand you a copy, because there is nothing public to fetch.

The API needs none of this

render_chart is a thin wrapper over one HTTP endpoint. A free key and a POST to /api/v1/charts gets you the same render, alt text and findings from any language, today.

The behaviour is testable now

The playground and the chart checker run the same renderer and the same review this tool calls, with no account, so you can judge the output before asking for anything.

What publication would change

Only distribution. The tool name, the spec it takes, the text it returns and the three environment variables are what they will be; a published package makes them installable in one line.

One tool

What render_chart gives the model

Every successful call returns a block of text the model can read and quote, plus an inline PNG so it can see what it made.

A durable PNG URL

Served from GET /api/v1/charts/[id]?format=png with a one-year immutable cache header. Paste it into chat, an email, or a Slack message.

A durable SVG URL

The same chart at ?format=svg, for web pages and documents. The SVG carries a <title> and <desc> from the chart's title and alt text.

Alt text

A sentence generated from the data: the peak, the low, and the first-to-last change for time-ordered charts. Pie charts get their largest shares instead.

A quality review

Structural findings with a severity and a concrete fix — missing title, too many pie slices, a crowded chart, weak colour contrast, over-long axis labels.

An inline PNG preview

The server fetches its own PNG and attaches it to the tool result, so the model can look at the chart rather than trust the spec. Turn it off with one environment variable.

Your usage so far

Each result ends with the renders used against this month's quota, so an agent working in a loop can tell how much room is left.

What the model reads back
Chart rendered (id kR2pQ7mXa4Tb9F).
PNG: https://chartrelay.dev/api/v1/charts/kR2pQ7mXa4Tb9F?format=png
SVG: https://chartrelay.dev/api/v1/charts/kR2pQ7mXa4Tb9F?format=svg
Alt text: Monthly recurring revenue. MRR peaks at 33,900 for Sep and bottoms at 18,400 for Apr. It increased 84.2% from first to last point.
Quality review: no structural problems found. Still verify the data and the takeaway in the title.
Usage this month: 42/1000.

Generated on this page by the same renderer the API uses; the id and host are illustrative. URLs point at whatever CHARTRELAY_API_URL you configure.

Setup

What the setup will look like

Two shapes, neither of which runs today. They are worth reading now because they are the whole integration: one entry in a config file, three environment variables, no other moving parts.

  1. Create an API key

    Register for a free account and copy the key that is shown once. It starts with cr_live_. This part works today and is useful on its own — the same key calls the HTTP API.

  2. Get the server

    The step that does not exist yet. Ask for beta access and you will be sent the server plus the setup for your client; when the package is published this becomes the npx line below and nothing else changes.

  3. Point it at a ChartRelay instance

    Set CHARTRELAY_API_URL to the deployment you render against. The built-in default is a placeholder domain, so it is always worth setting explicitly.

  4. Add the entry to your client and restart it

    Then ask the assistant for a chart. It calls render_chart and replies with the URLs, the alt text and the review.

Claude Desktop · claude_desktop_config.json (after publication)
{
  "mcpServers": {
    "chartrelay": {
      "command": "npx",
      "args": ["-y", "@chartrelay/mcp"],
      "env": {
        "CHARTRELAY_API_KEY": "cr_live_...",
        "CHARTRELAY_API_URL": "https://chartrelay.dev"
      }
    }
  }
}

Not runnable yet: npx cannot resolve @chartrelay/mcp until it is published. Beta users get a working equivalent with their copy of the server.

Claude Code · terminal (after publication)
claude mcp add chartrelay \
  -e CHARTRELAY_API_KEY=cr_live_... \
  -e CHARTRELAY_API_URL=https://chartrelay.dev \
  -- npx -y @chartrelay/mcp

The same server, added to Claude Code. The API key is stored by your MCP client, never by this page.

Environment variables

These three are the whole configuration surface; the server reads nothing else.

Environment variables read by the MCP server, version 0.1.0.
VariableDefaultWhat it does
CHARTRELAY_API_KEYRequired — no defaultSent as a Bearer token on every render. Without it, the tool returns an error telling the model to create a key instead of failing silently.
CHARTRELAY_API_URLhttps://chartrelay.exampleThe ChartRelay instance to call. The built-in default is a placeholder domain, so set this explicitly — to this deployment or to your own.
CHARTRELAY_INCLUDE_IMAGEtrueSet it to false to skip the inline PNG preview and return only the text block. Useful when you are paying for image tokens you do not need.

Each render_chart call counts as one render against your plan's monthly quota, the same as a direct API call.

Self-correction

The quality review is written for a model to act on

Every finding carries a severity, a plain description of the problem, and a suggested fix. The tool description tells the model to revise the spec and call again when the review reports issues, so a bad chart can be caught before it reaches a person.

A two-call loop
// First attempt: a pie chart with eleven slices.
Quality review found 1 issue(s). Consider fixing and re-rendering:
- [warning] Too many slices make the chart hard to scan. Fix: Keep the
  largest six categories and group the rest as Other.

// The model groups the tail into "Other" and calls render_chart again.
Quality review: no structural problems found. Still verify the data and
the takeaway in the title.

Both messages are the exact strings in the quality review. Nothing here is automatic: the model chooses whether to re-render.

Errors

A pie chart with more than one series, or with negative values — cases the chart type genuinely cannot represent. The API refuses these rather than storing a chart, so the tool reports an error instead of handing the model a URL.

Warnings

A missing or placeholder title, more than seven pie slices, more than forty points on a non-pie chart, more than seven series, or a series colour under 3:1 against the background.

Tips

Category labels over twelve characters, which get shortened on the axis. When nothing else fires, a single tip says no structural problems were found.

What the agent can and cannot do

Worth reading before you let a model publish charts on your behalf.

It can

Draw five chart types

Bar, line, area, pie, and scatter. Colours, light or dark theme, legend on or off, and values printed on the marks are all part of the spec.

Handle real-sized data

Up to 12 series of up to 100 points each, at any size from 320x240 to 2400x1600 pixels.

Share the result with anyone

GET /api/v1/charts/[id] needs no key, so the PNG and SVG URLs work in an email or a public page. Renders are immutable: the same id always returns the same image.

Fix its own chart

Read the quality review, adjust the spec, and call render_chart again — no human in the loop for a mis-shaped chart.

It cannot

Tell you whether the data is true

The review inspects the chart's structure — series counts, slice counts, density, contrast, labels. It never sees your source system and cannot check that a number is right.

Plot an x/y relationship

Scatter places each value as a dot at its category label, in input order. There is no numeric x-axis, so it will not show a correlation.

Crop the value axis

The axis always includes zero. That rules out the exaggerated-difference chart, and it also rules out zooming in on a narrow range on purpose.

Change or delete a render

The v1 API is POST to create and GET to read. There is no edit and no delete, and no way to make a published URL private after the fact.

Questions

Get started

Start with the API, ask about the MCP server

A free key works today and gives you the same renders, alt text and review the tool returns. The MCP wrapper is the part you have to ask for.

250 renders a month on the free plan once your email is confirmed (0 before). No card required.