Skip to main content
Glama
Math & Calculator MCP Server

Math & Calculator MCP Server

by Ankluna72

🧮 Math & Calculator MCP Server

A powerful Model Context Protocol (MCP) Server that provides advanced mathematical utilities and calculator tools for AI assistants like Claude and other MCP-compatible clients.

License: MIT Node.js Version TypeScript

📖 About

This MCP server exposes mathematical tools that AI assistants can use to perform calculations, statistical analysis, unit conversions, and more. Built with the Model Context Protocol SDK, it seamlessly integrates with Claude Desktop, VSCode, and other MCP clients.

Author: Jefferson Rosas Chambilla
Repository: https://github.com/Ankluna72/Math-Calculator-MCP-Server-

Related MCP server: Math Calculation MCP Server

✨ Features

🔢 Basic Calculator

  • Addition, subtraction, multiplication, division

  • Power, square root, modulo operations

  • Error handling (division by zero, invalid operations)

📊 Statistical Analysis

  • Mean, median, mode

  • Standard deviation and variance

  • Complete statistical summaries

🔄 Unit Conversions

  • Length: meters, kilometers, miles, feet, inches

  • Weight: kilograms, grams, pounds, ounces

  • Temperature: Celsius, Fahrenheit, Kelvin

📐 Equation Solver

  • Quadratic equation solver (ax² + bx + c = 0)

  • Handles real and complex solutions

  • Discriminant analysis

💯 Percentage Calculator

  • Percentage of a number

  • Percentage increase/decrease

  • "What percentage is X of Y?"

📏 Trigonometry

  • Sin, cos, tan (and inverse functions)

  • Angle calculations in degrees

  • Precise floating-point results

🚀 Installation

Prerequisites

  • Node.js >= 18.0.0

  • npm or yarn

Clone and Install

git clone https://github.com/Ankluna72/Math-Calculator-MCP-Server-.git
cd Math-Calculator-MCP-Server-
npm install
npm run build

⚙️ Configuration

For Claude Desktop

Add to your Claude Desktop config file (claude_desktop_config.json):

Windows: %APPDATA%\Claude\claude_desktop_config.json
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Linux: ~/.config/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "math-calculator": {
      "command": "node",
      "args": [
        "C:\\path\\to\\Math-Calculator-MCP-Server-\\dist\\index.js"
      ]
    }
  }
}

For VSCode with Cline Extension

Add to VSCode settings (.vscode/settings.json or User Settings):

{
  "mcp.servers": {
    "math-calculator": {
      "command": "node",
      "args": [
        "C:\\path\\to\\Math-Calculator-MCP-Server-\\dist\\index.js"
      ]
    }
  }
}

📚 Usage Examples

Once configured, your AI assistant can use these tools automatically. Here are some example requests:

Basic Calculations

"Calculate 25 * 4"
"What is the square root of 144?"
"Divide 100 by 7"

Statistics

"Calculate the mean of [10, 20, 30, 40, 50]"
"Find median and mode for these numbers: [5, 3, 5, 2, 8, 5]"
"Give me all statistics for [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]"

Unit Conversions

"Convert 100 kilometers to miles"
"How many pounds is 75 kilograms?"
"Convert 32 Fahrenheit to Celsius"

Solve Equations

"Solve x² - 5x + 6 = 0"
"Find solutions for 2x² + 3x - 2 = 0"

Percentages

"What is 15% of 200?"
"Increase 50 by 20%"
"What percentage is 25 of 200?"

Trigonometry

"Calculate sin(30°)"
"What is cos(45°)?"
"Find tan(60°)"

🛠️ Available Tools

Tool

Description

calculate

Basic arithmetic operations

statistics

Statistical analysis of number arrays

convert_units

Convert between different units

solve_equation

Solve quadratic equations

percentage

Percentage calculations

trigonometry

Trigonometric functions

📁 Project Structure

Math-Calculator-MCP-Server-/
├── src/
│   └── index.ts          # Main MCP server implementation
├── dist/                 # Compiled JavaScript (after build)
├── package.json          # Project dependencies
├── tsconfig.json         # TypeScript configuration
├── .gitignore
└── README.md

🔧 Development

# Install dependencies
npm install

# Build the project
npm run build

# Development mode (watch for changes)
npm run dev

# Start the server
npm start

🧪 Testing

You can test the server manually using stdio communication:

npm start

Then send MCP protocol messages via stdin to test tool execution.

📝 License

MIT License - see LICENSE file for details

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository

  2. Create your feature branch (git checkout -b feature/AmazingFeature)

  3. Commit your changes (git commit -m 'Add some AmazingFeature')

  4. Push to the branch (git push origin feature/AmazingFeature)

  5. Open a Pull Request

📧 Contact

Jefferson Rosas Chambilla

🌟 Acknowledgments

  • Built with the Model Context Protocol SDK

  • Inspired by the need for mathematical tools in AI assistants

  • Thanks to Anthropic for developing the MCP standard


⭐ If you find this project useful, please consider giving it a star on GitHub!

Available Tools

6 tools
calculateC

Perform basic arithmetic operations (add, subtract, multiply, divide, power, sqrt, modulo)

Inputs: operation (required), a (required), b.

convert_unitsB

Convert between different units (length, weight, temperature)

Inputs: value (required), from (required), to (required).

percentageA

Calculate percentages (percentage of a number, percentage increase/decrease, what percentage X is of Y)

Inputs: operation (required), value1 (required), value2 (required).

solve_equationB

Solve quadratic equations (ax² + bx + c = 0)

Inputs: a (required), b (required), c (required).

statisticsB

Calculate statistical measures (mean, median, mode, standard deviation, variance) from a list of numbers

Inputs: numbers (required), operation (required).

trigonometryB

Calculate trigonometric functions (sin, cos, tan, asin, acos, atan) in degrees

Inputs: function (required), angle (required).

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 6 tools

    Disambiguation5/5

    Each tool has a clearly distinct mathematical purpose with no overlap: calculate handles basic arithmetic, convert_units deals with unit conversions, percentage focuses on percentage calculations, solve_equation solves quadratic equations, statistics computes statistical measures, and trigonometry handles trigonometric functions. The descriptions are specific enough to prevent misselection.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern (e.g., calculate, convert_units, solve_equation) using snake_case throughout. The naming is predictable and readable, with no deviations in style or convention.

    Tool Count5/5

    With 6 tools, the server is well-scoped for a math and calculator domain, covering arithmetic, conversions, percentages, equations, statistics, and trigonometry. Each tool earns its place without being too sparse or bloated, fitting typical expectations for such a utility.

    Completeness4/5

    The tool set covers core mathematical operations comprehensively, including basic calculations, unit conversions, percentages, equation solving, statistics, and trigonometry. Minor gaps exist, such as no tools for calculus (e.g., derivatives/integrals) or geometry (e.g., area/volume calculations), but agents can work around these for most common math tasks.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      A
      quality
      D
      maintenance
      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.
      6
      3
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      Provides comprehensive mathematical capabilities including basic arithmetic, advanced functions, statistical tools, and access to mathematical constants. It allows users to perform computations and generate math-related prompts through a standardized MCP interface.
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Provides a comprehensive set of mathematical functions as MCP tools, enabling language models to perform calculations including arithmetic, trigonometry, logarithms, and more.
      24 npm
      1
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables evaluating mathematical expressions and converting between units such as length, weight, temperature, volume, and time.
      294 npm
      MIT