A Model Context Protocol (MCP) server for creating Datawrapper charts using AI assistants
Project description
A Model Context Protocol (MCP) server that enables AI assistants to create Datawrapper charts. Built on the datawrapper Python library with Pydantic validation.
Example Usage
Here's a complete example showing how to create, publish, update, and display a chart by chatting with the assistant:
"Create a datawrapper line chart showing temperature trends with this data:
2020, 15.5
2021, 16.0
2022, 16.5
2023, 17.0"
# The assistant creates the chart and returns the chart ID, e.g., "abc123"
"Publish it."
# The assistant publishes it and returns the public URL
"Update chart with new data for 2024: 17.2°C"
# The assistant updates the chart with the new data point
"Make the line color dodger blue."
# The assistant updates the chart configuration to set the line color
"Show me the editor URL."
# The assistant returns the Datawrapper editor URL where you can view/edit the chart
"Show me the PNG."
# The assistant embeds the PNG image of the chart in its contained response.
"Suggest five ways to improve the chart."
# See what happens!
Getting Started
Requirements
- A Datawrapper account (sign up at https://datawrapper.de/signup/)
- An MCP client such as Claude or OpenAI Codex
- Python 3.10 or higher
- A Python package installer such as pip or uvx
Get Your API Token
- Go to https://app.datawrapper.de/account/api-tokens
- Create a new API token
- Add it to your MCP configuration as shown below
Installation
Claude Code
Using uvx (recommended)
Configure your MCP client in claude_desktop_config.json:
{
"mcpServers": {
"datawrapper": {
"command": "uvx",
"args": ["datawrapper-mcp"],
"env": {
"DATAWRAPPER_ACCESS_TOKEN": "your-token-here"
}
}
}
}
Using pip
First install the package:
pip install datawrapper-mcp
Then configure your MCP client in claude_desktop_config.json:
{
"mcpServers": {
"datawrapper": {
"command": "datawrapper-mcp",
"env": {
"DATAWRAPPER_ACCESS_TOKEN": "your-token-here"
}
}
}
}
OpenAI Codex
CLI with uvx
Add this to ~/.codex/config.toml:
[mcp_servers.datawrapper]
args = ["datawrapper-mcp"]
command = "uvx"
startup_timeout_sec = 30
[mcp_servers.datawrapper.env]
DATAWRAPPER_ACCESS_TOKEN = "your-token-here"
CLI with pip
First install the package:
pip install datawrapper-mcp
Then add this to ~/.codex/config.toml:
[mcp_servers.datawrapper]
command = "datawrapper-mcp"
startup_timeout_sec = 30
[mcp_servers.datawrapper.env]
DATAWRAPPER_ACCESS_TOKEN = "your-token-here"
Secure secrets
For enhanced security, you can configure a pass-through environment variable by ensuring that DATAWRAPPER_ACCESS_TOKEN is set in your environment, and replacing this in your config.toml:
[mcp_servers.datawrapper.env]
DATAWRAPPER_ACCESS_TOKEN = "your-token-here"
With this:
env_vars = ["DATAWRAPPER_ACCESS_TOKEN"]
This ensures that the value set for DATAWRAPPER_ACCESS_TOKEN in your environment is passed through to Codex without having to store the secret as text in a config file.
Desktop application
If you're using the Codex Desktop Application, you can set up the MCP in your settings under MCP servers:
- Under Custom servers, click
Add server - Under Name, enter
datawrapper-mcp - Select STDIO
- Under Command to launch, type
uvx(you must have uv installed) - Under Arguments, add
datawrapper-mcp - Under Environment variables, add
DATAWRAPPER_ACCESS_TOKENas the key and your token as the value - Click Save
Kubernetes Deployment
For enterprise deployments, this server can be deployed to Kubernetes using HTTP transport:
Building the Docker Image
docker build -t datawrapper-mcp:latest .
Running with Docker
docker run -p 8501:8501 \
-e DATAWRAPPER_ACCESS_TOKEN=your-token-here \
-e MCP_SERVER_HOST=0.0.0.0 \
-e MCP_SERVER_PORT=8501 \
datawrapper-mcp:latest
Environment Variables
DATAWRAPPER_ACCESS_TOKEN: Your Datawrapper API token (required)MCP_SERVER_HOST: Server host (default:0.0.0.0)MCP_SERVER_PORT: Server port (default:8501)MCP_SERVER_NAME: Server name (default:datawrapper-mcp)
Health Check Endpoint
The HTTP server includes a /healthz endpoint for Kubernetes liveness and readiness probes:
curl http://localhost:8501/healthz
# Returns: {"status": "healthy", "service": "datawrapper-mcp"}
Kubernetes Configuration Example
apiVersion: apps/v1
kind: Deployment
metadata:
name: datawrapper-mcp
spec:
replicas: 1
selector:
matchLabels:
app: datawrapper-mcp
template:
metadata:
labels:
app: datawrapper-mcp
spec:
containers:
- name: datawrapper-mcp
image: datawrapper-mcp:latest
ports:
- containerPort: 8501
env:
- name: DATAWRAPPER_ACCESS_TOKEN
valueFrom:
secretKeyRef:
name: datawrapper-secrets
key: access-token
livenessProbe:
httpGet:
path: /healthz
port: 8501
initialDelaySeconds: 5
periodSeconds: 30
readinessProbe:
httpGet:
path: /healthz
port: 8501
initialDelaySeconds: 5
periodSeconds: 10
---
apiVersion: v1
kind: Service
metadata:
name: datawrapper-mcp
spec:
selector:
app: datawrapper-mcp
ports:
- protocol: TCP
port: 8501
targetPort: 8501
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file iflow_mcp_palewire_datawrapper_mcp-1.0.0.tar.gz.
File metadata
- Download URL: iflow_mcp_palewire_datawrapper_mcp-1.0.0.tar.gz
- Upload date:
- Size: 180.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ffb10a4c9147a780ab593297c3a5454021961c5b708ffbf8dcbd8b3c19519023
|
|
| MD5 |
94c3f561bb3654630aff3c57a86257cd
|
|
| BLAKE2b-256 |
2a396559bbc7cf49863020f9dd88baf67e120f10872a2f01f48d9e64c87451db
|
File details
Details for the file iflow_mcp_palewire_datawrapper_mcp-1.0.0-py3-none-any.whl.
File metadata
- Download URL: iflow_mcp_palewire_datawrapper_mcp-1.0.0-py3-none-any.whl
- Upload date:
- Size: 18.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c6ffa7f0a7c8127e225ab2ad873483841cf4f94090f03cc922c9fb65fcaad7f2
|
|
| MD5 |
3f74a5ce849b794a6d7183328115c387
|
|
| BLAKE2b-256 |
c5da2ca407449771801340dad4ffeedb3405bd8a394e7bc3a36778135dcc15fb
|