API & MCP

Everything a person can do on Math Workbench, a program or AI agent can do with the same inputs and get the identical result.

HTTP API

  • POST https://mathworkbench.usefulweb.site/api/v1/calculate – run Math Workbench
  • GET https://mathworkbench.usefulweb.site/api/v1/tool – inputs, output schema, examples
  • OpenAPI 3.1: /openapi.json · /openapi.yaml
  • Errors: application/problem+json; 422 includes per-field errors.

Math Workbench

A small computer algebra system: type commands such as "integrate x*e^x from 0 to 1", "derivative sin(x)^2", "solve x^2 - 5x + 6 = 0", "limit sin(x)/x as x -> 0" or "series cos(x) at 0 order 6". Results are exact (fractions, roots, π) where possible, and the tool says clearly when it falls back to a numeric answer.

Inputs of Math Workbench
FieldTypeDefaultDescription
query (required)text—Command. Commands: simplify, expand, factor, derivative (or d/dx), integrate [from a to b], solve, limit … as x -> a, evaluate … at x = 2, series … at a order n, plot f, g from a to b. Use * or juxtaposition for products (2x), ^ for powers, sqrt(), ln(), log10(), sin(), e, pi.

Example request

Definite integral by parts

curl -X POST https://mathworkbench.usefulweb.site/api/v1/calculate -H 'content-type: application/json' -d '{"query":"integrate x*e^x from 0 to 1"}'

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://mathworkbench.usefulweb.site/mcp – protocol revisions 2026-07-28 (stateless) and 2025-11-25 / 2025-06-18 / 2025-03-26 (initialize handshake).
  • Tools: math_workbench
  • Local stdio connector: node src/mcp-stdio.ts --tool=math-workbench
{
  "mcpServers": {
    "math-workbench": { "type": "http", "url": "https://mathworkbench.usefulweb.site/mcp" }
  }
}