Datawrapper MCP Server for AI Chart Creation
Create Datawrapper charts with an MCP server that uses AI assistants for fast, customizable chart generation and seamless publishing.
npx -y @palewire/datawrapper-mcpOverview
This MCP (Model Context Protocol) server lets AI assistants create, customize, and publish Datawrapper charts programmatically. It implements a lightweight HTTP service that exposes a set of tools (Datawrapper API wrappers) compatible with the MCP-style tool invocation model, enabling conversational agents or automation workflows to transform tabular data into visualizations with minimal developer effort.
The server is useful when you want to add an AI-driven charting layer to existing tooling: feed a CSV or plain-language instructions to an assistant, have it generate the right Datawrapper chart configuration, and publish or preview the result automatically. This accelerates chart production for newsrooms, analytics teams, and product integrations while keeping final publishing control and Datawrapper metadata intact.
Features
- Tool set for common Datawrapper operations: create chart, upload dataset, update metadata, publish, and list charts
- Converts plain-language chart requests into Datawrapper chart specifications
- Supports CSV or JSON data ingestion and automatic schema inference
- Configurable templates for consistent styling and publisher metadata
- Local and Docker deployment options; environment-driven configuration
- Designed for integration with LLMs and any MCP-compatible assistant client
Installation / Configuration
Prerequisites: Node.js (16+), npm or Docker.
Quick start (local):
# clone the repo
# install
# copy example env and edit
# set DATAWRAPPER_API_KEY and any other variables in .env
# run
Example .env (minimal):
PORT=3000
DATAWRAPPER_API_KEY=your_datawrapper_api_key_here
DEFAULT_PUBLISHER_ID=your_publisher_id
LOG_LEVEL=info
Docker (build & run):
# build image
# run container with env vars
Environment variables (common):
| Variable | Required | Description |
|---|---|---|
| DATAWRAPPER_API_KEY | yes | API key for your Datawrapper account |
| DEFAULT_PUBLISHER_ID | no | Default publisher / organization ID for created charts |
| PORT | no | HTTP port to listen on (default: 3000) |
| LOG_LEVEL | no | Logging verbosity (e.g. info, debug) |
After starting, the server exposes an HTTP endpoint that your MCP-compatible assistant or other automation can call. See the Available Tools section for supported operations and expected inputs.
Available Tools
The server exposes a collection of high-level tools (usable by assistants) that wrap Datawrapper REST API operations. Each tool accepts structured inputs and returns structured results for deterministic integration.
- create_chart
- Inputs: title, chartType, dataset (CSV or array), metadata (axes, labels, theme)
- Output: chart id, draft URL, JSON metadata
- upload_dataset
- Inputs: chartId or new chart template, dataset (CSV or JSON)
- Output: success flag, row/column summary
- update_metadata
- Inputs: chartId, metadata patch (title, description, annotations, source)
- Output: updated metadata
- publish_chart
- Inputs: chartId, publishOptions (public/private, publisherId)
- Output: public URL, published flag
- list_charts
- Inputs: optional filters (publisherId, title)
- Output: array of charts (id, title, status, preview)
- generate_spec
- Inputs: chartType, datasetPreview, visualIntent (what to emphasize)
- Output: Datawrapper chart JSON config (visualization settings)
Each tool returns JSON with a consistent schema so assistant logic can read results and continue a multi-step flow (for example: create_chart -> upload_dataset -> publish_chart).
Use Cases
- Newsroom: Convert daily CSV exports (e.g., COVID cases, election returns) into consistent, branded charts. Workflow: upload CSV -> generate_spec -> create_chart -> publish_chart -> embed link in CMS.
- Data analyst assistant: Non-technical staff paste a spreadsheet and ask “Make a bar chart comparing revenue by region.” The assistant chooses chart type, creates a draft, and returns an editable preview link.
- Scheduled reports: A cron job fetches fresh metrics, posts them to the MCP server via its API, and republishes updated charts automatically with no manual steps.
- Interactive data exploration: Integrate with a chat interface so users ask follow-up questions like “Add a moving average” or “Highlight the top three items” and the assistant edits the chart metadata or data accordingly.
Where to find the code
Source and issue tracker: https://github.com/palewire/datawrapper-mcp
For implementation details, example requests, and template configuration, check the repository README and the example assistant integrations included in the repo.