Sagemath MCP Server

MCP server wrapping SageMath's full computer algebra system — 10 symbolic-math tools for LLMs.

Local serverstdioTypeScript

What is the Sagemath MCP Server?

MCP server wrapping SageMath's full computer algebra system — 10 symbolic-math tools for LLMs.

What the server does

LLMs are bad at exact arithmetic, brittle with multi-step algebra, and unreliable when symbolic manipulation matters. The right pattern is to keep the conceptual reasoning in the model and delegate mechanical computation to a tool — the same trick a person with dyscalculia uses with a calculator. SageMath gives you the broadest tool surface for that delegation: factoring, integration, eigenvalues, number theory, LaTeX rendering, and plotting all behind one interface.

More MCP options

Compare MCP servers by category, or browse hosted MCP servers if you prefer an endpoint over a local process.

Maintainer setup documentation.

Recorded tools

Check the linked publisher documentation and your connected client's tool list. Names and availability can vary with the server version and account permissions.

ToolWhat it does
sage_evaluateRun an arbitrary SageMath expression.
sage_solve_equationSolve algebraic / transcendental equations symbolically.
sage_differentiateCompute derivatives (any order, any variable).
sage_integrateIndefinite and definite integrals.
sage_simplifySimplify expressions (default, full, trig, rational).
sage_factorFactor polynomials or integers.
sage_matrix_opsDeterminant, inverse, eigenvalues, rank, RREF, transpose over QQ / RR / ZZ / CC.
sage_plotPlot an expression and return a base64 PNG.
sage_latex_convertConvert a SageMath expression to LaTeX.
sage_number_theoryis_prime, next_prime, factor, euler_phi, gcd, lcm, prime_range, sigma, moebius.

How to install the Sagemath MCP Server

{
  "mcpServers": {
    "sagemath": {
      "command": "sagemath-mcp"
    }
  }
}

Configuration as documented by the project. Restart the client after saving.

Example prompts to try

  • “Use Sagemath to sage evaluate.”
  • “Use Sagemath to sage solve equation.”
  • “Use Sagemath to sage differentiate.”

Frequently asked questions

MCP server wrapping SageMath's full computer algebra system — 10 symbolic-math tools for LLMs. Confirm the tools offered by your installed version in the connected client. Tool availability and permissions depend on the server and account configuration.