Skip to main content
Glama

Math MCP Server

MathAgent

A minimal math agent that delegates all calculations to an MCP (Model Context Protocol) server. The agent uses MCP tools for every operation—no mental math—so you get consistent, inspectable results.

What’s inside

  • Agent: built with pydantic-ai, connected via MCP stdio
  • MCP Server: powered by fastmcp, exposing math tools

Available MCP tools

  • add
  • subtract
  • multiply
  • divide
  • power
  • log

Coming soon:

  • modulus

Requirements

  • Python 3.13+
  • uv (Python package/dependency manager)
  • A Groq API key (for the LLM model)
  • A Logfire token (for instrumentation)

Setup

  1. Clone the repository
  2. Create your environment file
    • Set these keys:
      • groq_key — your Groq API key
      • logfire_key — your Logfire token

Run the agent

Run with uv so dependencies are resolved and the MCP server is launched as a toolset:

uv run agent.py

Notes:

  • The agent is configured to use the Groq model qwen/qwen3-32b (see agent.py). You can swap models as needed.
  • The agent will reject non-math questions by design.
  • All calculations route through the MCP tools defined in mcp-server.py.

Contributing

Contributions are welcome—feel free to open issues or submit pull requests.

-
security - not tested
F
license - not found
-
quality - not tested

Enables mathematical calculations through basic arithmetic operations including addition, subtraction, multiplication, division, exponentiation, and logarithms. Provides a simple interface for AI agents to perform mathematical computations.

  1. What’s inside
    1. Available MCP tools
  2. Requirements
    1. Setup
      1. Run the agent
        1. Contributing

          Related MCP Servers

          • A
            security
            F
            license
            A
            quality
            A server that provides advanced mathematical and financial calculation capabilities for AI code assistants, enabling them to perform complex calculations like symbolic calculus, numerical methods, and financial analysis without implementing algorithms directly.
            Last updated -
            18
            4
          • A
            security
            F
            license
            A
            quality
            A simple server that provides basic arithmetic operations (addition, subtraction, multiplication, division) as tools that can be called by Large Language Models through the Model Context Protocol.
            Last updated -
            4
          • -
            security
            F
            license
            -
            quality
            A service that processes natural language requests to perform mathematical calculations by integrating Claude AI with a calculator API through the Model-Context-Protocol architecture.
            Last updated -
            21
          • -
            security
            F
            license
            -
            quality
            A tool-augmented AI server that exposes basic math operations (add, subtract, multiply) via FastMCP and Server-Sent Events, allowing LLM agents to discover and use these mathematical tools.
            Last updated -

          View all related MCP servers

          MCP directory API

          We provide all the information about MCP servers via our MCP API.

          curl -X GET 'https://glama.ai/api/mcp/v1/servers/ArjunKrish7356/MathAgent'

          If you have feedback or need assistance with the MCP directory API, please join our Discord server