Exact symbolic math for LLMs: integrals, equations, matrices, and claim verification via Giac/Xcas. MCP server + CLI.
Axiom — Advanced Math MCP Server
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
Exact symbolic and numerical mathematics for LLMs — a real computer algebra
system (Giac/Xcas) behind the Model Context Protocol, and behind a shell
command. Published as **axiom-math**.
Quick start
As a CLI, straight away:
As an MCP server, in any client's config:
As an agent skill — drop in skills/axiom-math/SKILL.md,
which teaches an agent the three commands and their exit codes.
Why Axiom?
LLMs often make calculation errors, especially with symbolic math, exact fractions, and multi-step problems. Axiom provides **verified, exact results** through two layers:
- **math.js** — Fast numerical evaluation (arithmetic, trigonometry, matrices)
- **Giac/Xcas WASM** — Symbolic computation (calculus, algebra, equation solving)
Benchmark Results (GLM-5.1, May 2026)
| Dataset | Baseline | +MCP | Delta |
| ----------------- | -------- | ------- | --------- |
| GSM8K (100) | 96.0% | 98.0% | +2.0% |
| MATH L3 (50) | 70.0% | 80.0% | +10.0% |
| MATH L4 (50) | 50.0% | 62.0% | +12.0% |
| MATH L5 (50) | 38.0% | 52.0% | +14.0% |
| CAS-quick (60) | 55.0% | 70.0% | +15.0% |
| Omni-MATH ≥7 (50) | 0.0% | 0–4% | (ceiling) |
**Key insights:**
- Phase 0 grader (LaTeX/Unicode normalization + symbolic equivalence) is the dominant value driver across all datasets
- CAS-quick lifted from 26.7% (April pre-grader) to 70% (post-grader) — the biggest single jump
- Omni-MATH ≥7 is at ceiling for current LLM+CAS setups; needs fundamentally different approaches (Lean/Coq, fine-tuning, RAG)
Full results: benchmark/results/ and docs/superpowers/specs/ (per-phase analysis)
---
Features
Axiom exposes **3 MCP tools**. Almost everything flows through compute, a single gateway that parses a CAS-style problem string and routes it to the right internal engine — so callers learn one tool, not dozens.
| Tool | Purpose |
| --------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| compute | Solve any math problem. Pass a CAS-style string (solve(...), diff(...), det([[...]]), C(10,3), 2+3*sin(pi/4)) or any Giac/Xcas expression. |
| verify | Independently check a mathematical claim (identity, solution, or computation) via symbolic and/or numeric methods. |
| plot | Render a 2D function graph as an SVG image. |
What compute covers
compute recognizes CAS-style verbs and dispatches across these domains. Anything it doesn't recognize falls through to raw Giac/Xcas evaluation.
| Domain | Verbs / examples |
| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Arithmetic & units | 2+3*sin(pi/4), 100 km/h to m/s |
| Equation solving | solve(x^2-4=0, x), csolve(...) (complex), solve_system([x+y=5, x-y=1], [x,y]) |
| Calculus | diff, int, limit, taylor, desolve (ODEs of any order, and linear constant-coefficient systems) |
| Multivariable calculus | gradient, hessian, jacobian, divergence, curl, partial, iint/iiint (multiple integrals), critical_points, lagrange, tangent_plane, directional_derivative |
| Algebra | factor, simplify, expand, partfrac |
| Linear algebra | det, inv, eigenvals, eigenvects, rref, rank, tran, ker, qr, lu, cholesky, svd, norm, cond |
| Number theory | ifactor, isprime, euler, analyze |
| Combinatorics | C(n,k), P(n,k), stirling, bell, catalan, derangements, multinomial |
| Probability | binomial, normal, poisson, geometric, hypergeometric, chi_square, student_t, f_distribution, beta, exponential |
| Hypothesis testing | t_test (one/two/paired), anova, chi_square_test |
| Numerical methods | newton, bisection, secant, romberg, simpson |
| 2D geometry | distance, midpoint, slope, area_*, perimeter, circumference, line_intersection, point_line_distance, angle_between_lines |
| 3D geometry | distance3d, midpoint3d, dot, cross, vector_norm, angle_vectors, plane_from_points, point_plane_distance, line_plane_intersection, plane_plane_angle, line_line_distance, volume_tetrahedron, volume_sphere, volume_parallelepiped |
| Transforms & series | laplace, ilaplace, fourier/fft/ifft, sum, product |
| Exact values | to_exact, to_decimal, simplify_fraction |
| Regression & sequences | linear_regression/fit, polynomial_regression, sequence (pattern identification) |
---
Installation
The package is axiom-math on npm.
Nothing to install for normal use — npx fetches and caches it: