SageMath
PYPI · SAGEMATH-MCP · SCANNED OCT 3
Stateful SageMath MCP server with 40 tools and a sandboxed Sage session per client.
Available components
How this component scores in each security and reliability category. Every signal is checked automatically from public evidence about the published package, including repeated runs of it in an isolated sandbox, and we only credit what we can confirm. How we score → Why this is hard to score →
Supply Chain Security50
- Malware scan not yet available for this package.Unverified
- No known CVEs affecting this package version or its production dependencies.Pass
- Runs hatchling.build at install time, a recognised build step with no custom scripting around it. View diagnostics → Pass
- 1 of 18 dependencies flagged as unhealthy. View diagnostics → Partial
Provenance & Transparency100
- Source repository is publicly reachable at the declared URL. View diagnostics → Pass
- Cryptographically verified build provenance (signed, bound to XBP-Europe/sagemath-mcp). View diagnostics → Pass
- Clear OSI-approved license (MIT).Pass
- Actively maintained (last published 5 days ago).Pass
- Publishes a security disclosure policy (SECURITY.md).Pass
Schema Quality & AI Usability79
- 100% of prompts and resources have a non-trivial description (not blank, and not just the item's name).Pass
- AI-judged instruction clarity (excellent).Pass
- Context-footprint check failed: tool/resource definitions use about 6880 tokens (~172/item across 40 items; 40 tools + 0 resources), over budget; trim descriptions and params. See how to fix → Fail
- Usage-examples check failed: none of the tools include examples. See how to fix → Fail
Stability & Change Management87
- Stability observed for 26 of 30 days with no destabilising changes; credit accrues until the full window elapses.Partial
Tool Coverage100
- 100% of tools have a non-trivial description (not blank, and not just the tool's name).Pass
- 100% of tool parameters carry a description.Pass
- Structured output schemas are declared (93% of tools); any adoption earns full credit.Pass
Tool Safety100
- No prompt-injection markers were found in the server instructions, tool names or descriptions we captured.Pass
- All 1 tool(s) whose name or description implies an irreversible operation declare an MCP destructiveHint annotation.Pass
- An AI judge read all 41 captured unit(s) of tool text and found none that tries to manipulate the model reading it.Pass
Capabilities100
- Implements a current MCP spec version (2026-07-28).Pass
How do I install the SageMath MCP server?
SageMath runs locally as a PyPI package, launched with uvx sagemath-mcp. Ready-made configuration for Claude, Cursor, VS Code, Codex and 5 more is on this page, copied from each client's own documentation.
pypi · sagemath-mcp
claude mcp add xbp-europe-sagemath-mcp -- uvx sagemath-mcp
{
"mcpServers": {
"xbp-europe-sagemath-mcp": {
"command": "uvx",
"args": [
"sagemath-mcp"
]
}
}
} {
"servers": {
"xbp-europe-sagemath-mcp": {
"command": "uvx",
"args": [
"sagemath-mcp"
]
}
}
} codex mcp add xbp-europe-sagemath-mcp -- uvx sagemath-mcp
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"xbp-europe-sagemath-mcp": {
"type": "local",
"command": [
"uvx",
"sagemath-mcp"
],
"enabled": true
}
}
} openclaw mcp add xbp-europe-sagemath-mcp --command uvx --arg sagemath-mcp
mcp_servers:
xbp-europe-sagemath-mcp:
command: "uvx"
args: ["sagemath-mcp"] {
"McpServers": {
"xbp-europe-sagemath-mcp": {
"Transport": "stdio",
"Command": "uvx",
"Arguments": [
"sagemath-mcp"
]
}
}
} assistant mcp add xbp-europe-sagemath-mcp -t stdio -c uvx -a sagemath-mcp
{
"mcpServers": {
"xbp-europe-sagemath-mcp": {
"command": "uvx",
"args": [
"sagemath-mcp"
]
}
}
} Every change we have recorded for this component, newest first. Security-relevant changes are always shown. ▲ marks a change for the better, ▼ a change for the worse; unmarked changes are neutral.
- 3 Oct 26 −15
- Malware scan: pass → unverified ▼ security
- 2 Oct 26 +1
No change was recorded against any check on this day. Stability & Change Management went from 80 to 83. That category is still filling its 30-day observation window: 24 days of observed history at the previous scan, 25 at this one. The score rises as the window fills, whether or not the server changes.
- 1 Oct 26 −3
- Stability: fail → 0.80 functional
- 30 Sept 26 +16
- Malware scan: unverified → pass ▲ security
- 29 Sept 26 −15
- Malware scan: pass → unverified ▼ security
- 28 Sept 26 +26
- Malware scan: unverified → pass ▲ security
- Provenance: fail → pass ▲ security
- The attested source repository moved: XBP-Europe/sagemath-mcp security
- Package version: 0.9.1 → 0.9.2 functional
- We updated how we score, so this day's move reflects our rubric, not a change to the server See what changed → functional
- 27 Sept 26 +1
No change was recorded against any check on this day. Stability & Change Management went from 83 to 86.
- 25 Sept 26 −14
- We updated how we score, so this day's move reflects our rubric, not a change to the server See what changed → functional
Diagnostic detail from the automated scan of this channel: what the scanner observed at each step, so you can see exactly where a check passed or failed. It is informational only and never changes the trust score.
Captured 3 Oct 2026 · Analysed pypi/sagemath-mcp@0.9.2
Provenance Verified
A signed build attestation was found and verified, binding this exact artifact to the source repository it claims to come from.
| Result | Verified |
|---|---|
| Ecosystem | pypi |
| Reason | Verified |
| Discovered via | Registry attestation endpoint |
| Source repo | XBP-Europe/sagemath-mcp |
| Certificate issuer | https://token.actions.githubusercontent.com |
| Certificate SAN | https://github.com/XBP-Europe/sagemath-mcp/.github/workflows/release.yml@refs/tags/v0.9.2 |
| Rekor log index | 2981578740 |
| Predicate type | PyPI publish attestation https://docs.pypi.org/attestations/publish/v1 |
| Subject digest | sha256:bcfb5585d885f61ab91ee9d73c9f3ba2d6e2f67d3d9300a2cfe38b70e7978d1d |
Background: How many MCP packages publish verified provenance →
Install scripts 1 script
| Hook | Tier | Command |
|---|---|---|
| build_backend | allowlisted | hatchling.build |
Background: Why install scripts are a supply-chain risk →
Dependencies 18 packages
| Packages resolved | 18 |
|---|---|
| Stale | 1 |
| Tree resolution | Complete |
Background: SBOMs and build attestations, explained →
The tools this component advertises to a client, with an estimated token cost for each. Expand a tool to see its parameters and schema. The per-tool counts are indicative and are not scored directly; the schema's total context footprint is one signal in Schema Quality & AI Usability. A tool's description is untrusted text the model reads on every call, which is what makes this list a security surface and not just an inventory: how tool poisoning works →
boolean_algebra_operation Boolean Algebra Operation ~166
Boolean polynomials over GF(2): evaluate, list variables, degree, and zero/one tests. Prefer this over evaluate_sage for boolean algebra.
| Name | Type | Req | Description |
|---|---|---|---|
| expression | string | yes | Boolean expression (e.g. 'x*y + x*z + y*z') |
| num_variables | integer | – | Number of boolean variables |
| operation | string | yes | One of: evaluate, variables, degree, is_zero, is_one, reduce |
| session | string | – | Workspace to use, as a name or a portable handle. Workspaces have independent variables. A name is scoped to this MCP session; a handle returned by start_sage_session (workspace_token) reaches the sa… |
Structured output declared, but exposes no named fields.
No examples provided.
calculate_expression Calculate Expression ~99
Evaluate a SageMath expression and return numeric/string forms
| Name | Type | Req | Description |
|---|---|---|---|
| expression | string | yes | SageMath expression to evaluate |
| session | string | – | Workspace to use, as a name or a portable handle. Workspaces have independent variables. A name is scoped to this MCP session; a handle returned by start_sage_session (workspace_token) reaches the sa… |
Structured output declared, but exposes no named fields.
No examples provided.
cancel_sage_session Cancel Sage Session ~88
Cancel any running Sage computation and restart the worker
| Name | Type | Req | Description |
|---|---|---|---|
| session | string | – | Workspace to use, as a name or a portable handle. Workspaces have independent variables. A name is scoped to this MCP session; a handle returned by start_sage_session (workspace_token) reaches the sa… |
| Name | Type | Req | Description |
|---|---|---|---|
| message | string | – | – |
No examples provided.
check_sage_health Check Sage Health ~128
Probe whether SageMath evaluation works right now: starts (or reuses) the workspace's worker, evaluates 1+1, and reports readiness and latency. Reports failure in the result instead of erroring, so it is always safe to call
| Name | Type | Req | Description |
|---|---|---|---|
| session | string | – | Workspace to use, as a name or a portable handle. Workspaces have independent variables. A name is scoped to this MCP session; a handle returned by start_sage_session (workspace_token) reaches the sa… |
Structured output declared, but exposes no named fields.
No examples provided.
coding_theory_operation Coding Theory Operation ~181
Error-correcting codes: length, dimension, minimum distance, rate and generator matrix for Hamming and generalized Reed-Solomon codes. Prefer this over evaluate_sage for code parameters.
| Name | Type | Req | Description |
|---|---|---|---|
| code_type | string | yes | Code constructor, e.g. 'HammingCode(GF(2),3)', 'GeneralizedReedSolomonCode(GF(7).list()[:6],3)' |
| operation | string | yes | One of: length, dimension, minimum_distance, generator_matrix, rate |
| session | string | – | Workspace to use, as a name or a portable handle. Workspaces have independent variables. A name is scoped to this MCP session; a handle returned by start_sage_session (workspace_token) reaches the sa… |
Structured output declared, but exposes no named fields.
No examples provided.
combinatorics_operation Combinatorics Operation ~250
Combinatorics: binomial coefficients, permutations, combinations, integer partitions, factorial, Catalan, Fibonacci and Bell numbers. Prefer this over evaluate_sage for any of these.
| Name | Type | Req | Description |
|---|---|---|---|
| k | – | – | Secondary argument (for binomial, combinations). Decimal strings accepted, as for n. |
| n | – | yes | Primary integer argument. Values at or above 2^53 must be passed as a decimal string, e.g. "9007199254740993", because a JSON number that large has already been rounded by the client. |
| operation | string | yes | One of: binomial (n choose k), permutations (n!), combinations (n choose k), partitions (COUNT of integer partitions of n), factorial (n!), catalan (nth Catalan number), fibonacci (nth Fibonacci numb… |
| session | string | – | Workspace to use, as a name or a portable handle. Workspaces have independent variables. A name is scoped to this MCP session; a handle returned by start_sage_session (workspace_token) reaches the sa… |
Structured output declared, but exposes no named fields.
No examples provided.
differentiate_expression Differentiate Expression ~127
Differentiate an expression with respect to a variable
| Name | Type | Req | Description |
|---|---|---|---|
| expression | string | yes | Expression to differentiate |
| order | integer | – | Order of differentiation (1 = first, 2 = second, etc.) |
| session | string | – | Workspace to use, as a name or a portable handle. Workspaces have independent variables. A name is scoped to this MCP session; a handle returned by start_sage_session (workspace_token) reaches the sa… |
| variable | string | – | Variable for differentiation |
Structured output declared, but exposes no named fields.
No examples provided.
distribution_operation Distribution Operation ~192
Probability distribution operations: PDF, CDF, quantile, mean, variance, sampling
| Name | Type | Req | Description |
|---|---|---|---|
| distribution | string | yes | Distribution name: normal, exponential, poisson, chi_squared, student_t, uniform, beta, gamma |
| n | – | – | Number of samples (for sample operation) |
| operation | string | yes | One of: pdf, cdf, quantile, mean, variance, sample |
| parameters | array | yes | Distribution parameters (e.g. [0, 1] for standard normal) |
| session | string | – | Workspace to use, as a name or a portable handle. Workspaces have independent variables. A name is scoped to this MCP session; a handle returned by start_sage_session (workspace_token) reaches the sa… |
| x | – | – | Point for pdf/cdf/quantile evaluation |
Structured output declared, but exposes no named fields.
No examples provided.
elliptic_curve_operation Elliptic Curve Operation ~190
Elliptic curves over Q: rank, torsion order, discriminant, j-invariant, conductor and generators, from Weierstrass coefficients. Prefer this over evaluate_sage for curve invariants.
| Name | Type | Req | Description |
|---|---|---|---|
| coefficients | array | yes | Curve coefficients [a1,a2,a3,a4,a6] or short Weierstrass [a,b] for y^2 = x^3 + a*x + b |
| operation | string | yes | One of: rank, torsion_order, discriminant, j_invariant, conductor, gens |
| session | string | – | Workspace to use, as a name or a portable handle. Workspaces have independent variables. A name is scoped to this MCP session; a handle returned by start_sage_session (workspace_token) reaches the sa… |
Structured output declared, but exposes no named fields.
No examples provided.
evaluate_sage Evaluate Sage ~608
Run SageMath code in a persistent session; variables persist across calls. Caller code is deny-by-default -- ordinary mathematics is allowed, but imports, external CAS interfaces and file/display/persistence calls are refused. LAST RESORT for a single self-contained calculation: a dedicated tool exists for most of those and should be preferred, because it validates arguments and returns a typed result instead of a repr string. One exception overrides that steer -- the dedicated tools evaluate in a FRESH namespace and cannot see variables you defined here, so any multi-step workflow that builds an object once and then explores it (a graph and its invariants, a number field, a matrix decomposition) belongs in evaluate_sage across as many calls as it takes. For a one-off, reach for one of these first: - calculus: differentiate_expression, integrate_expression, limit_expression, series_expansion, symbolic_sum, solve_ode - algebra: solve_equation, simplify_expression, expand_expression, factor_expression, find_root - linear algebra: matrix_operation (determinant, inverse, eigenvalues, rank, rref, transpose), matrix_multiply - discrete: number_theory_operation, combinatorics_operation (binomial, partitions, catalan, fibonacci, bell), graph_operation, group_operation - specialised: elliptic_curve_operation, coding_theory_operation, polynomial_ring_operation, boolean_algebra_operation, geometry_operation, vector_calculus_operation - data: statistics_summary, distribution_operation - plots: plot_expression, plot3d_expression, plot_multi_expression Use evaluate_sage only for what those do not cover, for example: Transforms: var('t s'); laplace(sin(t), t, s); inverse_laplace(1/(s^2+1), s, t) Modular arithmetic: Mod(17, 5); power_mod(3, 100, 97) Recurrences: var('n'); f = function('f'); desolve_rec(f(n+2)-f(n+1)-f(n), f, [0, 1]) Continued fractions: continued_fraction(pi).convergents()[:10] Number fields: K.<a> = NumberField(x^3 - 2); K.class_number() Any multi-step work t…
| Name | Type | Req | Description |
|---|---|---|---|
| capture_stdout | boolean | – | Capture stdout emitted by Sage code |
| code | string | yes | SageMath code to execute |
| session | string | – | Workspace to use, as a name or a portable handle. Workspaces have independent variables. A name is scoped to this MCP session; a handle returned by start_sage_session (workspace_token) reaches the sa… |
| timeout | – | – | Override the evaluation timeout in seconds |
| want_latex | boolean | – | Return LaTeX representation when possible |
| Name | Type | Req | Description |
|---|---|---|---|
| elapsed_ms | number | yes | Wall-clock execution time in milliseconds. |
| latex | – | – | LaTeX serialization of the result when requested and supported. |
| result | – | – | String representation of the expression result if available. |
| result_type | string | yes | – |
| stdout | string | – | Captured stdout emitted during execution. |
No examples provided.
evaluate_sage_streaming Evaluate Sage Streaming ~122
Execute SageMath code and stream intermediate print() output line by line. Final result is returned as usual.
| Name | Type | Req | Description |
|---|---|---|---|
| code | string | yes | SageMath code to execute |
| session | string | – | Workspace to use, as a name or a portable handle. Workspaces have independent variables. A name is scoped to this MCP session; a handle returned by start_sage_session (workspace_token) reaches the sa… |
| timeout_seconds | – | – | Override timeout in seconds |
| Name | Type | Req | Description |
|---|---|---|---|
| elapsed_ms | number | yes | Wall-clock execution time in milliseconds. |
| latex | – | – | LaTeX serialization of the result when requested and supported. |
| result | – | – | String representation of the expression result if available. |
| result_type | string | yes | – |
| stdout | string | – | Captured stdout emitted during execution. |
No examples provided.
expand_expression Expand Expression ~91
Expand a mathematical expression
| Name | Type | Req | Description |
|---|---|---|---|
| expression | string | yes | Expression to expand |
| session | string | – | Workspace to use, as a name or a portable handle. Workspaces have independent variables. A name is scoped to this MCP session; a handle returned by start_sage_session (workspace_token) reaches the sa… |
Structured output declared, but exposes no named fields.
No examples provided.
factor_expression Factor Expression ~108
Factor a mathematical expression or integer
| Name | Type | Req | Description |
|---|---|---|---|
| expression | string | yes | Expression to factor (e.g., 'x^2 - 1' or '60') |
| session | string | – | Workspace to use, as a name or a portable handle. Workspaces have independent variables. A name is scoped to this MCP session; a handle returned by start_sage_session (workspace_token) reaches the sa… |
Structured output declared, but exposes no named fields.
No examples provided.
find_root Find Root ~165
Find a numeric root of an expression or equation in a given interval
| Name | Type | Req | Description |
|---|---|---|---|
| expression | string | yes | Expression or equation to find a root of (e.g. 'x - cos(x)', or 'E - 0.6*sin(E) = 0.75') |
| lower_bound | number | – | Left bound of search interval |
| session | string | – | Workspace to use, as a name or a portable handle. Workspaces have independent variables. A name is scoped to this MCP session; a handle returned by start_sage_session (workspace_token) reaches the sa… |
| upper_bound | number | – | Right bound of search interval |
| variable | string | – | Variable |
Structured output declared, but exposes no named fields.
No examples provided.
geometry_operation Geometry Operation ~152
Computational geometry on point sets: euclidean distance, polygon area, polytope volume, convex hull vertices and convexity tests. Prefer this over evaluate_sage for these.
| Name | Type | Req | Description |
|---|---|---|---|
| operation | string | yes | One of: distance, polygon_area, polytope_volume, convex_hull_vertices, is_convex |
| points | array | yes | List of points as coordinate lists |
| session | string | – | Workspace to use, as a name or a portable handle. Workspaces have independent variables. A name is scoped to this MCP session; a handle returned by start_sage_session (workspace_token) reaches the sa… |
Structured output declared, but exposes no named fields.
No examples provided.
graph_operation Graph Operation ~197
Graph theory: create named graphs and compute properties (chromatic_number, is_connected, diameter, etc.)
| Name | Type | Req | Description |
|---|---|---|---|
| graph | string | yes | Graph constructor: a named graph like 'PetersenGraph' or an adjacency dict like '{0:[1,2], 1:[0,2], 2:[0,1]}' |
| operation | string | yes | One of: chromatic_number, is_connected, is_planar, diameter, order, size, degree_sequence, adjacency_matrix, shortest_path (requires source and target) |
| session | string | – | Workspace to use, as a name or a portable handle. Workspaces have independent variables. A name is scoped to this MCP session; a handle returned by start_sage_session (workspace_token) reaches the sa… |
| source | – | – | Source vertex |
| target | – | – | Target vertex |
Structured output declared, but exposes no named fields.
No examples provided.
group_operation Group Operation ~168
Group theory: construct groups and query properties (order, is_abelian, center, etc.)
| Name | Type | Req | Description |
|---|---|---|---|
| group | string | yes | Sage group constructor, e.g. 'SymmetricGroup(5)', 'DihedralGroup(4)', 'CyclicPermutationGroup(6)', 'AlternatingGroup(5)' |
| operation | string | yes | One of: order, is_abelian, is_cyclic, center_order, conjugacy_classes_count, exponent |
| session | string | – | Workspace to use, as a name or a portable handle. Workspaces have independent variables. A name is scoped to this MCP session; a handle returned by start_sage_session (workspace_token) reaches the sa… |
Structured output declared, but exposes no named fields.
No examples provided.
integrate_expression Integrate Expression ~148
Integrate an expression (indefinite or definite with bounds)
| Name | Type | Req | Description |
|---|---|---|---|
| expression | string | yes | Expression to integrate |
| lower_bound | – | – | Lower bound for definite integral (e.g., '0', '-oo') |
| session | string | – | Workspace to use, as a name or a portable handle. Workspaces have independent variables. A name is scoped to this MCP session; a handle returned by start_sage_session (workspace_token) reaches the sa… |
| upper_bound | – | – | Upper bound for definite integral (e.g., '1', 'oo') |
| variable | string | – | Integration variable |
Structured output declared, but exposes no named fields.
No examples provided.
interrupt_sage_session Interrupt Sage Session ~90
Interrupt a running Sage computation while keeping variables defined so far
| Name | Type | Req | Description |
|---|---|---|---|
| session | string | – | Workspace to use, as a name or a portable handle. Workspaces have independent variables. A name is scoped to this MCP session; a handle returned by start_sage_session (workspace_token) reaches the sa… |
| Name | Type | Req | Description |
|---|---|---|---|
| message | string | – | – |
No examples provided.
limit_expression Limit Expression ~152
Compute the limit of an expression
| Name | Type | Req | Description |
|---|---|---|---|
| direction | – | – | Direction: 'plus' (right), 'minus' (left), or omit for both |
| expression | string | yes | Expression to take the limit of |
| point | string | – | Point to approach (e.g., '0', 'oo', '-oo') |
| session | string | – | Workspace to use, as a name or a portable handle. Workspaces have independent variables. A name is scoped to this MCP session; a handle returned by start_sage_session (workspace_token) reaches the sa… |
| variable | string | – | Variable approaching the point |
Structured output declared, but exposes no named fields.
No examples provided.
list_sage_sessions List Sage Sessions ~21
List the named Sage workspaces belonging to this client
Input schema present but exposes no named parameters.
Structured output declared, but exposes no named fields.
No examples provided.
lookup_sage_doc Lookup Sage Doc ~57
Documentation links for a SageMath name, plus whether this server offers that name to evaluate_sage caller code
| Name | Type | Req | Description |
|---|---|---|---|
| symbol | string | yes | A SageMath name, e.g. 'EllipticCurve' or 'desolve' |
Structured output declared, but exposes no named fields.
No examples provided.
matrix_multiply Matrix Multiply ~149
Multiply two matrices and return the result as nested lists
| Name | Type | Req | Description |
|---|---|---|---|
| matrix_a | array | yes | Left matrix (rows of numbers). Integers stay exact; pass values from 2^53 up as decimal strings, e.g. "9007199254740993". |
| matrix_b | array | yes | Right matrix (rows of numbers). Integers stay exact. |
| session | string | – | Workspace to use, as a name or a portable handle. Workspaces have independent variables. A name is scoped to this MCP session; a handle returned by start_sage_session (workspace_token) reaches the sa… |
Structured output declared, but exposes no named fields.
No examples provided.
matrix_operation Matrix Operation ~159
Linear algebra on one matrix: determinant, inverse, eigenvalues, rank, reduced row echelon form, transpose. Prefer this over evaluate_sage.
| Name | Type | Req | Description |
|---|---|---|---|
| matrix | array | yes | Matrix as nested list of numbers. Integers stay exact; pass values from 2^53 up as decimal strings. |
| operation | string | yes | One of: determinant, inverse, eigenvalues, rank, rref, transpose |
| session | string | – | Workspace to use, as a name or a portable handle. Workspaces have independent variables. A name is scoped to this MCP session; a handle returned by start_sage_session (workspace_token) reaches the sa… |
Structured output declared, but exposes no named fields.
No examples provided.
number_theory_operation Number Theory Operation ~213
Number theory: primality testing, integer factorisation, the next prime above n, gcd and lcm. Prefer this over evaluate_sage for any of these.
| Name | Type | Req | Description |
|---|---|---|---|
| a | – | yes | Primary integer. Pass values above 2^53 as a decimal STRING: JSON numbers are IEEE doubles in JavaScript-based clients, so 10^30 arrives as 1000000000000000019884624838656 and the answer is silently… |
| b | – | – | Second integer, required for gcd and lcm. Same string rule. |
| operation | string | yes | Operation: 'is_prime', 'factor_integer', 'next_prime', 'gcd', 'lcm' |
| session | string | – | Workspace to use, as a name or a portable handle. Workspaces have independent variables. A name is scoped to this MCP session; a handle returned by start_sage_session (workspace_token) reaches the sa… |
Structured output declared, but exposes no named fields.
No examples provided.
plot_expression Plot Expression ~164
Plot an expression and return it as a rendered image (PNG or SVG)
| Name | Type | Req | Description |
|---|---|---|---|
| expression | string | yes | Expression to plot |
| image_format | string | – | Image format to return: 'png' (raster) or 'svg' (vector, smaller) |
| range_max | number | – | Upper bound of plot range |
| range_min | number | – | Lower bound of plot range |
| session | string | – | Workspace to use, as a name or a portable handle. Workspaces have independent variables. A name is scoped to this MCP session; a handle returned by start_sage_session (workspace_token) reaches the sa… |
| variable | string | – | Plot variable |
No output schema declared.
No examples provided.
plot_multi_expression Plot Multi Expression ~182
Plot multiple expressions overlaid on a single 2D graph, as a rendered image
| Name | Type | Req | Description |
|---|---|---|---|
| expressions | array | yes | List of expressions to plot (e.g. ['sin(x)', 'cos(x)']) |
| image_format | string | – | Image format to return: 'png' (raster) or 'svg' (vector, smaller) |
| range_max | number | – | Upper bound of plot range |
| range_min | number | – | Lower bound of plot range |
| session | string | – | Workspace to use, as a name or a portable handle. Workspaces have independent variables. A name is scoped to this MCP session; a handle returned by start_sage_session (workspace_token) reaches the sa… |
| variable | string | – | Plot variable |
No output schema declared.
No examples provided.
plot3d_expression Plot3D Expression ~211
Plot a 3D surface of a two-variable expression as a rendered image
| Name | Type | Req | Description |
|---|---|---|---|
| expression | string | yes | Expression of two variables (e.g. 'sin(x)*cos(y)') |
| image_format | string | – | Image format to return: 'png' (raster) or 'svg' (vector, smaller) |
| session | string | – | Workspace to use, as a name or a portable handle. Workspaces have independent variables. A name is scoped to this MCP session; a handle returned by start_sage_session (workspace_token) reaches the sa… |
| x_range_max | number | – | X upper bound |
| x_range_min | number | – | X lower bound |
| x_variable | string | – | First variable |
| y_range_max | number | – | Y upper bound |
| y_range_min | number | – | Y lower bound |
| y_variable | string | – | Second variable |
No output schema declared.
No examples provided.
polynomial_ring_operation Polynomial Ring Operation ~184
Polynomial ring operations: construct rings and compute Groebner bases, ideals, quotients
| Name | Type | Req | Description |
|---|---|---|---|
| base_ring | string | – | Base ring |
| operation | string | yes | One of: groebner_basis, ideal_dimension, ideal_variety, reduce, is_groebner |
| polynomials | array | yes | Polynomials as strings, e.g. ['a^2+b', 'b^2-1'] |
| ring_vars | array | yes | Variable names, e.g. ['a', 'b', 'c'] |
| session | string | – | Workspace to use, as a name or a portable handle. Workspaces have independent variables. A name is scoped to this MCP session; a handle returned by start_sage_session (workspace_token) reaches the sa… |
Structured output declared, but exposes no named fields.
No examples provided.
reset_sage_session Reset Sage Session ~90
Reset the SageMath session state for the current MCP session
| Name | Type | Req | Description |
|---|---|---|---|
| session | string | – | Workspace to use, as a name or a portable handle. Workspaces have independent variables. A name is scoped to this MCP session; a handle returned by start_sage_session (workspace_token) reaches the sa… |
| Name | Type | Req | Description |
|---|---|---|---|
| message | string | – | – |
No examples provided.
series_expansion Series Expansion ~133
Compute a Taylor/Laurent series expansion
| Name | Type | Req | Description |
|---|---|---|---|
| expression | string | yes | Expression to expand in series |
| order | integer | – | Number of terms in the expansion |
| point | string | – | Point around which to expand |
| session | string | – | Workspace to use, as a name or a portable handle. Workspaces have independent variables. A name is scoped to this MCP session; a handle returned by start_sage_session (workspace_token) reaches the sa… |
| variable | string | – | Variable for expansion |
Structured output declared, but exposes no named fields.
No examples provided.
simplify_expression Simplify Expression ~92
Simplify a mathematical expression
| Name | Type | Req | Description |
|---|---|---|---|
| expression | string | yes | Expression to simplify |
| session | string | – | Workspace to use, as a name or a portable handle. Workspaces have independent variables. A name is scoped to this MCP session; a handle returned by start_sage_session (workspace_token) reaches the sa… |
Structured output declared, but exposes no named fields.
No examples provided.
solve_equation Solve Equation ~126
Solve an equation or system of equations
| Name | Type | Req | Description |
|---|---|---|---|
| equation | – | yes | Equation string (e.g., 'x^2 - 1 = 0') or list of equations for systems |
| session | string | – | Workspace to use, as a name or a portable handle. Workspaces have independent variables. A name is scoped to this MCP session; a handle returned by start_sage_session (workspace_token) reaches the sa… |
| variable | – | – | Variable or list of variables to solve for |
Structured output declared, but exposes no named fields.
No examples provided.
solve_ode Solve Ode ~161
Solve an ordinary differential equation of any order, returning the general solution with arbitrary constants. Prefer this over evaluate_sage.
| Name | Type | Req | Description |
|---|---|---|---|
| equation | string | yes | ODE string, e.g., "diff(y(x),x) + y(x) = 0" |
| function | string | – | Dependent function name (e.g., 'y') |
| session | string | – | Workspace to use, as a name or a portable handle. Workspaces have independent variables. A name is scoped to this MCP session; a handle returned by start_sage_session (workspace_token) reaches the sa… |
| variable | string | – | Independent variable (e.g., 'x') |
Structured output declared, but exposes no named fields.
No examples provided.
start_sage_session Start Sage Session ~41
Start a named Sage workspace with its own independent variables
| Name | Type | Req | Description |
|---|---|---|---|
| name | string | yes | Workspace name, e.g. 'curves' or 'scratch' |
| Name | Type | Req | Description |
|---|---|---|---|
| message | string | yes | Human-readable confirmation. |
| name | string | yes | The workspace name this handle was opened for. |
| workspace_token | string | yes | Opaque handle for this workspace. Pass it as the 'session' argument of later tool calls to reach the same state regardless of the transport session. Treat it as a secret. |
No examples provided.
statistics_summary Statistics Summary ~122
Descriptive statistics for a list of numbers: mean, median, population and sample variance and standard deviation, min and max. Prefer this over evaluate_sage for summary statistics.
| Name | Type | Req | Description |
|---|---|---|---|
| data | array | yes | List of numeric values |
| session | string | – | Workspace to use, as a name or a portable handle. Workspaces have independent variables. A name is scoped to this MCP session; a handle returned by start_sage_session (workspace_token) reaches the sa… |
Structured output declared, but exposes no named fields.
No examples provided.
stop_sage_session Stop Sage Session ~31
Stop a named Sage workspace and release its worker
| Name | Type | Req | Description |
|---|---|---|---|
| name | string | yes | Workspace name to stop |
| Name | Type | Req | Description |
|---|---|---|---|
| message | string | – | – |
No examples provided.
symbolic_sum Symbolic Sum ~187
Closed form of a symbolic sum or product over an index variable, including infinite series. Prefer this over evaluate_sage for summations.
| Name | Type | Req | Description |
|---|---|---|---|
| expression | string | yes | Expression to sum (e.g. '1/n^2') |
| lower | string | – | Lower bound (e.g. '1') |
| product | boolean | – | If true, compute a product instead of a sum |
| session | string | – | Workspace to use, as a name or a portable handle. Workspaces have independent variables. A name is scoped to this MCP session; a handle returned by start_sage_session (workspace_token) reaches the sa… |
| upper | string | – | Upper bound (e.g. 'oo' for infinity) |
| variable | string | – | Index variable (e.g. 'n') |
Structured output declared, but exposes no named fields.
No examples provided.
vector_calculus_operation Vector Calculus Operation ~158
Vector calculus operations: gradient, divergence, curl, laplacian
| Name | Type | Req | Description |
|---|---|---|---|
| expression | – | yes | Scalar field (string) for gradient/laplacian, or vector field components (list) for divergence/curl |
| operation | string | yes | One of: gradient, divergence, curl, laplacian |
| session | string | – | Workspace to use, as a name or a portable handle. Workspaces have independent variables. A name is scoped to this MCP session; a handle returned by start_sage_session (workspace_token) reaches the sa… |
| variables | – | – | Variable names (e.g. ['x', 'y', 'z']) |
Structured output declared, but exposes no named fields.
No examples provided.
verify_claim Verify Claim ~532
Independently re-check a stated mathematical claim and report how far the evidence goes: proved, refuted, supported or undecided. Use this to verify your own algebra before presenting it. The claim is a single comparison in Sage syntax -- an equality, an inequality, or anything that evaluates to True/False: integral(x^2/(e^x-1), x, 0, oo) == 2*zeta(3) sin(x)^2 + cos(x)^2 == 1 pi < 22/7 e^pi != pi^e The check climbs a ladder: Sage's symbolic prover, the exact difference ((lhs-rhs).simplify_full().is_zero()), exact arithmetic over QQbar/AA when the claim is constant, then certified interval arithmetic and numeric sampling over the free variables. Verdicts are honest by construction: 'proved' and 'refuted' are exact decisions ('refuted' always exhibits its counterexample or certified enclosure); 'supported' means the numeric evidence is consistent with the claim without proving it, and says how many samples at what precision; 'undecided' means every rung was inconclusive -- it never means false. Exactness is never assumed. Decimal literals are read exactly (0.1 means 1/10, never the 53-bit double), and a comparison whose operands are machine floats (RR/RDF/CC, an .n() result) is reported as 'supported' over inexact numbers, never as an exact proof -- state it over ZZ/QQ/QQbar or symbolically for an exact verdict. The session's active assumptions (assume(x > 0), assume(x, 'integer')) are honored: a sampled counterexample must lie inside the stated domain, and any verdict that relied on an assumption names it in the evidence.
| Name | Type | Req | Description |
|---|---|---|---|
| claim | string | yes | The claim to check, as a single comparison, e.g. 'sin(x)**2 + cos(x)**2 == 1' |
| precision_bits | integer | – | Precision of the certified interval arithmetic behind numeric verdicts |
| samples | integer | – | Sample points per free variable sweep when the claim cannot be decided exactly |
| session | string | – | Workspace to use, as a name or a portable handle. Workspaces have independent variables. A name is scoped to this MCP session; a handle returned by start_sage_session (workspace_token) reaches the sa… |
| timeout | – | – | Override the evaluation timeout in seconds |
| Name | Type | Req | Description |
|---|---|---|---|
| assumptions | array | – | The session's active assumptions in force during the check (e.g. "x is integer"). A verdict is only valid under these; they are also named in the evidence so no branch can conceal them. |
| claim | string | yes | The claim that was checked, whitespace-folded. |
| evidence | – | – | What the deciding rung actually established, including the counterexample for a sampled refutation. |
| method | – | – | The rung that decided: exact_comparison, symbolic_prover, exact_difference, exact_algebraic, certified_interval, numeric_sampling, float_comparison (operands were machine floats, so the result is onl… |
| precision_bits | – | – | Interval-arithmetic precision behind a numeric verdict. |
| samples | – | – | Number of sample points supporting a numeric-sampling verdict. |
| verdict | string | yes | proved/refuted are exact; supported is evidence short of proof; undecided means every rung of the ladder was inconclusive. |
No examples provided.
What is the SageMath MCP server?
SageMath is an MCP server listed in the public MCP registry as io.github.XBP-Europe/sagemath-mcp. Stateful SageMath MCP server with 40 tools and a sandboxed Sage session per client. This page covers its PyPI package (sagemath-mcp).
Is the SageMath MCP server safe to use?
SageMath scores 79 out of 100 on VerifyMCP. We found no known CVEs affecting it as of 3 October 2026. Its build provenance is signed and verified. That is a record of what we were able to check automatically, not an endorsement. The category breakdown on this page shows every signal behind the number, including the ones we could not confirm.
What tools does the SageMath MCP server expose?
SageMath exposes 40 tools: solve_equation, matrix_multiply, matrix_operation, boolean_algebra_operation, polynomial_ring_operation, and 35 more. Their descriptions and schemas cost roughly 6,435 tokens of context every time the server is loaded.
Is the SageMath MCP server still maintained?
SageMath is still listed as active in the MCP registry. We last reached this channel on 3 October 2026. Those dates come from our own scans of the registry and the channel itself, not from anything the publisher announced.
What licence is the SageMath MCP server under?
SageMath declares the MIT licence, which is OSI-approved. That covers the source only, and says nothing about the cost of any service it calls.