Skip to main content
Glama

Math MCP Server

by avanishd-3

Math MCP Server

Overview

This is an MCP (Model Context Protocol) server that can do basic arithmetic in 64 bit precision, along with matrix multiplication.

Features

  • Addition
  • Subtraction
  • Multiplication
  • Division
  • Matrix multiplication

Installation

Prerequisities

Ensure you have the following installed:

  • Python 3.13+
  • uv
Installing UV

See installation guide for all options.

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

or

brew install uv
Windows
winget install --id=astral-sh.uv -e

Clone the Repository

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

Integration with Clients

Claude Code

fastmcp install claude-code src/math_server.py

Claude Desktop

fastmcp install claude-desktop src/math_server.py

Cursor

fastmcp install cursor src/math_server.py

VS Code

Add the following .vscode/mcp.json and use your actual path.

{ "servers": { "Math MCP Server": { "command": "uv", "args": [ "run", "--with", "fastmcp", "--with", "numpy", "fastmcp", "run", "/absolute/path/Desktop/to/math-mcp-server/src/math_server.py:math_mcp" ] } }, }

Contributing

  1. Fork the repository
  2. Create a new branch:
git checkout -b add-feature
  1. Make changes and commit (remember to add unit tests in test/ directory)
git commit -m "Added a new feature"
  1. Push to your fork git push origin add-feature
  2. Open a pull request.

Project Structure

/ ├── src │ └── math_server.py ├── tests │   ├── test_arithmetic.py │   │   └── astro.svg │   ├── test_linear_algebra.py ├── pytest.ini ├── pyproject.toml └── uv.lock

Architecture

This MCP server uses Fast MCP 2.0, which provides many more features than Fast MCP 1.0, which is what the official Python SDK for MCP uses.

Also, the unit tests are written with Pytest, which is what Fast MCP 2.0 recommends.

Lastly, if you don't know, uv is a much faster version of pip that also provides a lockfile for project dependencies (this will be familiar if you've used npm or cargo before). The MCP Python SDK itself uses uv, and I use it for all new Python projects, because it's 10-100x faster than pip, and the lockfile makes dependency version management much simpler.

Install Server
A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

Enables basic arithmetic operations (addition, subtraction, multiplication, division) with 64-bit precision and matrix multiplication capabilities. Provides mathematical computation tools for AI assistants through the Model Context Protocol.

  1. Overview
    1. Features
      1. Installation
        1. Prerequisities
        2. Clone the Repository
      2. Integration with Clients
        1. Claude Code
        2. Claude Desktop
        3. Cursor
        4. VS Code
      3. Contributing
        1. Project Structure
          1. Architecture

        Related MCP Servers

        • A
          security
          F
          license
          A
          quality
          A server that provides tools for performing basic arithmetic operations (addition, subtraction, multiplication, division) via the Model Context Protocol.
          Last updated -
          4
          JavaScript
          • Apple
        • 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
          JavaScript
        • A
          security
          F
          license
          A
          quality
          A simple Model Context Protocol server that provides basic arithmetic operations (addition, subtraction, multiplication, division) as tools that can be called by Large Language Models.
          Last updated -
          4
          JavaScript
        • -
          security
          F
          license
          -
          quality
          Provides basic arithmetic operations and advanced mathematical functions through the Model Context Protocol (MCP), with features like calculation history tracking and expression evaluation.
          Last updated -
          Python

        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/avanishd-3/math-mcp'

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