Datawrapper MCP V2
<div align="center">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/JohnnyTheTank/datawrapper-mcp-v2/main/docs/assets/logo-dark.svg">
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/JohnnyTheTank/datawrapper-mcp-v2/main/docs/assets/logo-light.svg">
<img src="https://raw.githubusercontent.com/JohnnyTheTank/datawrapper-mcp-v2/main/docs/assets/logo-light.svg" alt="Datawrapper MCP V2" width="112">
</picture>
<h1>Datawrapper MCP V2</h1>
<p>
<b>Let your AI assistant create, style, preview and publish Datawrapper charts, maps and tables.</b><br>
All 25 chart types · choropleth & locator maps · skills over MCP · interactive chart viewer · OAuth
</p>
<p>
<a href="#-quickstart">Quickstart</a> ·
<a href="#-connect-your-client">Connect</a> ·
<a href="#-tools">Tools</a> ·
<a href="#-skills">Skills</a> ·
<a href="#-chart-viewer">Chart viewer</a> ·
<a href="#-faq">FAQ</a> ·
<a href="#-run-locally">Run locally</a>
</p>
<p>
<a href="https://www.npmjs.com/package/datawrapper-mcp"><img src="https://img.shields.io/npm/v/datawrapper-mcp.svg?color=cb3837&label=npm" alt="npm version"></a>
<a href="https://registry.modelcontextprotocol.io/v0.1/servers?search=datawrapper-mcp-v2"><img src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fregistry.modelcontextprotocol.io%2Fv0.1%2Fservers%2Fio.github.JohnnyTheTank%252Fdatawrapper-mcp-v2%2Fversions%2Flatest&query=%24.server.version&label=MCP%20Registry&logo=modelcontextprotocol" alt="MCP Registry"></a>
<a href="https://modelcontextprotocol.io/specification/2026-07-28"><img src="https://img.shields.io/badge/MCP_spec-2026--07--28-6e40c9?logo=modelcontextprotocol" alt="MCP spec 2026-07-28"></a>
<a href="https://github.com/JohnnyTheTank/datawrapper-mcp-v2/actions/workflows/ci.yml"><img src="https://github.com/JohnnyTheTank/datawrapper-mcp-v2/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
<a href="LICENSE"><img src="https://img.shields.io/github/license/JohnnyTheTank/datawrapper-mcp-v2" alt="MIT license"></a>
</p>
<p>
<b>Hosted MCP server — nothing to install:</b><br>
<code>https://datawrapper-mcp.alpacatools.org/mcp</code>
</p>
<p>
<a href="https://cursor.com/en/install-mcp?name=datawrapper&config=eyJ1cmwiOiJodHRwczovL2RhdGF3cmFwcGVyLW1jcC5hbHBhY2F0b29scy5vcmcvbWNwIn0="><img src="https://custom-icon-badges.demolab.com/badge/Add_to_Cursor-000000?style=for-the-badge&logo=cursor-ai-white" alt="Add to Cursor"></a>
<a href="https://vscode.dev/redirect/mcp/install?name=datawrapper&config=%7B%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fdatawrapper-mcp.alpacatools.org%2Fmcp%22%7D"><img src="https://custom-icon-badges.demolab.com/badge/Add_to_VS_Code-007ACC?style=for-the-badge&logo=vsc&logoColor=white" alt="Add to VS Code"></a>
<a href="https://insiders.vscode.dev/redirect/mcp/install?name=datawrapper&config=%7B%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fdatawrapper-mcp.alpacatools.org%2Fmcp%22%7D&quality=insiders"><img src="https://custom-icon-badges.demolab.com/badge/VS_Code_Insiders-24bfa5?style=for-the-badge&logo=vsc&logoColor=white" alt="Add to VS Code Insiders"></a>
</p>
</div>
<p align="center">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/JohnnyTheTank/datawrapper-mcp-v2/main/docs/assets/viewer-dark.png">
<img src="https://raw.githubusercontent.com/JohnnyTheTank/datawrapper-mcp-v2/main/docs/assets/viewer-light.png" width="680" alt="The interactive chart viewer showing a Datawrapper line chart of the CO₂ concentration at Mauna Loa since 1958 in chart-only mode, with buttons for desktop/mobile, light/dark and chart-only preview, editing, PNG export and publishing">
</picture>
<br>
<em>The interactive chart viewer (MCP App) with a real chart rendered by Datawrapper, shown as “Chart only” — light and dark.</em>
</p>
> [!NOTE]
> Community project — not affiliated with Datawrapper GmbH. You need a free [Datawrapper](https://www.datawrapper.de) account.
>
> **Use the hosted server:** add `https://datawrapper-mcp.alpacatools.org/mcp` to Claude, ChatGPT, Cursor, VS Code or any MCP client and sign in once with your Datawrapper token — no Node.js, no config files, always the latest release. Prefer to keep everything on your machine? You can still [run it locally](#-run-locally).
## ✨ What you can do
- **Every chart type** — all 25 Datawrapper visualizations: bars, columns, lines, areas, pies, donuts, dot/range/arrow plots, scatter plots, tables, choropleth, symbol and locator maps.
- **One call, finished chart** — data, title, source, alt text, styling and annotations in a single `create_chart`, followed by a PNG preview the assistant can check.
- **Styling that just works** — say `sort`, `highlight`, `y_range` or `number_format`; the server maps it to the option each chart type actually uses (learned from Datawrapper's own defaults and ~3,000 public charts).
- **Maps without the pain** — search 4,700+ basemaps in any language (“Landkreise Bayern”, “US counties”), automatic region matching with spelling correction, markers for locator maps.
- **Safe by design** — validates before calling the API (no wasted quota), dry-run diffs, publishing and deleting need a real confirmation, trash with restore.
- **Built on the newest MCP** — spec 2026-07-28 (SDK v2), [skills over MCP](https://modelcontextprotocol.io/community/working-groups/skills-over-mcp), an [MCP App](https://github.com/modelcontextprotocol/ext-apps) chart viewer and a hosted (or self-hostable) OAuth 2.1 HTTP server.
## 🚀 Quickstart
1. **Add the server** `https://datawrapper-mcp.alpacatools.org/mcp` to your client — in claude.ai: *Settings → Connectors → Add custom connector*. Other clients: [Connect your client](#-connect-your-client).
2. **Sign in.** A Datawrapper page opens: create an [API token](https://app.datawrapper.de/account/api-tokens) with the scopes `chart:read` `chart:write` `folder:read` `folder:write` `auth:read` `auth:write` (+ `team:read` for team folders) and paste it.
3. **Ask for a chart:**
> *Make a line chart of German and French unemployment since 2019 from this CSV, highlight Germany and shade the first lockdown.*
## 🔌 Connect your client
Every client uses the same URL: **`https://datawrapper-mcp.alpacatools.org/mcp`**. The first time, a sign-in page asks for your Datawrapper API token.
<details open>
<summary><b>Claude (claude.ai, Desktop, mobile)</b></summary>
*Settings → Connectors → **Add custom connector***, name it “Datawrapper” and paste the URL, then **Connect**. The connector is available in claude.ai, Claude Desktop and the mobile apps, including the interactive [chart viewer](#-chart-viewer). On Team and Enterprise plans an owner can add it once for the whole organization in the admin settings.
</details>
<details>
<summary><b>Claude Code</b></summary>
```bash
claude mcp add --transport http datawrapper https://datawrapper-mcp.alpacatools.org/mcp
```
Then run `/mcp` and choose **Authenticate**. Claude Code also loads the server's skills (they appear as `/datawrapper:<skill>`).
</details>
<details>
<summary><b>ChatGPT</b></summary>
Turn on developer mode in ChatGPT's settings, then create a connector with the URL (authentication: OAuth).
</details>
<details>
<summary><b>Cursor</b></summary>
Click **Add to Cursor** above, or add to `~/.cursor/mcp.json`:
```json
{ "mcpServers": { "datawrapper": { "url": "https://datawrapper-mcp.alpacatools.org/mcp" } } }
```
</details>
<details>
<summary><b>VS Code / VS Code Insiders</b></summary>
Click **Add to VS Code** above, or add to `.vscode/mcp.json`:
```json
{ "servers": { "datawrapper": { "type": "http", "url": "https://datawrapper-mcp.alpacatools.org/mcp" } } }
```
</details>
<details>
<summary><b>Windsurf</b></summary>
Add to `~/.codeium/windsurf/mcp_config.json`:
```json
{ "mcpServers": { "datawrapper": { "serverUrl": "https://datawrapper-mcp.alpacatools.org/mcp" } } }
```
</details>
<details>
<summary><b>Codex</b></summary>
```bash
codex mcp add datawrapper --url https://datawrapper-mcp.alpacatools.org/mcp
codex mcp login datawrapper
```
</details>
<details>
<summary><b>Goose</b></summary>
`goose configure` → Add Extension → **Remote Extension (Streamable HTTP)** → URL above.
</details>
<details>
<summary><b>Other clients</b></summary>
Any client with Streamable HTTP and OAuth works: `{ "type": "http", "url": "https://datawrapper-mcp.alpacatools.org/mcp" }`. Clients without remote servers can [run it locally](#-run-locally).
</details>
**How sign-in works:** the token you paste is checked against Datawrapper and then kept only inside encrypted connection tokens held by your client. The server stores nothing, logs no tokens and never shows the token to the model. Charts and API quota belong to your own Datawrapper workspace. Revoke access any time by deleting the token in Datawrapper. The server runs on Fly.io in Frankfurt — see the [privacy policy](https://datawrapper-mcp.alpacatools.org/privacy).
## 🖼️ Gallery
Real charts with real data, each made by a single `create_chart` call — the exact calls are in [`scripts/gen-readme-gallery.ts`](scripts/gen-readme-gallery.ts).
<!-- gallery:start -->
<table>
<tr>
<td align="center" valign="top" width="25%"><img src="https://raw.githubusercontent.com/JohnnyTheTank/datawrapper-mcp-v2/main/docs/assets/gallery/temperature.png" width="200" alt="Line chart of global temperature since 1880 crossing the 1.5 °C line in 2024"><br><sub><b>Line</b> · reference line, arrow annotation with circle</sub></td>
<td align="center" valign="top" width="25%"><img src="https://raw.githubusercontent.com/JohnnyTheTank/datawrapper-mcp-v2/main/docs/assets/gallery/budget.png" width="200" alt="US federal receipts and outlays since 1960 with the deficit shaded red and surpluses blue"><br><sub><b>Line</b> · area fill between two lines with a second color, striped ranges</sub></td>
<td align="center" valign="top" width="25%"><img src="https://raw.githubusercontent.com/JohnnyTheTank/datawrapper-mcp-v2/main/docs/assets/gallery/life-expectancy.png" width="200" alt="Eight small line charts of life expectancy since 1950 with dips in China around 1960 and Russia in the 1990s"><br><sub><b>Small multiples</b> · long data pivoted automatically, per-panel annotations</sub></td>
<td align="center" valign="top" width="25%"><img src="https://raw.githubusercontent.com/JohnnyTheTank/datawrapper-mcp-v2/main/docs/assets/gallery/renewables.png" width="200" alt="Sorted bar chart of the renewable energy share in EU countries in 2024 with a marker for 2014"><br><sub><b>Bars</b> · flags, overlay for a second value, highlight</sub></td>
</tr>
<tr>
<td align="center" valign="top" width="25%"><img src="https://raw.githubusercontent.com/JohnnyTheTank/datawrapper-mcp-v2/main/docs/assets/gallery/pyramid.png" width="200" alt="Population pyramid of Germany in 2025 with the largest groups aged 55 to 64"><br><sub><b>Population pyramid</b> · mirrored split bars</sub></td>
<td align="center" valign="top" width="25%"><img src="https://raw.githubusercontent.com/JohnnyTheTank/datawrapper-mcp-v2/main/docs/assets/gallery/electricity.png" width="200" alt="Stacked column chart of German electricity generation by source from 2014 to 2025"><br><sub><b>Stacked columns</b> · totals, series colors, annotation</sub></td>
<td align="center" valign="top" width="25%"><img src="https://raw.githubusercontent.com/JohnnyTheTank/datawrapper-mcp-v2/main/docs/assets/gallery/wealth-health.png" width="200" alt="Bubble chart of GDP per capita on a log scale against life expectancy for 91 countries, sized by population"><br><sub><b>Scatter</b> · log axis, bubble sizes, colors by region, trend line</sub></td>
<td align="center" valign="top" width="25%"><img src="https://raw.githubusercontent.com/JohnnyTheTank/datawrapper-mcp-v2/main/docs/assets/gallery/employment-gap.png" width="200" alt="Range plot of women's and men's employment rates in EU countries in 2024, sorted by the gap"><br><sub><b>Range plot</b> · flags, sorted by difference</sub></td>
</tr>
<tr>
<td align="center" valign="top" width="25%"><img src="https://raw.githubusercontent.com/JohnnyTheTank/datawrapper-mcp-v2/main/docs/assets/gallery/eu-table.png" width="200" alt="Table of the 27 EU countries with population bars, GDP growth sparklines and heatmap columns for unemployment and inflation"><br><sub><b>Table</b> · sparklines, mini bars, flags, heatmap, search</sub></td>
<td align="center" valign="top" width="25%"><img src="https://raw.githubusercontent.com/JohnnyTheTank/datawrapper-mcp-v2/main/docs/assets/gallery/population-change.png" width="200" alt="Map of Europe colored by population change from 2015 to 2025, growth in the west and north, decline in the south-east"><br><sub><b>Choropleth</b> · German country names matched automatically, diverging scale</sub></td>
<td align="center" valign="top" width="25%"><img src="https://raw.githubusercontent.com/JohnnyTheTank/datawrapper-mcp-v2/main/docs/assets/gallery/cities.png" width="200" alt="Spike map of German cities with 100,000 or more inhabitants, Berlin's spike the tallest"><br><sub><b>Spike map</b> · symbols by coordinates, sized by a column</sub></td>
<td align="center" valign="top" width="25%"><img src="https://raw.githubusercontent.com/JohnnyTheTank/datawrapper-mcp-v2/main/docs/assets/gallery/berlin-3d.png" width="200" alt="Tilted 3D locator map of Berlin's government quarter with five numbered places, the Band des Bundes and a walking route"><br><sub><b>Locator map</b> · 3D buildings, tilted camera, area, route, numbered key, inset</sub></td>
</tr>
</table>
<!-- gallery:end -->
<details>
<summary><b>All 25 chart types</b></summary>
| Family | Types |
| -------------------- | -------------------------------------------------------------------------------------------- |
| Bars | `d3-bars` · `d3-bars-split` · `d3-bars-stacked` · `d3-bars-grouped` · `d3-bars-bullet` |
| Columns | `column-chart` · `grouped-column-chart` · `stacked-column-chart` · `multiple-columns` |
| Lines & areas | `d3-lines` · `multiple-lines` · `d3-area` |
| Dots, ranges, arrows | `d3-dot-plot` · `d3-range-plot` · `d3-arrow-plot` |
| Pies | `d3-pies` · `d3-donuts` · `d3-multiple-pies` · `d3-multiple-donuts` · `election-donut-chart` |
| Scatter | `d3-scatter-plot` |
| Maps | `d3-maps-choropleth` · `d3-maps-symbols` · `locator-map` |
| Tables | `tables` |
Aliases in plain language work too: `bar`, `stacked bars`, `choropleth`, `Kreisdiagramm`, `table` …
</details>
## 💬 Example prompts
| Use case | Prompt |
| ------------------ | ------------------------------------------------------------------------------------------------ |
| Trend with context | *“Line chart of these monthly prices, start at zero and mark the 2022 energy crisis.”* |
| Ranking | *“Sorted bar chart of the top 10 cities by rent, highlight Munich, values in €.”* |
| Regional data | *“Map unemployment by German district from this CSV with 5 color steps.”* |
| Places | *“Locator map with our three office locations in Berlin, the HQ in red.”* |
| Lookup table | *“Searchable table of all countries with a heatmap on the growth column.”* |
| Review | *“Review chart aBc12 for clarity and accessibility — propose fixes, don't change anything yet.”* |
A typical conversation:
```text
You: Turn this CSV into a chart about how renewables grew.
Claude: (analyze_data → create_chart) Created a draft stacked column chart … [preview]
You: Make renewables green and the rest grey, and add the source "Ember".
Claude: (update_chart) Updated — 3 changes. [preview]
You: Publish it and give me the embed code.
Claude: (publish_chart → you confirm) Published v1: https://datawrapper.dwcdn.net/… <iframe …>
```
## 🛠️ Tools
<!-- START AUTOMATED TOOLS -->
<!-- Generated by scripts/gen-readme-tools.ts — do not edit by hand. -->
**28 tools** · 📖 read-only · ✏️ changes data · ⚠️ needs confirmation
<details>
<summary><b>🔎 Discover</b> (5)</summary>
| | Tool | What it does |
|:-:|---|---|
| 📖 | `whoami` | Check the connection and show the account, workspaces, teams and API token scopes. |
| 📖 | `analyze_data` | Profile a dataset (column types, number format, ranges) and recommend 1–4 suitable chart types with the column mapping and a reason. |
| 📖 | `describe_chart_type` | Without `type`, list all 25 chart/map/table types with when to use each. |
| 📖 | `list_themes` | List available themes. |
| 📖 | `get_guide` | Read expert guidance (the same content as this server's skills) on a topic. |
</details>
<details>
<summary><b>📊 Create & edit</b> (6)</summary>
| | Tool | What it does |
|:-:|---|---|
| ✏️ | `create_chart` | Create a chart, map or table in one call (create + upload data + style). |
| ✏️ | `update_chart` | Change an existing chart — texts, data, type, style, annotations or raw options. |
| 📖 | `preview_chart` | Render the current state of a chart as PNG (desktop or mobile width, light or dark, optionally only the chart without title, description and footer) to check it visually. |
| 📖 | `get_chart` | Show one chart. |
| 📖 | `search_charts` | Find charts by text, folder, type or publish state, newest first, or list the user's recently edited, published or viewed charts (`recent`). |
| ✏️ | `open_in_editor` | Create a one-time sign-in link (valid 5 minutes, single use) that opens the chart directly in the Datawrapper editor at a given step — for fine-tuning by hand. |
</details>
<details>
<summary><b>🗺️ Maps</b> (2)</summary>
| | Tool | What it does |
|:-:|---|---|
| 📖 | `find_basemap` | Search the 4,700+ basemaps for choropleth/symbol maps by place and level in any language ('Bundesländer', 'US counties', 'Bavaria districts 2024', 'world'). |
| 📖 | `match_regions` | Check which region values (names or codes) match a basemap, pick the best key automatically, and list unmatched values with spelling suggestions. |
</details>
<details>
<summary><b>🚀 Publish & export</b> (4)</summary>
| | Tool | What it does |
|:-:|---|---|
| ⚠️ | `publish_chart` | Publish (or republish) a chart so it is publicly visible at its URL and embeddable. |
| 📖 | `get_embed_code` | Embed codes for a published chart — responsive iframe, fixed iframe, script embed (web component, no iframe), Google AMP or oEmbed — optionally with render flags (dark mode, plain without header/footer, static without interactivity, logo on/off, transparent background, fitchart, table search). |
| ⚠️ | `unpublish_chart` | Take a published chart offline (public URL and embeds stop working). |
| 📖 | `export_chart` | Export a chart as PNG, SVG or PDF (print quality, CMYK, transparent background, dark mode, custom size), or as a ZIP with index.html and the scripts to host the published chart yourself. |
</details>
<details>
<summary><b>🗂️ Organise</b> (11)</summary>
| | Tool | What it does |
|:-:|---|---|
| ✏️ | `copy_chart` | Duplicate a chart (data, settings, annotations) as a new draft, to make variants or update a chart for a new period without touching the original. |
| ✏️ | `move_charts` | Move one or more charts into a folder, team or workspace (bulk, up to 1,000). |
| ✏️ | `create_folder` | Create a folder (optionally inside another folder or a team) to organise charts. |
| ✏️ | `update_folder` | Rename a folder and/or move it (with its subfolders and charts) under another folder, to the root, or into a team. |
| ✏️ | `copy_folder` | Copy a folder with all its subfolders and charts (the charts become new drafts with new ids) into another folder, the root or a team. |
| ✏️ | `delete_folder` | Delete a folder. |
| 📖 | `list_folders` | Show the folder tree (personal, team and workspace folders) with folder ids and chart counts. |
| ⚠️ | `delete_chart` | Move a chart to the trash (restorable for 30 days with restore_charts). |
| ✏️ | `restore_charts` | Restore charts from the trash (deleted within the last 30 days). |
| 📖 | `get_comments` | Read the comment threads on a chart (team feedback from the Datawrapper editor), with author names, dates, replies and resolved state. |
| ✏️ | `add_comment` | Post a comment (or a reply to one) on a chart under the user's name; everyone with access to the chart sees it in the editor. |
</details>
<!-- END AUTOMATED TOOLS -->
Resources: `datawrapper://chart-types`, `datawrapper://chart-types/{type}/schema`, `datawrapper://charts/{id}`, `datawrapper://charts/{id}/data` · Prompts: `chart_from_data`, `map_from_data`, `review_chart`
## 🧠 Skills
The server ships expert guidance as [skills over MCP](https://modelcontextprotocol.io/community/working-groups/skills-over-mcp) (`skill://datawrapper/…`, SHA-256-verified). Clients without skills support read the same content through the `get_guide` tool.
| Skill | Use it for | Try |
| ------------------------------------------------------------------------------ | -------------------------------------------------------------------------------- | --------------------------------------------- |
| [`choosing-a-chart`](skills/choosing-a-chart/SKILL.md) | Picking the right chart, map or table for a message | *“How should I show these survey results?”* |
| [`building-charts`](skills/building-charts/SKILL.md) | Data shapes, the `style` field, update rules — plus a reference for all 25 types | *“Build a bar chart from this table.”* |
| [`annotations-and-highlights`](skills/annotations-and-highlights/SKILL.md) | Labels, shaded ranges, reference lines, highlighting | *“Mark the 2008 crisis on this chart.”* |
| [`choropleth-and-symbol-maps`](skills/choropleth-and-symbol-maps/SKILL.md) | Basemaps, region matching, color scales | *“Map this by US county.”* |
| [`locator-maps`](skills/locator-maps/SKILL.md) | Points, routes, areas on a detailed map | *“Show where the bridge closed.”* |
| [`tables`](skills/tables/SKILL.md) | Heatmaps, mini bars, sparklines, search | *“Make this a searchable table.”* |
| [`tooltips-and-number-formats`](skills/tooltips-and-number-formats/SKILL.md) | Number/date formats and tooltip templates | *“Show values as millions with one decimal.”* |
| [`accessibility-and-publishing`](skills/accessibility-and-publishing/SKILL.md) | Alt text, colors, dark mode, publishing, export | *“Is this ready to publish?”* |
## 🪟 Chart viewer
In clients that support [MCP Apps](https://github.com/modelcontextprotocol/ext-apps), chart tools open an interactive viewer right in the conversation. That includes claude.ai, Claude Desktop, ChatGPT, VS Code and Goose.
1. **Preview** — the rendered chart, with desktop/mobile and light/dark toggles.
2. **Edit ↗** — opens the chart in the Datawrapper editor for fine-tuning by hand.
3. **PNG ↓** — exports the current view.
4. **Publish** — asks for confirmation, then shows the embed code and a **Live ↗** link.
Other clients get the same information as text plus a PNG preview.
## 💻 Run locally
The [hosted server](#-connect-your-client) is the easiest way in. Run the server on your own machine instead when you want the token to stay local, write exports to disk (`export_chart` with `save_to`) or add house rules (`DW_MCP_INSTRUCTIONS`, see [Configuration](#-configuration)). It needs Node.js 22+; every client starts the same command with your token in `DATAWRAPPER_API_KEY`:
```json
{
"mcpServers": {
"datawrapper": {
"command": "npx",
"args": ["-y", "datawrapper-mcp"],
"env": { "DATAWRAPPER_API_KEY": "your-token" }
}
}
}
```
<details>
<summary><b>Setup per client</b></summary>
- **Claude Code:** `claude mcp add datawrapper --env DATAWRAPPER_API_KEY=your-token -- npx -y datawrapper-mcp`
- **Claude Desktop:** Settings → Developer → **Edit Config**, add the JSON above to `claude_desktop_config.json`, restart.
- **Cursor:** add the JSON above to `~/.cursor/mcp.json`.
- **VS Code:** add to `.vscode/mcp.json` — VS Code asks for the token and stores it securely:
```json
{
"inputs": [{ "type": "promptString", "id": "datawrapper_api_key", "description": "Datawrapper API token", "password": true }],
"servers": {
"datawrapper": {
"command": "npx",
"args": ["-y", "datawrapper-mcp"],
"env": { "DATAWRAPPER_API_KEY": "${input:datawrapper_api_key}" }
}
}
}
```
- **Windsurf:** add the JSON above to `~/.codeium/windsurf/mcp_config.json`.
- **Codex:** `codex mcp add datawrapper --env DATAWRAPPER_API_KEY=your-token -- npx -y datawrapper-mcp`
- **Goose:** `goose configure` → Add Extension → Command-line Extension → command `npx -y datawrapper-mcp`, environment variable `DATAWRAPPER_API_KEY`.
</details>
## 🌐 Self-host a remote server
For your own domain or a private team deployment, run the same server over Streamable HTTP behind a public HTTPS URL. Users connect once through OAuth: the consent page asks for their own Datawrapper token, which is kept only inside encrypted, stateless access tokens — it never reaches the model and no database is needed.
```bash
docker build -t datawrapper-mcp .
docker run -p 3000:3000 \
-e PUBLIC_URL=https://dw-mcp.example.com \
-e OAUTH_SECRET="$(openssl rand -base64 32)" \
datawrapper-mcp
```
Then add `https://dw-mcp.example.com/mcp` as a custom connector (claude.ai: Settings → Connectors).
<table>
<tr><th>OAuth (recommended)</th><th>Local single user</th></tr>
<tr>
<td>
```json
{ "type": "http", "url": "https://dw-mcp.example.com/mcp" }
```
</td>
<td>
```bash
MCP_AUTH=none HOST=127.0.0.1 \
DATAWRAPPER_API_KEY=your-token \
npx -y datawrapper-mcp --http
```
</td>
</tr>
</table>
Endpoints: `/mcp`, `/.well-known/oauth-protected-resource/mcp`, `/.well-known/oauth-authorization-server`, `/authorize`, `/token`, `/register`, `/server-card`, `/privacy`, `/healthz`. On Fly.io, [`fly.toml`](fly.toml) is a ready config (one always-on machine; `fly deploy --ha=false`).
## ⚙️ Configuration
For local and self-hosted servers (the hosted server uses the defaults).
| Variable | Default | Description |
| ------------------------ | ---------------------- | ------------------------------------------------------------------------------------------- |
| `DATAWRAPPER_API_KEY` | — | Datawrapper API token (stdio and `MCP_AUTH=none`) |
| `DW_MCP_INSTRUCTIONS` | — | House style added to the server instructions, e.g. *“Always use theme X, byline Data Team”* |
| `DW_PREVIEW` | `auto` | PNG preview after create/update: `auto`, `always`, `never` |
| `DW_REQUIRE_ELICITATION` | `false` | `true` = publish/unpublish/delete only through the client's confirmation dialog |
| `DW_EXPORT_DIR` | `./exports` | Where `export_chart(save_to)` writes files (stdio only) |
| `PUBLIC_URL` | `http://HOST:PORT` | Public base URL of the HTTP server (OAuth issuer and resource) |
| `OAUTH_SECRET` | ephemeral on localhost | ≥ 32-byte secret for token encryption; keep it stable across restarts and instances |
| `HOST` / `PORT` | `127.0.0.1` / `3000` | Bind address (`0.0.0.0` in Docker) |
| `TRUST_PROXY_HOPS` | `0` | Number of reverse proxies in front of the server (for client-IP rate limits) |
| `RATE_LIMIT_PER_MINUTE` | `240` | Requests per minute per token on `/mcp` |
| `ALLOW_RAW_TOKENS` | `false` | Accept a Datawrapper token directly as `Bearer` — private deployments only |
| `ALLOWED_HOSTS` | — | Extra `Host` header names (reverse proxies) |
| `IMPRINT_URL` | — | Operator's imprint / legal notice, linked from every page (HTTP) |
| `PRIVACY_URL` | built-in `/privacy` | Your own privacy policy; `/privacy` then redirects there (HTTP) |
## 🏗️ Architecture
```mermaid
flowchart LR
client["MCP client<br/>Claude · VS Code · Cursor …"] -- "stdio or Streamable HTTP + OAuth" --> server["Datawrapper MCP V2"]
server -- "REST API v3" --> dw[("Datawrapper")]
server -- "ui:// resource" --> viewer["Chart viewer<br/>(MCP App)"]
server -- "skill://" --> skills["8 skills"]
```
The option catalog in `src/catalog/` comes from Datawrapper's own `defaultMetadata` per chart type plus key usage in public charts ([`scripts/harvest-catalog.ts`](scripts/harvest-catalog.ts)); styling, validation, `describe_chart_type` and the skill references are all generated from it.
## 🔒 Security
> [!IMPORTANT]
> Your Datawrapper token never appears in tool schemas, results or logs. On a remote server it exists only inside AES-256-GCM-encrypted tokens.
- **Confirmation for consequential actions** — publish, unpublish and delete need the user's OK: an explicit `user_confirmed` flag after they agreed in the chat, otherwise the client's confirmation dialog (MCP elicitation); `DW_REQUIRE_ELICITATION=true` allows the dialog only. Deleting goes to the trash first.
- **OAuth 2.1** — PKCE (S256), single-use codes, audience-bound 1 h access tokens, refresh tokens re-checked against Datawrapper, Client ID Metadata Documents and dynamic registration.
- **Hardening** — Host/Origin validation (DNS rebinding), per-token and per-IP rate limits (claude.ai's shared egress gets its own tier), strict CSP on the consent page, no token passthrough by default.
- **Limits of the stateless design** — refresh-token reuse is not detected, and single-use codes are tracked per instance. Revoke access any time by deleting the token in Datawrapper.
## ❓ FAQ
**How is this different from [palewire/datawrapper-mcp](https://github.com/palewire/datawrapper-mcp)?**
It covers all 25 chart types (not 8), maps and tables, maps semantic styling to each type, adds annotations, basemap search, region matching, dry runs, a chart viewer, skills and a self-hostable OAuth server — and it is written in TypeScript on the MCP 2026-07-28 SDK.
**Hosted or local?**
Hosted (`https://datawrapper-mcp.alpacatools.org/mcp`) for almost everyone: no install, works in web and mobile clients, always up to date. [Run locally](#-run-locally) to keep the token on your machine, save exports to disk or add house rules; [self-host](#-self-host-a-remote-server) for your own domain.
**Does it cost anything?**
No. The hosted server and the code (MIT) are free. Datawrapper's API is free for 500 chart creations, 1,000 publishes and 3,000 exports per workspace and month; previews count as exports. The server validates before calling the API and caches previews, so failed calls cost nothing.
**My map shows grey regions.**
Those regions didn't match the basemap. Run `match_regions` — it shows unmatched values with suggestions — or use codes (ISO, AGS, FIPS) instead of names.
**Can I use my team's theme and folders?**
Yes: new charts use your team's default theme; ask for another one or a folder by name (see `list_themes`, `list_folders`). Fixed house rules for every chart go into `DW_MCP_INSTRUCTIONS` on a local or self-hosted server.
**The assistant can't publish.**
Publishing needs a confirmation. In clients without a confirmation dialog, tell the assistant explicitly that it may publish.
## 🧑💻 Development
```bash
npm install
npm run dev # stdio server from source
npm test # unit + in-process integration tests
npm run e2e # live tests against Datawrapper (reads .env, cleans up after itself)
npm run build # MCP App (single HTML file) + server
npx tsx scripts/gen-readme-tools.ts # refresh the tools section above
npx tsx scripts/gen-readme-gallery.ts # re-render the gallery (uses API quota)
npx vite --config app/harness/vite.config.ts # chart-viewer dev harness (http://localhost:5199)
```
The harness replays a sample result by default. Open `http://localhost:5199/?live=<chart_id>` to drive the viewer against your local server and a real chart: every button calls the real tools (Publish really publishes), and the token from `.env` stays in the Vite process. `?n=2` mounts two viewers (supersession), `?theme=dark` starts dark, `?fs=0` hides the fullscreen control.
Contributions are welcome — please run `npm run lint && npm test` before opening a pull request. See [CHANGELOG.md](CHANGELOG.md) for releases.
## 📄 License
[MIT](LICENSE) © Jonathan Hornung
TDQS
Scored across 28 tools
Most tools target a distinct resource and action, such as chart lifecycle, folder management, comments, map preparation, and guidance. Some boundaries blur: publish_chart and get_embed_code both return embed codes, preview_chart and export_chart both render output, and analyze_data and describe_chart_type both recommend chart types. Descriptions usually clarify these overlaps, so serious misselection is unlikely.
Tool names are consistently lower_snake_case and predominantly follow a verb_noun pattern. The main exception is whoami, with open_in_editor being slightly longer but still readable. The convention is predictable overall.
At 28 tools, the surface is heavy, exceeding the 16-25 range and nearly double the well-scoped 3-15 range. Many tools earn their place given Datawrapper's breadth, but overlapping render/embed helpers and niche utilities suggest consolidation opportunities.
Core chart lifecycle is strong: create, read/search, update, preview, publish/unpublish, delete/restore, copy/move, export, embed, and edit-in-editor are all covered. Folders have CRUD plus copy, and map helpers cover basemap search and region matching. The main gap is comments, which support add/get but not resolve, edit, or delete, and there is no team management beyond moving/copying into teams.