Skip to main content

sagebrush-mcp: computational mathematics for AI agents

An MCP server that gives an AI agent a real computer algebra system for research mathematics, with Sage syntax and exact, verified results. It is Sagebrush: Rust engines, MIT OR Apache-2.0. You don't need Sage, PARI or FLINT, or a C compiler; the wheels cover Linux, macOS and Windows.

pip install sagebrush-mcp        # or: uvx sagebrush-mcp

Claude Code: claude mcp add sagebrush -- sagebrush-mcp

Claude Desktop, Cursor and other clients: in the MCP configuration,

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

(uvx sagebrush-mcp as the command works without installing anything first.)

Tools

  • sage: run Sage code in a persistent session. 2^10, 1/3 exact, R.<x> = QQ[], K.<a> = NumberField(x^3 - 11), [1..10]; variables persist between calls. It returns the printed output and the last value, and plots come back as SVG.
  • python: the same session, as plain Python.
  • factor, number_field, newforms: shortcuts for common questions.
  • guide: what is implemented. reset: clear the session.

What the session covers:

  • Integers: factoring (ECM), primality.
  • Polynomials: factoring and roots over ZZ and QQ.
  • Number fields: maximal orders, prime decomposition, class groups, units and regulators (assuming GRH, as Sage and PARI do).
  • Exact linear algebra over ZZ and QQ: det, rref, inverse, charpoly, kernels, Hermite and Smith forms, LLL.
  • Modular forms: modular symbols, newforms with LMFDB labels, Hecke operators.
  • Elliptic curves: conductors, ranks, a_p.
  • Plots.

The results agree with Sage. The test suite compares 3,500 lines of output with Sage itself.

Each computation has a time limit (timeout, default 60 s). When it expires, the computation is interrupted and the session keeps its variables.

This package is a thin entry point: the server is sagebrush.mcp_server in the sagebrush package, so pip install sagebrush also provides the sagebrush-mcp command.

Metadata

Release files for sagebrush-mcp 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sagebrush-mcp 0.6.0
File Size Uploaded
sagebrush_mcp-0.6.0.tar.gz 6.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sagebrush-mcp 0.6.0
File Interpreter ABI Platform
sagebrush_mcp-0.6.0-py3-none-any.whl Python 3 none any Details

Total release size: 14.5 kB

Release files / sagebrush_mcp-0.6.0.tar.gz

Download URL sagebrush_mcp-0.6.0.tar.gz
Size 6.6 kB
Tags Source
SHA-256 checksum
How to use checksums
a90fea054d216c7ebcb602bf9c99b8432a9b6c62e0668b0f55f4b036aacf712e
BLAKE2b-256 checksum
How to use checksums
aa845564cf5a82d81a09093d9f5706d5a2a91d06750e08b1fbc7a14e5730cc98
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 7, 2026.

Transparency log

Release files / sagebrush_mcp-0.6.0-py3-none-any.whl

Download URL sagebrush_mcp-0.6.0-py3-none-any.whl
Size 7.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
daeaa452003dd6ebe72d1385fcb8f61a3a908522d9096d06423bacd41ffeedcf
BLAKE2b-256 checksum
How to use checksums
f0d4a9027dfadd648d720047a8efa0a89f3c02c35d1170b7b60c4cf8f9457b7f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 7, 2026.

Transparency log

Release history Release notifications | RSS feed

0.7.0

2 release files

This release

0.6.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page