Metadata-Version: 2.4
Name: datawrapper-mcp
Version: 0.0.7
Summary: A Model Context Protocol (MCP) server for creating Datawrapper charts using AI assistants
Author-email: Ben Welsh <b@palewi.re>
License: MIT
Project-URL: Maintainer, https://github.com/palewire/
Project-URL: Source, https://github.com/palewire/datawrapper-mcp/
Project-URL: Issues, https://github.com/palewire/datawrapper-mcp/issues/
Keywords: datawrapper,mcp,model-context-protocol,charts,visualization,ai
Classifier: Development Status :: 5 - Production/Stable
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: License :: OSI Approved :: MIT License
Classifier: Intended Audience :: Developers
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: datawrapper>=2.0.7
Requires-Dist: exceptiongroup; python_version < "3.11"
Requires-Dist: mcp[cli]>=1.20.0
Requires-Dist: pandas>=2.0.0
Provides-Extra: dev
Requires-Dist: pre-commit; extra == "dev"
Requires-Dist: setuptools-scm; extra == "dev"
Provides-Extra: test
Requires-Dist: pytest>=7.0.0; extra == "test"
Requires-Dist: pytest-asyncio>=0.21.0; extra == "test"
Requires-Dist: pytest-runner; extra == "test"
Requires-Dist: pytest-cov; extra == "test"
Requires-Dist: pytest-env; extra == "test"
Requires-Dist: pytest-vcr; extra == "test"
Requires-Dist: pytest-xdist; extra == "test"
Provides-Extra: docs
Requires-Dist: sphinx; extra == "docs"
Requires-Dist: sphinx-autobuild; extra == "docs"
Requires-Dist: sphinxcontrib-mermaid; extra == "docs"
Requires-Dist: myst-parser; extra == "docs"
Requires-Dist: sphinx-palewire-theme; extra == "docs"
Provides-Extra: mypy
Requires-Dist: mypy; extra == "mypy"
Provides-Extra: notebooks
Requires-Dist: jupyterlab; extra == "notebooks"
Requires-Dist: ipywidgets; extra == "notebooks"
Requires-Dist: rich; extra == "notebooks"
Requires-Dist: pandas; extra == "notebooks"
Requires-Dist: pyarrow; extra == "notebooks"
Requires-Dist: xlrd; extra == "notebooks"
Requires-Dist: openpyxl; extra == "notebooks"
Requires-Dist: altair; extra == "notebooks"
Dynamic: license-file

A Model Context Protocol (MCP) server that enables AI assistants to create Datawrapper charts. Built on the [datawrapper Python library](https://github.com/chekos/datawrapper) with Pydantic validation.

## Getting Started

### Get Your API Token

1. Go to https://app.datawrapper.de/account/api-tokens
2. Create a new API token
3. Add it to your MCP configuration as shown above

### Installation

#### Using uvx (Recommended)

Configure your MCP client to run the server with `uvx` in `claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "datawrapper": {
      "command": "uvx",
      "args": ["datawrapper-mcp"],
      "env": {
        "DATAWRAPPER_ACCESS_TOKEN": "your-token-here"
      }
    }
  }
}
```

#### Using pip

```bash
pip install datawrapper-mcp
```

Then configure your MCP client:

```json
{
  "mcpServers": {
    "datawrapper": {
      "command": "datawrapper-mcp",
      "env": {
        "DATAWRAPPER_ACCESS_TOKEN": "your-token-here"
      }
    }
  }
}
```

## 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!
```
