rohitpatilll/math-calculator-mcp-server
If you are the rightful owner of math-calculator-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
A comprehensive MCP server designed to perform mathematical calculations with ease and precision.
Math Calculator MCP Server
A comprehensive MCP server designed to perform mathematical calculations with ease and precision. Perfect for basic arithmetic, advanced mathematical operations, percentage calculations, and complex expression evaluation.
Features
- Basic arithmetic operations (addition, subtraction, multiplication, division)
- Advanced mathematical functions (power, square root, absolute value, rounding)
- Comprehensive percentage calculations
- Complex expression evaluation with proper order of operations
- Input validation and error handling for safe calculations
- Professional-grade mathematical processing
Tools Available
basic_arithmetic
Perform basic arithmetic operations with two numbers. Supports addition, subtraction, multiplication, and division with proper error handling for division by zero.
Example:
{
"operation": "multiply",
"number1": 25,
"number2": 4
}
Returns: 25 × 4 = 100
advanced_math
Execute advanced mathematical operations including power calculations, square roots, absolute values, and various rounding functions.
Example:
{
"operation": "power",
"number": 2,
"exponent": 8
}
Returns: 2^8 = 256
percentage_calculator
Calculate percentages, percentage changes, and determine what percentage one number represents of another. Essential for business and statistical calculations.
Example:
{
"calculation_type": "percentage_change",
"value": 120,
"base_value": 100
}
Returns: Change from 100 to 120 = +20.00%
expression_evaluator
Evaluate complex mathematical expressions with proper order of operations. Supports parentheses, multiple operations, and mathematical functions like sqrt.
Example:
{
"expression": "(10 + 5) * 2 - sqrt(16)"
}
Returns: (10 + 5) * 2 - sqrt(16) = 26
Installation
npm install
Usage
With MCP Inspector
npm run inspector
With Claude Desktop
Add this configuration to your Claude Desktop settings:
{
"mcpServers": {
"math-calculator": {
"command": "node",
"args": ["[absolute-path-to-server]/server.js"]
}
}
}
Requirements
- Node.js 18.0.0 or higher
- @modelcontextprotocol/sdk ^0.5.0
Structure
server.js- Main MCP server implementationpackage.json- Node.js package configurationREADME.md- This documentation file
Testing
The server has been tested with various scenarios including:
- Basic arithmetic with positive and negative numbers
- Division by zero protection
- Square root of negative numbers validation
- Complex expression parsing and evaluation
- Percentage calculations with edge cases
- Input validation and error handling
Generated by MCP Server Generator