mcp-abacus is a high-precision calculator MCP server for language models. Its positioning is not "calculating a number for a person," but "calculating a trustworthy, reason-about-able number for a language model": is the result an exact value or a rounded approximation? At what order of magnitude? Could a wider type preserve more digits? Will it overflow the way production code does? A floating-point answer that merely looks precise is worse than no answer, because it launders rounding error into a confident assertion. mcp-abacus is built precisely for this kind of caller.
Main capability: type-faithful computation The user chooses a numeric type/mode (fixed-point, IEEE-754 double precision, exact rational, complex), and the entire expression runs exactly according to how that type behaves in real code—where the type rounds, it rounds; where the type is exact, it stays exact; the result is passed through bit for bit. Every answer comes with a precision determination (exact vs inexact, rounded to N decimal places), so the model does not have to guess whether the result is the true value. It does not approximate the type; it computes directly using that type.
calculate—evaluates a single expression according to a single numeric type. Modes include:
- fixed-point (default): exact scaled integers, suitable for currency/ERC-20 safety scenarios;
- floating-point: IEEE-754 double precision (aliases float64, double);
- rational: exact numerator/denominator, no silent rounding;
- complex: a + bi based on two fixed-point parts, with the imaginary unit written as 1i (for example 3+4i, 2.5i). Complex numbers support exact + - * ((3+4i)(1+2i) → -5+10i, sqrt(-1) → 1i), while / and transcendental functions round onto the grid; ordering, bitwise operations, integer operations (gcd/factorial), and solvers are not supported.
Vectors and statistics: vector literals [a, b, …] build a one-dimensional numeric list according to the selected mode (for example [1, 2, 3], the empty vector [], or [1+1, 2*3] → [2, 6]); it is an internal container, not a selectable mode. The entire family of statistical functions reduces over the elements of a single vector—min/max/avg/median/variance/stddev/sumsq/geomean/harmean (avg([1, 2, 3]) → 2, sumsq([1, 2, 3]) → 14, geomean([4, 9]) → 6), and integer reductions gcd/lcm behave the same way (gcd([54, 24, 6]) → 6). Order statistics take a leading point position and then the data (a sequence or a single vector): quantile(q, …) has q in [0, 1], percentile(p, …) has p in [0, 100], and reads the value at that quantile (type-7 linear interpolation); it is a generalization of median—percentile(50, [1, 2, 3, 4]) is the median. covariance(x, y) and correlation(x, y) take two equal-length vectors (covariance([1, 2, 3], [4, 5, 6]), and Pearson correlation(...) with values in [-1, 1]). In the opposite direction, factor(n) produces a vector—the prime factors of a positive integer in ascending order with multiplicity (factor(12) → [2, 2, 3], factor(1) → []). Apart from that, vectors can only be constructed and rendered—other operators and functions reject vectors, indexing (b[i]) is unsupported, and nesting ([[1,2],[3,4]]) is rejected.
analyze—evaluates an expression and returns its full parse tree, with each node annotated with the value it computed, so you can see where an unexpected result was rounded or overflowed (for example, (1 + 1/2) * 3 equals 3 in fixed-point mode—the parse tree will show the leaf 1/2 = 0 to explain it).
solver—finds the value of one or more variables in a given interval so that an expression reaches a target: find-root (x**2 - 2 on [0, 2] → √2) or find-minimum / find-maximum, using the same numeric types and expression language (constants come from name = expr assignment lines). For a single unknown it uses golden-section search (or Brent's parabolic method via algorithm="brent-parabolic", usually faster on smooth extrema, or plain ternary search via algorithm="ternary-search"; for extrema only, Newton's method is also available via algorithm="newton-optimise", which followsto the zero of the target's own slope and lands on a quadratic in one step; for root finding, sign-change bracketing algorithms algorithm="bisection", "ridders", "brent-dekker", "chandrupatla", and "secant" are available, or the bracketing-free algorithm="newton-raphson" / "halley", which follow the expression's own derivative and can therefore also reach roots that merely touch zero); multiple variables can be solved jointly via variables (a name → [lower bound, upper bound] mapping) together with the multivariate engines—algorithm="nelder-mead" is the derivative-free Nelder-Mead simplex (suitable for arbitrary objectives), algorithm="powell" is Powell's direction-set method, also derivative-free and usually the most economical on smooth objectives, or algorithm="bfgs" is quasi-Newton gradient descent (extrema only, with far fewer iterations on smooth bowl-shaped problems).
curve_fit—fits a known curve form to paired (x, y) observations and reports each fitted equation along with its error. After you pass in data, it estimates the parameters that best match the following forms in the least-squares sense: straight line, quadratic, cubic, power law ax**b, exponential aexp(bx), reciprocal exponential (Arrhenius) aexp(b/x), logarithmic a + bln(x), square root asqrt(x) + b, reciprocal a/x + b, sine asin(bx + c) + d, Gaussian aexp(-(x-b)**2/(2c2)), saturating x/(ax + b) (Michaelis-Menten), hyperbolic 1/(ax + b), Laurent a + bx + c/x, Hoerl abxx**c, Weibull CDF 1 - exp(-(x/a)**b), logistic a/(1 + exp(-(bx + c))) (upper limit a fixed by the data), generalized hyperbolic 1/(ax**2 + bx + c), and Lorentzian peak a/(1 + ((x-b)/c)**2). Polynomial and affine forms are solved in closed form via the normal equations, power, exponential, and reciprocal-exponential laws via log-linearization, and Gaussian and Hoerl by fitting a logarithmic-space basis (Gaussianusing the Caruana method), Weibull via the double-logarithmic Weibull plot, logistic via logit after the upper bound is fixed, saturating and hyperbolic via reciprocal straight-line transforms (generalized hyperbolic and Lorentzian via reciprocal quadratic), sine (the only form with no closed-form solution) via iterative frequency search; then sorts by residual error and returns the best three (e.g. x=[1,1.5,2], y=[2,5.8,8.9] → 6.9*x - 4.78…). The entire fit runs in the chosen numeric type, so parameters and errors also carry the usual precision determination.
help—a syntax and type reference provided to the model on demand. info—server version and environment information.
Every calculate result is self-describing: a rendered value string with embedded precision determination, plus structured exact/precision fields. Inexact fixed-point results even preview what a few more decimals would reveal, steering callers toward higher precision instead of being misled by floating point.
Installation and registration with Claude Code: Install the server as a uv tool from this checkout directory. This places an mcp-abacus executable on your PATH. Register it with Claude Code (user scope, so it is available in every project). Then start (or /mcp reconnect) a Claude Code session—the abacus tool is then available. Use the appropriate command to verify the server has started. Upgrading from source: versions are pinned, so a simple reinstall may reuse a cached wheel and silently install stale code. Force a clean rebuild. Long-running Claude sessions retain the old server subprocess until you /mcp reconnect or start a new session.
mcp-abacus is free open-source software the author develops in their spare time. Sponsorships are what keep the project alive and maintained—they fund new numeric modes, bug fixes, and ongoing support, and are a direct signal that this work is worth continuing. If the project is useful to you, consider sponsoring it through GitHub Sponsors. Click the Sponsor button at the top of the repository or go directly to the link, and choose a one-time or recurring tier.
License: GNU General Public License v3.0 or later (GPL-3.0-or-later). See LICENSE for details.
Some specific details involved in the above introduction, such as installation commands and repository addresses, were not fully provided in the original material and are therefore not provided here for now.