Refuse, don't guess
If the axes cannot be calibrated, the panel comes back with data: null and a
reason code. A missing value is recoverable; a plausible wrong one is not.
Open-source MCP server · MIT
ChartDuck reads scientific figures and PDF pages, then returns panel boxes, chart
types and data series in data coordinates. When it cannot calibrate an axis, it returns
null — never a guessed table.
01 / Demo
The figure below was drawn for this page. The output next to it is a real response from the extraction engine — no mock-up, no hand-tuned numbers.
{
"panels": [{
"box": [119.0, 25.0, 1139.0, 719.0],
"chart_type": "line",
"why": null,
"axis": {
"x": {"model": "lin", "a": 46.29, "b": 165.1},
"y": {"model": "lin", "a": -11.524, "b": 719.113}
},
"axis_labels": {
"x": null,
"y": {"text": "Response (a.u.)", "score": 1.0}
},
"data": {
"x_units": "value", "y_units": "value",
"series": [{
"kind": "line",
"points": [[-0.1318, 12.0716], [-0.1102, 12.0716], ...]
}]
}
}]
}
| x | y |
|---|
938 points were returned; the redraw samples 68 of them. The x-axis title was
not recognized, so axis_labels.x is null — the engine reports the miss
instead of inventing a label. Series values land within roughly 0.2 units of the plotted data.
02 / Why
If the axes cannot be calibrated, the panel comes back with data: null and a
reason code. A missing value is recoverable; a plausible wrong one is not.
Panels are located inside full pages and multi-panel figures, not just clean crops. PDFs are processed page by page; value-less panels return geometry only.
Two tools with typed inputs and structured errors, so Claude Code, Cursor and other MCP clients can call extraction without bespoke glue code.
03 / Integrate
The MCP server, CLI and SDK are thin clients over the same REST endpoints. Requests carry raw image bytes; the client guesses the content type from magic bytes.
Claude Code, then a generic JSON config for other MCP clients.
claude mcp add chartduck -- chartduck-mcp
{
"mcpServers": {
"chartduck": {
"command": "chartduck-mcp",
"env": {
"CHARTDUCK_API_URL": "https://api.chartduck.com",
"CHARTDUCK_TOKEN": "..."
}
}
}
}
Same client, from a terminal.
pip install chartduck-mcp export CHARTDUCK_API_URL=https://api.chartduck.com export CHARTDUCK_TOKEN=... chartduck extract figure.png -o figure.json chartduck extract-pdf paper.pdf --pages 1-3 -o paper.json chartduck health
Stdlib-only REST client; the only dependency is mcp for the server.
from chartduck_client import ChartDuck
client = ChartDuck() # reads CHARTDUCK_API_URL / CHARTDUCK_TOKEN
result = client.extract_image_file("figure.png")
for panel in result["panels"]:
print(panel["chart_type"], panel.get("data"))
Call the service directly; the body is the image itself, not base64.
curl -X POST "$CHARTDUCK_API_URL/extract" \ -H "X-Chartduck-Token: $CHARTDUCK_TOKEN" \ -H "Content-Type: image/png" \ --data-binary @figure.png
04 / Capabilities
Chart types are detected per panel. Values are returned in data coordinates when both axes calibrate; otherwise the panel is reported without numbers.
The notes column scrolls sideways on narrow screens.
| Chart type | Extraction | Notes |
|---|---|---|
| Vertical bar | Yes | Single and grouped bars; category labels where legible |
| Line | Yes | Up to 2000 points per series, evenly thinned |
| Scatter | Yes | Filled and hollow markers |
| Vertical box plot | Yes | Quartiles and whiskers |
| Horizontal bar | Yes | Category names when legible |
| Scatter with a connecting line | Partial | Often read as one of the two pure types |
| Pie, heatmap, 3D, radar | Refused | Reported as unsupported rather than approximated |
| Panels without a value axis | Geometry | normalized_box units, no fabricated values |
invalid_input, unauthorized, quota_exceeded,
too_large, unsupported_format, unreadable,
rate_limited, upstream_error.
05 / Benchmarks
Numbers below come from a held-out set of public ICPR2022-style documents. They are published so you can decide whether the tool is good enough for your task.
data: nullThe evaluation corpus is not redistributable; the methodology and per-category results are documented in the repository README. Axis titles are beta and excluded from any support commitment.
06 / FAQ
No. The MCP server, CLI and Python client are MIT-licensed. The engine, the hosted service and the evaluation corpus are not part of the repository.
The panel is still returned, with its box, detected type and a
why code, but data is null. Request-level failures use
MCP isError results with a code: message text.
Images (PNG, JPEG, WEBP, BMP, TIFF, GIF) up to 20 MB, or PDFs up to 100 MB and 200 pages. The service decodes by content type, so extensionless files are fine.
Not currently. The client is local, but every extraction calls the hosted service. There is no self-hosted engine distribution.
They are sent to the hosted API for processing. During the pilot, treat uploads as non-confidential until a published data-retention policy says otherwise.
The hosted API is not public yet. Tokens are issued directly during the pilot; the public endpoint and signup will be announced here.