Skip to main content
Glama
mg-math-mcp

mg-math-mcp

by MoongladeAI

Moonglade Deterministic Math MCP (moonglade-math-mcp)

Zero-hallucination symbolic and fixed-point mathematical execution engine exposed via the Model Context Protocol (MCP). Every calculation traverses a deterministic priority hierarchy (Plugin Submodule → Domain → Basic Math) and emits a cryptographic MathProof receipt containing the exact result, step-by-step execution trace, rounding mode (ROUND_HALF_EVEN), and SHA-256 verification digest.

Repository Architecture

moonglade-math-mcp/
├── pyproject.toml
├── README.md
├── mcp_math_engine/          # Core Hierarchical Engine & MCP JSON-RPC Server
│   ├── core.py               # MathProof receipt & 35-digit Decimal context
│   ├── registry.py           # Priority-cascading namespace dispatcher
│   ├── server.py             # Stdio MCP server (calculate & list_math_hierarchy)
│   └── modules/              # Built-in foundational tiers
│       ├── basic_math.py     # Rational arithmetic, algebra, geometry, statistics
│       ├── scientific_math.py# Symbolic calculus (SymPy), matrices, SI constants
│       └── financial_math.py # Fixed-point TVM, compound interest, base EMI
├── plugins/                  # Auto-discovered Domain Extension Plugins
│   ├── __init__.py           # Dynamic plugin loader (discover_and_register_plugins)
│   ├── banking_adjudication/ # Epoch-governed retail mortgage & covenant underwriting
│   ├── building_energy/      # Municipal energy consumption & BIM budget rates
│   ├── energy_grid/          # Grid load, storage & renewable dispatch
│   ├── municipal_spatial/    # Spatial density & parcel calculations
│   └── transit_mobility/     # Fleet headway, capacity & mobility metrics
└── tests/                    # Automated Verification Suite

Related MCP server: numproof

Creating a Domain Extension Plugin

Drop a new folder inside plugins/<your_plugin>/ with a pack.py (or plugin.py) defining register_pack(registry: MathRegistry):

from mcp_math_engine.core import MathProof, to_decimal
from mcp_math_engine.registry import MathRegistry

def register_pack(registry: MathRegistry):
    registry.register_module("custom.domain", priority=100, parent="basic", description="Custom domain formulas")
    registry.register_operation("my_formula", "custom.domain", my_handler)

All plugins in plugins/ are automatically discovered and registered on engine startup.

Available Tools

2 tools
calculateC

Execute deterministic calculation through hierarchical registry (submodule -> domain -> basic)

Inputs: operation (required), args.

list_hierarchyA

List all registered mathematical namespaces, operations, and priority dispatch tree

Inputs: no named parameters.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.2/5.0

    Scored across 2 tools

    Disambiguation5/5

    calculate and list_hierarchy have clearly distinct purposes: one executes a calculation and the other exposes discovery/registry metadata. An agent should not confuse these actions.

    Naming Consistency4/5

    Both names use lowercase snake_case, and list_hierarchy follows a clear verb_noun pattern. However, calculate is a bare verb without a noun object, which is a minor deviation from full consistency.

    Tool Count3/5

    The set is very small at two tools, making it feel borderline thin even though both tools are focused. A calculation server can work with an execute-and-discover pair, but additional operation introspection would likely be expected.

    Completeness3/5

    The surface covers execution and hierarchy listing, but there is no obvious tool for describing operation signatures, argument schemas, or validation details. Agents may hit dead ends when they need more than namespace/operation names to invoke calculate correctly.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables mathematical operations and calculations through an MCP server interface. Provides computational capabilities accessible via HTTP endpoints for mathematical processing tasks.
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      MCP server for deterministic numeric verification and spreadsheet auditing. Enables AI agents to verify math/finance claims, audit rows, and evaluate covenant rules with signed, independently checkable receipts.
      4
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Provides a safe scientific runtime for agents with typed math operations including calculus, algebra, statistics, unit conversion, and more via MCP tools.
      4
      Apache 2.0
    • A
      license
      A
      quality
      B
      maintenance
      Enables LLMs to perform deterministic arithmetic, high-precision decimal math, unit conversions, statistics, finance, matrix operations, complex-number calculations, numerical calculus, probability distributions, date math, and root solving through MCP tools. It supports both Streamable HTTP and stdio transport.
      13
      MIT