Mathematical Calculator MCP Server
A Model Context Protocol (MCP) server that provides Claude with advanced mathematical calculation capabilities
huhabla
README
Mathematical Calculator MCP Server
This is a Model Context Protocol (MCP) server that provides Claude with advanced mathematical calculation capabilities, including symbolic math, statistical analysis, and matrix operations.
Features
The Mathematical Calculator MCP Server provides the following tools:
- Basic Calculations: Evaluate mathematical expressions safely
- Symbolic Mathematics:
- Solve equations (linear, quadratic, polynomial, etc.)
- Calculate derivatives of expressions
- Compute integrals of expressions
- Statistical Analysis:
- Mean, median, mode
- Variance, standard deviation
- Correlation coefficient
- Linear regression
- Confidence intervals
- Matrix Operations:
- Matrix addition
- Matrix multiplication
- Matrix transposition
Installation
Prerequisites
- Python 3.10+ (recommended: Python 3.11+)
- uv (recommended) or pip
- Claude Desktop app (to use the MCP server with Claude)
Installation Steps
-
Clone the repository:
git clone https://github.com/huhabla/calculator-mcp-server.git cd calculator-mcp-server
-
(Option 1) Setup with the provided script:
chmod +x setup_venv.sh ./setup_venv.sh
(Option 2) Or manually set up the virtual environment:
python3 -m venv venv source venv/bin/activate pip install -r requirements.txt
-
Run doc-tests to verify everything works:
bash run_doctests.sh
Integration with Claude Desktop
To use this MCP server with Claude Desktop:
-
Make sure you have uv installed (Installation Guide)
-
Install the MCP server in Claude Desktop:
fastmcp install calculator_server.py
Or with a custom name:
fastmcp install calculator_server.py --name "Math Calculator"
-
Once installed, Claude will automatically have access to all the mathematical tools and functions.
Usage Examples
After integrating with Claude Desktop, you can ask Claude to perform various mathematical operations. Here are some examples:
Basic Calculations
Can you calculate 3.5^2 * sin(pi/4)?
Solving Equations
Solve the following equation: x^2 - 5x + 6 = 0
Calculating Derivatives
What's the derivative of sin(x^2) with respect to x?
Computing Integrals
Calculate the integral of x^2 * e^x
Statistical Analysis
Find the mean, median, mode, and standard deviation of this dataset: [23, 45, 12, 67, 34, 23, 18, 95, 41, 23]
Linear Regression
Perform a linear regression on these points: (1,2), (2,3.5), (3,5.1), (4,6.5), (5,8.2)
Matrix Operations
Multiply these two matrices:
[1, 2, 3]
[4, 5, 6]
and
[7, 8]
[9, 10]
[11, 12]
Development
Testing
Run the comprehensive doctest suite:
bash run_doctests.sh
Interactive Development Mode
For development and debugging, you can use the FastMCP development mode:
fastmcp dev calculator_server.py
This will start a local web interface where you can test all tools interactively.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgements
Recommended Servers
Crypto Price & Market Analysis MCP Server
A Model Context Protocol (MCP) server that provides comprehensive cryptocurrency analysis using the CoinCap API. This server offers real-time price data, market analysis, and historical trends through an easy-to-use interface.
MCP PubMed Search
Server to search PubMed (PubMed is a free, online database that allows users to search for biomedical and life sciences literature). I have created on a day MCP came out but was on vacation, I saw someone post similar server in your DB, but figured to post mine.
dbt Semantic Layer MCP Server
A server that enables querying the dbt Semantic Layer through natural language conversations with Claude Desktop and other AI assistants, allowing users to discover metrics, create queries, analyze data, and visualize results.
mixpanel
Connect to your Mixpanel data. Query events, retention, and funnel data from Mixpanel analytics.

Sequential Thinking MCP Server
This server facilitates structured problem-solving by breaking down complex issues into sequential steps, supporting revisions, and enabling multiple solution paths through full MCP integration.

Nefino MCP Server
Provides large language models with access to news and information about renewable energy projects in Germany, allowing filtering by location, topic (solar, wind, hydrogen), and date range.
Vectorize
Vectorize MCP server for advanced retrieval, Private Deep Research, Anything-to-Markdown file extraction and text chunking.
Mathematica Documentation MCP server
A server that provides access to Mathematica documentation through FastMCP, enabling users to retrieve function documentation and list package symbols from Wolfram Mathematica.
kb-mcp-server
An MCP server aimed to be portable, local, easy and convenient to support semantic/graph based retrieval of txtai "all in one" embeddings database. Any txtai embeddings db in tar.gz form can be loaded
Research MCP Server
The server functions as an MCP server to interact with Notion for retrieving and creating survey data, integrating with the Claude Desktop Client for conducting and reviewing surveys.