Skip to content

Releases: laszlopere/mcp-abacus

v0.5.0

Choose a tag to compare

@laszlopere laszlopere released this 07 Aug 05:34

Fifth release. No new tools this time — instead the two youngest ones grew up: the solver gained a full fleet of root finders and minimisers you can pick by name, and curve_fit went from 12 curve forms to 19.

Solver — ten new algorithms

Root finding, all in the chosen numeric type:

  • Sign-change bracketers: brent-dekker, chandrupatla and secant (joining the existing bisection and ridders), sharing one bracketing harness.
  • Derivative-following, bracket-free: newton-raphson and halley — they use the expression's own symbolic derivatives, so they also reach a root that merely touches zero and never changes sign.

Minimisation / maximisation:

  • ternary-search — the plain bracket-shrinking minimiser.
  • newton-optimise — steps to the zero of the objective's own slope; lands a quadratic in a single step.
  • bfgs — quasi-Newton gradient descent over several unknowns, far fewer iterations than a simplex on a smooth bowl.
  • powell — direction-set minimisation over several unknowns; derivative-free like Nelder-Mead, usually the cheapest of the three on a smooth objective.

Pass several unknowns to any multivariate engine with variables (a name → [lower, upper] map).

Curve fit — seven new forms (19 total)

All closed-form, each via its own linearisation:

  • Laurent a + b*x + c/x — direct linear basis {1, x, 1/x}.
  • exp-reciprocal / Arrhenius a*exp(b/x) — log-linear against 1/x.
  • Hoerl a*b**x*x**c — log-linear over the basis {1, x, ln x}.
  • Weibull CDF 1 - exp(-(x/a)**b) — the double-log Weibull plot.
  • Logistic a/(1 + exp(-(b*x + c))) — the logit, once the ceiling a is fixed from the data.
  • Generalized hyperbolic 1/(a*x**2 + b*x + c) and Lorentzian/Cauchy peak a/(1 + ((x-b)/c)**2) — a reciprocal-quadratic transform.

New functions

  • geomean / harmean — geometric and harmonic means, variadic with a vector overload.
  • sumsq — sum of squares Σ xi**2, variadic with a vector overload.
  • residual_sum_squares — least-squares cost of a model against paired data.
  • map — element-wise vector transform (a special form, like the range folds).

Fixes

  • Fixed-point ** no longer hangs the server on a fractional exponent.
  • newton-raphson / halley no longer return a root outside the bracket you gave them.

v0.4.0

Choose a tag to compare

@laszlopere laszlopere released this 29 Jun 21:18

Fourth release. Headline feature: the new curve_fit tool, plus complex and vector numeric modes and a large batch of new functions.

New tool

  • curve_fit — fit a library of 12 curve forms to paired (x, y) data and rank the best three by residual error: linear, quadratic, cubic, power, exponential, logarithmic, square-root, reciprocal, sinusoidal, gaussian, saturation (Michaelis-Menten), and hyperbolic. Closed-form least-squares wherever possible (normal equations, log/reciprocal linearisations, Caruana's method); the sinusoid uses an iterative frequency search. The whole fit runs in the chosen numeric type, so parameters and error carry the usual exact/inexact verdict.

New numeric modes

  • Complex mode over two fixed-point parts.
  • Vector type with [a, b, …] literals, and functions that reduce over a vector: min/max, the descriptive stats, covariance/correlation, gcd/lcm, percentile/quantile, and factor (prime factorisation).

Solver

  • Bisection and Ridders' root finders (sign-change bracketers).
  • Auto-detect the single unknown when variable is omitted; min_fixed_point_precision defaults to 9 so the bare fixed-point solve just works.

New functions

  • hypot, comb/perm, clamp, lerp, sign, two-arg range folds sum(i, lo, hi, expr) / product(i, lo, hi, expr), and the financial helpers pct/pct_change/bps/compound and pmt/fv/pv.

Fixes & ergonomics

  • "Did you mean…" suggestions on an unknown function/mode/algorithm.
  • Lifted CPython's 4300-digit int↔str cap so large exact results (big factorials, exact rational fits) render instead of crashing.

v0.3.0

Choose a tag to compare

@laszlopere laszlopere released this 18 Jun 20:31

Type-faithful calculator MCP server — third release. Install with uvx mcp-abacus.

Calculus & equation solving

  • diff(expr, var, at) — numerical derivative of an expression at a point
  • integral(expr, var, a, b) — definite integral over [a, b]
  • Classic solver benchmark problems added to the end-to-end suite

New language functions

  • atan2(y, x) — quadrant-aware arctangent
  • Hyperbolic and inverse-hyperbolic functions: sinh, cosh, tanh, asinh, acosh, atanh
  • gcd(...) and lcm(...) — variadic greatest-common-divisor / least-common-multiple
  • log(x, base)log overloaded to a two-argument general logarithm
  • factorial(n) — unary, capped at 1000
  • degrees(x) / radians(x) — angle conversions

Robustness

  • Tolerate LLM-mangled JSON arguments, returning actionable errors that tell the model how to fix the request

Full changelog: v0.2.0...v0.3.0

v0.2.0

Choose a tag to compare

@laszlopere laszlopere released this 17 Jun 11:05

Type-faithful calculator MCP server — second release. Install with uvx mcp-abacus.

New language functions

  • exp, log2, cbrt
  • floor, ceil, round, trunc — each taking an optional ndigits
  • asin, acos, atan
  • Optional-argument arity for trailing defaulted parameters
  • Bare pi and e usable as reserved constants

calculate & solver

  • calculate returns every output line of a multi-line program, not just the last
  • solver gains a Brent parabolic minimiser (selectable via algorithm)
  • solver requires min_fixed_point_precision in fixed-point mode (avoids silently flooring the unknown to integers)
  • solver snaps drifted floating-point answers onto clean roundings

Exactness & diagnostics

  • Fixed-point quantization error is stored and surfaced
  • analyze shows a per-node rounding <residual> ≈ <approx> fragment (renamed from error to avoid colliding with the failure channel)
  • Caller-supplied inexact-handling policy with abort-on-inexact, plus a human-readable abort message

MCP surface & metadata

  • Server instructions; every tool parameter described in its inputSchema; help's section as a schema enum
  • Language reference exposed as MCP resources
  • Documented the full set of mode aliases (incl. decimal → fixed-point); bidirectional tool cross-references
  • Trove classifiers, rational keyword, glama.json

Full changelog: v0.1.0...v0.2.0

v0.1.0

Choose a tag to compare

@laszlopere laszlopere released this 14 Jun 05:15

First public release of mcp-abacus — a pure-Python MCP server for type-faithful calculation.

Highlights

  • calculate — evaluate one expression in one numeric type: fixed-point (default), floating-point (IEEE-754 double), or rational (exact). Every result is labelled with its precision verdict (exact vs inexact, rounded to N decimals).
  • analyze — evaluate an expression and return its annotated parse tree, so you can see exactly where a result rounded or overflowed.
  • help — grammar and type reference.
  • info — server version and environment.

See the README for install and Claude Code registration.