math-mcp-ay
v0.3.0A Model Context Protocol (MCP) server exposing safe math tools.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
evaluate
Evaluate a mathematical expression and return its numeric value. Supports ``+ - * / // % **``, parentheses, the constants ``pi``, ``e``, ``tau`` and functions such as ``sqrt``, ``sin``, ``cos``, ``log``, ``exp``, ``factorial``, ``gcd``, ``hypot``. Evaluation is sandboxed: no Python ``eval`` is used and only whitelisted names are allowed. Example: ``"sqrt(2) * sin(pi / 4)"`` -> ``1.0``.
| Parameter | Type | Description |
|---|---|---|
expression * | string |
descriptive_statistics
Return summary statistics for a list of numbers. Includes count, sum, min, max, mean, median, population and sample standard deviation, and variance. Requires at least one value (sample stdev/variance require at least two and are ``null`` otherwise).
| Parameter | Type | Description |
|---|---|---|
numbers * | array |
is_prime
Return whether the integer *n* is a prime number. Uses trial division up to sqrt(n). Values below 2 are not prime.
| Parameter | Type | Description |
|---|---|---|
n * | integer |
prime_factorization
Return the prime factorization of a positive integer *n*. The result is a list of ``{"prime": p, "exponent": k}`` entries, ordered by prime. ``prime_factorization(360)`` -> 2^3 * 3^2 * 5^1.
| Parameter | Type | Description |
|---|---|---|
n * | integer |
gcd_lcm
Return the greatest common divisor and least common multiple. Accepts two or more integers, e.g. ``[12, 18, 24]``.
| Parameter | Type | Description |
|---|---|---|
numbers * | array |
solve_quadratic
Solve ``a*x^2 + b*x + c = 0`` and return its roots. Reports the discriminant and the (real or complex) roots. Requires ``a != 0``; use a linear solve otherwise.
| Parameter | Type | Description |
|---|---|---|
a * | number | |
b * | number | |
c * | number |
convert_base
Convert an integer *number* from one base to another. ``number`` is given as a string in ``from_base`` (2-36); the result is a string in ``to_base`` (2-36). Example: ``("ff", 16, 2)`` -> ``"11111111"``.
| Parameter | Type | Description |
|---|---|---|
from_base * | integer | |
number * | string | |
to_base * | integer |
matrix_multiply
Return the matrix product ``A @ B``. Columns of A must match rows of B. Matrices are lists of rows.
| Parameter | Type | Description |
|---|---|---|
a * | array | |
b * | array |
matrix_transpose
Return the transpose of a matrix.
| Parameter | Type | Description |
|---|---|---|
matrix * | array |
matrix_determinant
Return the determinant of a square matrix.
| Parameter | Type | Description |
|---|---|---|
matrix * | array |
matrix_inverse
Return the inverse of a square, non-singular matrix.
| Parameter | Type | Description |
|---|---|---|
matrix * | array |
solve_linear_system
Solve ``A x = b`` for x, where A is square and non-singular.
| Parameter | Type | Description |
|---|---|---|
a * | array | |
b * | array |
simplify_expression
Simplify a symbolic expression, e.g. ``sin(x)**2 + cos(x)**2`` -> ``1``.
| Parameter | Type | Description |
|---|---|---|
expression * | string |
expand_expression
Expand a symbolic expression, e.g. ``(x + 1)**2`` -> ``x**2 + 2*x + 1``.
| Parameter | Type | Description |
|---|---|---|
expression * | string |
factor_expression
Factor a symbolic expression, e.g. ``x**2 - 1`` -> ``(x - 1)*(x + 1)``.
| Parameter | Type | Description |
|---|---|---|
expression * | string |
differentiate
Differentiate *expression* w.r.t. *variable* (optionally to a higher *order*).
| Parameter | Type | Description |
|---|---|---|
expression * | string | |
order | integer | |
variable | string |
integrate
Return the indefinite integral of *expression* w.r.t. *variable*.
| Parameter | Type | Description |
|---|---|---|
expression * | string | |
variable | string |
solve_symbolic_equation
Solve an equation for a variable, e.g. ``"x**2 = 4"`` -> ``["-2", "2"]``. Accepts a bare expression (assumed ``= 0``) or an explicit ``=`` equation.
| Parameter | Type | Description |
|---|---|---|
equation * | string | |
variable | string |
definite_integral
Definite integral of *expression* from *lower* to *upper*. Bounds are expressions, so ``oo`` / ``-oo`` / ``pi`` are accepted.
| Parameter | Type | Description |
|---|---|---|
expression * | string | |
lower | string | |
upper | string | |
variable | string |
limit
Limit of *expression* as *variable* -> *point* (``oo`` allowed). *direction*: ``"+"`` (right), ``"-"`` (left) or ``"+-"`` (two-sided).
| Parameter | Type | Description |
|---|---|---|
expression * | string | |
direction | string | |
point | string | |
variable | string |
taylor_series
Taylor series of *expression* about *point* up to *order* terms (O-term dropped).
| Parameter | Type | Description |
|---|---|---|
expression * | string | |
order | integer | |
point | string | |
variable | string |