← Open Source

MathCode: A Frontier Mathematical Coding Agent.

ApplicationsCodingResearch & knowledgeShell
Momentum
+0stars in 24 hours0.0%
750
Stars
69
Forks
+-1
This week
5
Contributors
Created 2026-04-02 · Updated 2026-11-30 · #18108 today
Top developers
yifanzhang-proT3S1AMAXShihanQin-pro
README

MathCode

English | 中文

MathCode is a coding assistant for the terminal and browser, with built-in Lean 4 support. It can inspect proof goals, search declarations, check candidates, and verify completed proofs.

Website · Releases · Issues · Discord

What you can do

  • Work on code and Lean proofs in your own workspace.
  • Use the terminal or a local WebUI with math and diagram rendering.
  • Store verified theorems and explicit assumptions, and explore dependencies in Obsidian.
  • Add project skills, Python analysis tools, and MCP plugins.

Lean is the proof authority: a proof is complete only after strict verification succeeds. Library storage and vault updates are explicit actions.

Get started

Supports macOS Apple Silicon (arm64) and Linux x86_64 with glibc and AVX2. The default backend requires the codex CLI and a Codex login.

git clone https://github.com/math-ai-org/mathcode.git
cd mathcode
bash setup.sh
codex auth login
./run

Setup installs the CLI and WebUI without Lean/Mathlib by default, in both interactive terminals and scripts. --without-lean explicitly selects this mode. Use bash setup.sh --with-lean for a full installation, or add Lean later with bash setup.sh --install-lean. Lean support needs about 10 GiB of additional disk space. Existing Lean installations are kept.

Setup installs a mathcode command for new shells. Use ./run immediately, or open a new shell and run:

mathcode -p "prove that the square of an even number is even"

For the browser interface, run ./run webui and open the local URL. To update an existing checkout, run git pull --ff-only and rerun setup.

Documentation

Read the online documentation.

Guide Contents
Installation Requirements, install modes, upgrades, toolchains, troubleshooting
Usage CLI, WebUI, goals, sessions, schedules, diagnostics
Lean workflows Proof tools, theorem and axiom libraries, Obsidian, optional feedback backends
Configuration Providers, model settings, skills, tools, plugins

See release notes for the current release.

Citation

@misc{mathcode2026,
  title = {MathCode: A Frontier Mathematical Coding Agent},
  author = {Team Math-AI},
  journal = {math-ai-org.github.io},
  year = {2026},
  month = {April},
  url = "https://github.com/math-ai-org/mathcode"
}
Nearby in the ranking
Similar items

AI Rank for iPhone

Follow AI model rankings

Download on the App Store