SageMath MCP server
Stateful SageMath MCP server with 40 tools and a sandboxed Sage session per client.
15 stars386 downloads/wk
Reviews
Write oneNobody has reviewed SageMath yet.
If you have run it, two minutes of your experience saves the next person an afternoon.
SageMath tools (39, 3 write)
write = sends, deletes, buys or postsRead from the package source without running it. The installed server may list more.
boolean_algebra_operationcalculate_expressionEvaluate a SageMath expression and return numeric/string forms
cancel_sage_sessionwrite actionCancel any running Sage computation and restart the worker
coding_theory_operationcombinatorics_operationdifferentiate_expressionDifferentiate an expression with respect to a variable
distribution_operationProbability distribution operations: PDF, CDF, quantile, mean, variance, sampling
elliptic_curve_operationevaluate_sagewrite actionRun SageMath code, preserving state within the caller's MCP session.
evaluate_sage_streamingwrite actionExecute SageMath code and stream intermediate print() output
expand_expressionExpand a mathematical expression
factor_expressionFactor a mathematical expression or integer
find_rootFind a numeric root of an expression or equation in a given interval
geometry_operationgraph_operationGraph theory: create named graphs and compute properties
group_operationGroup theory: construct groups and query properties
integrate_expressionIntegrate an expression (indefinite or definite with bounds)
interrupt_sage_sessionInterrupt a running Sage computation while keeping variables defined so far
limit_expressionCompute the limit of an expression
list_sage_sessionsList the named Sage workspaces belonging to this client
lookup_sage_docDocumentation links for a SageMath name, plus whether this server
matrix_multiplyMultiply two matrices and return the result as nested lists
matrix_operationnumber_theory_operationplot3d_expressionPlot a 3D surface of a two-variable expression as a rendered image
plot_expressionPlot an expression and return it as a rendered image (PNG or SVG)
plot_multi_expressionPlot multiple expressions overlaid on a single 2D graph, as a rendered image
polynomial_ring_operationPolynomial ring operations: construct rings
reset_sage_sessionReset the SageMath session state for the current MCP session
series_expansionCompute a Taylor/Laurent series expansion
simplify_expressionSimplify a mathematical expression
solve_equationSolve an equation or system of equations
solve_odestart_sage_sessionStart a named Sage workspace with its own independent variables
statistics_summarystop_sage_sessionStop a named Sage workspace and release its worker
symbolic_sumvector_calculus_operationVector calculus operations: gradient, divergence, curl, laplacian
verify_claim
Public scan report
scanner v0.1.8 · 2026-09-19 · same rubric, same numbers if you re-run it
- Code scan32 source files scanned15/25
- –Live reliabilityno gateway calls yet and no remote to proben/a
- –Tool poisoningtools not inspected (local package is not executed); not countedn/a
- Auth qualitylocal package, no credentials required12/15
- Maintenancelast push 0 days ago15/15
- Maintainer identityregistry namespace matches repository owner7/10
Findings (2)
- mediumeval / new Function used
exec.evalsagemath_mcp-0.8.2/src/sagemath_mcp/_sage_worker.py: …e in its own right: # # latex.eval() runs the toolchain -- and `ev…
- mediumsubprocess with shell=True
exec.shell-truesagemath_mcp-0.8.2/src/sagemath_mcp/security.py: …ame)` runs `call("kpsewhich %s" % name, shell=True)` # and executed `id > /tmp/...…
Grade history
- 2026-09-19restoreC → Bscore 75: eval / new Function used; subprocess with shell=True
Install directly
claude mcp add sagemath-mcp -- uvx sagemath-mcp
SageMath: common questions
- Is SageMath MCP server safe?
- Mostly: it is graded B (75/100). Read the SageMath safety report
- How do I install SageMath?
- It runs on your machine. Copy the Claude Code, Claude Desktop or Cursor config from the install section.
- Does SageMath need an API key?
- Not as far as the registry entry and our scan can tell: no credentials are declared or required.
- Is SageMath maintained?
- The last commit was in the last day (2026-09-19). The latest release is v0.8.2.