home / mcp / math mcp server

Math MCP Server

Math MCP server to boost LLMs math abilities

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "avanishd-3-math-mcp": {
      "command": "uv",
      "args": [
        "run",
        "--with",
        "fastmcp",
        "--with",
        "numpy",
        "fastmcp",
        "run",
        "/absolute/path/Desktop/to/math-mcp-server/src/math_server.py:math_mcp"
      ]
    }
  }
}

You have a Math MCP Server that performs 64‑bit arithmetic (addition, subtraction, multiplication, division) and matrix multiplication, enabling clients to request precise math computations through the MCP protocol.

How to use

To use the Math MCP Server, connect your MCP-enabled client and point it to the local or remote MCP endpoint you run. Your client sends arithmetic or matrix operations to the server, and you receive the computed results in real time. Typical usage involves selecting the math endpoint from your client’s list of MCP servers, choosing the desired operation (add, subtract, multiply, divide, or matrix multiply), and sending the appropriate operands. You can chain multiple operations in a session to perform complex calculations without leaving the MCP environment.

How to install

Prerequisites you need before installing the Math MCP Server are:

  • Python 3.13+
  • uv

Install uv on your operating system. Choose the method you prefer below.

# Unix/MacOS
curl -LsSf https://astral.sh/uv/install.sh | sh
```

```
brew install uv
```

```
# Windows
winget install --id=astral-sh.uv  -e

Clone the repository and sync dependencies

Clone the Math MCP Server repository and synchronize dependencies with uv. You will then be ready to run the server.

git clone https://github.com/avanishd-3/math-mcp.git
cd math-mcp-server
uv sync

Run the server (stdio MCP config)

Start the Math MCP Server using uv with the Fast MCP integration and numpy. Replace the path with your actual project path.

uv run --with fastmcp --with numpy fastmcp run /absolute/path/Desktop/to/math-mcp-server/src/math_server.py:math_mcp

Available tools

add

Performs addition of two or more 64-bit numbers and returns the sum.

subtract

Subtracts one or more values from a base value, returning the resulting difference.

multiply

Multiplies two or more numbers with 64-bit precision and returns the product.

divide

Divides one value by another, returning the quotient with 64-bit precision.

matmul

Performs matrix multiplication on matrices using 64-bit floating point precision.