SuperAPI AI Directory

mathlas

Math tools for agents: theorem search, PSLQ constant identification, OEIS lookup, Lean kernel checks and applicability checklists.

Open website

About this tool

mathlas is a set of mathematical tools designed specifically for AI, invoked by AI through the MCP (Model Context Protocol). Its core philosophy is "AI is the brain, mathlas is the hands": mathlas itself contains no LLM and requires no API key; instead, it provides AI with the mathematical capabilities it lacks and returns data such as candidates, determinations, checklists, and scaffolding for AI to reason over.

Purpose

mathlas is intended to solve the problem of AI easily hallucinating on mathematical tasks. It provides independently verifiable facts or an honest "no result" rather than fabricating answers. It is suitable for the following scenarios:

  • You use Claude Code or Cursor and want AI to stop hallucinating about mathematics;
  • You have an unrecognized numerical constant or integer sequence;
  • You need the formal (Lean/mathlib) name for a result;
  • You are building an agent pipeline that needs reliable mathematical capabilities embedded in the loop.

Main Capabilities

mathlas provides 12 pure-data-returning MCP tools, the core ones including:

  • search_existing_math: retrieves real theorems from a dense index of 3,683,428 documents, built with Qwen3-Embedding-8B (4096 dimensions), containing a 1.34 million-entry permissively licensed CC-BY/CC0 TheoremSearch subset and 2.34 million arXiv mathematics documents from Dolma, using dense retrieval, Okapi-BM25, and RRF fusion.
  • identify_constant: runs PSLQ plus closed-form matching (50-digit precision) to identify numerical constants.
  • identify_sequence: performs exact OEIS term matching.
  • verify_numeric and verify_formal: check claims with zero hallucination risk; verify_formal uses the real Lean 4.31.0 kernel to check the complete claim, rejects sorry/admit holes, and returns an honest UNDETERMINED when the toolchain is missing, times out, or imports cannot be resolved.
  • search_formal_math: proxies the public Loogle and LeanSearch services,returning declaration names and types, with sources annotated.
  • add_finding: supports a self-reinforcing loop, embedding real theorem statements found on the web and fusing them at runtime through the dense channel.

All tools return data and do not call an LLM. search_formal_math is the only tool that itself makes network calls (calling the public Loogle/LeanSearch services); the rest run entirely locally.

Usage

Installation and registration with Claude Code (no API key required):

uvx mathlas-mcp

On first use, uvx fetches and runs the server in an isolated environment (uv is required). pip installation is also possible. After registration, mathlas appears in the agent's callable list as 12 tools. The server prefers the official mcp SDK and falls back to a dependency-free stdio JSON-RPC server if it is not installed, ensuring it can always run. Cursor or any MCP client can point to the same uvx mathlas-mcp or python -m mathlas.server stdio command.

Optional local data (honest degradation): identify_sequence requires a local copy of OEIS; verify_formal requires the Lean toolchain. When missing, the tool returns an explicit "data/toolchain unavailable", and never returns a false answer.

Applicable scenarios

  • When reliable mathematical capabilities are needed in agent pipelines;
  • Mathematical theorem retrieval and formal verification;
  • Numerical constant and integer sequence identification;
  • Proof checking and repair loops: the agent writes a proof, the mathlas kernel points out specific errors, and the agent calls again after fixing them.

Limitations

  • There is no LLM inside, and it does not generate proofs (the separation of generator/verifier is absolute);
  • Some tools depend on optional local data or toolchains, and when missing they return UNDETERMINED rather than a verdict;
  • The retrieval index has cross-representation recall gaps; the honest headline recall rate at the full 3.68M scale is R@1 0.614 and R@10 0.832;
  • The quantized notebook tier and the 0.6B end-to-end tier are optional features and have recall loss;
  • Dual-channel retrieval significantly increases serving memory and is strictly optional;
  • source_filter/source_weights for source-aware retrieval are knobs adjusted according to query intent, and are off by default.

The project uses the Apache-2.0 license, and the code may be used free of charge for any purpose; the released corpus and index artifacts follow their respective source terms (CC-BY/CC0).