ReasonForge
Provides a suite of deterministic math tools powered by SymPy to handle algebra, calculus, linear algebra, and statistics via the Model Context Protocol. It enables smaller language models to delegate complex computations to a verified symbolic backend for accurate and reliable results.
README
ReasonForge
Deterministic math tools for small language models.
ReasonForge gives small LLMs (8B–32B) access to a verified SymPy computation backend via tool calling. Instead of relying on the model to compute, all math is delegated to deterministic tools — the model only reasons about what to compute and how to present results.
Architecture
User Question → LLM (Qwen3) → Tool Calls → SymPy Backend → Verified Results → LLM → Final Answer
Two-phase response pipeline:
- Compute (
/no_think): Model calls tools with thinking disabled — forced delegation - Present (thinking ON): Model reasons about verified results, composes the answer
Tools
| Tool | Operations | Backend |
|---|---|---|
math_tool |
compute, solve, simplify, factor, expand, gcd, lcm, prime_factors, divisors, mod_inverse, nsolve, crt + SymPy builtins (totient, fibonacci, isprime...) | SymPy |
calculus_tool |
differentiate, integrate, limit, series, summation, partial_fraction, trigsimp, ode_solve, laplace | SymPy |
matrix_tool |
determinant, inverse, eigenvalues, eigenvectors, rank, rref, transpose, multiply, add, trace, nullspace, columnspace, charpoly, norm, adjugate, solve (Ax=b) | SymPy |
statistics_tool |
describe, mean, median, mode, std, variance, correlation, regression, percentile, zscore, skewness, kurtosis, geometric_mean, harmonic_mean | Python stdlib |
Project Structure
MCP/
├── experts/math/
│ ├── server.py # MCP server entry point
│ └── tools/
│ ├── preprocess.py # Expression parser (^ → **, implicit multiplication, infinity handling)
│ ├── algebra.py # math_tool — algebra + number theory
│ ├── calculus.py # calculus_tool — derivatives, integrals, ODEs, etc.
│ ├── matrix.py # matrix_tool — linear algebra
│ └── statistics.py # statistics_tool — descriptive & inferential stats
├── tests/
│ └── test_math_tools.py # Unit tests for all tools
├── ui/
│ ├── app.py # Gradio chat interface with two-phase pipeline
│ └── style.css # Custom UI styles (dark mode, input pill, etc.)
├── ReasonForge_Colab.ipynb # One-click Colab deployment notebook
├── pyproject.toml
└── run_ui.bat # Local launcher (Windows)
Quick Start (Local)
# Requires: Ollama running with qwen3:8b
uv sync
uv run python -m ui.app
# Opens at http://localhost:7861
Colab Deployment (GPU)
Open ReasonForge_Colab.ipynb in Google Colab Pro with an A100 GPU.
It clones this repo, installs Ollama + qwen3:32b, and launches the UI with a public Gradio link.
Running Tests
uv run python -m tests.test_math_tools
Tech Stack
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.