API & MCP
Everything a person can do on UnitProof Unit Calculator, a program or AI agent can do with the same inputs and get the identical result.
HTTP API
POST https://unitproof.usefulweb.site/api/v1/calculate– run UnitProof Unit CalculatorGET https://unitproof.usefulweb.site/api/v1/tool– inputs, output schema, examples- OpenAPI 3.1: /openapi.json · /openapi.yaml
- Errors:
application/problem+json;422includes per-fielderrors.
UnitProof Unit Calculator
Type an expression such as "3.5 km/h * 2 h to m", "72 F to C" or "1500 W * 3 h to kWh". UnitProof parses it, checks dimensions over the SI base units, applies exact NIST/SI conversion factors and shows every step as a derivation tree, including correct absolute-vs-difference temperature handling.
| Field | Type | Default | Description |
|---|---|---|---|
expression (required) | text | — | Expression. Numbers, units with SI prefixes, ^ powers, * / + − and parentheses; optional "to"/"in" target. Juxtaposition (e.g. "2 h") binds tighter than * and /. Bare C/F mean °C/°F. |
significantDigits | integer | 6 | Significant digits (rounded value) |
Example request
Distance: 3.5 km/h for 2 h in metres
curl -X POST https://unitproof.usefulweb.site/api/v1/calculate -H 'content-type: application/json' -d '{"expression":"3.5 km/h * 2 h to m"}'
Every result contains
inputs (normalised, defaults applied), summary, result (validated against the published schema), units, assumptions, sources, warnings, computedAt and links.
MCP (Model Context Protocol)
- Streamable HTTP endpoint:
https://unitproof.usefulweb.site/mcp– protocol revisions 2026-07-28 (stateless) and 2025-11-25 / 2025-06-18 / 2025-03-26 (initialize handshake). - Tools:
unitproof - Local stdio connector:
node src/mcp-stdio.ts --tool=unitproof
{
"mcpServers": {
"unitproof": { "type": "http", "url": "https://unitproof.usefulweb.site/mcp" }
}
}