calculator
A Model Context Protocol (MCP) server that provides Claude with advanced mathematical calculation capabilities
claude mcp add --transport stdio huhabla-calculator-mcp-server uvx --from calculator-mcp-server@git+https://github.com/huhabla/calculator-mcp-server.git -- calculator-mcp-server --stdio
How to use
The Mathematical Calculator MCP Server exposes a suite of mathematical tools that can be requested through Claude via the MCP protocol. It supports basic expression evaluation, symbolic mathematics (solving equations, derivatives, and integrals), statistical analysis (mean, median, mode, variance, standard deviation, correlation, linear regression, and confidence intervals), and matrix operations (addition, multiplication, and transposition). Once integrated with Claude Desktop, you can send natural-language prompts or structured requests to perform these computations and receive precise results returned in a structured format. The server relies on a Python-based runtime and SymPy/NumPy/SciPy for the mathematical capabilities.
Typical usage involves sending a request such as a symbolic calculation or a dataset operation, for example requesting the derivative of an expression, solving a quadratic equation, computing a mean and standard deviation from a dataset, or multiplying two matrices. The tools are designed to be safe for evaluation of mathematical expressions and to provide results that can be directly used in further analytical steps or presentations.
How to install
Prerequisites:
- Python 3.10+ (recommended Python 3.11+)
- uv (recommended) or pip
- Claude Desktop app for integration
Installation steps:
-
Clone the repository: git clone https://github.com/huhabla/calculator-mcp-server.git cd calculator-mcp-server
-
Set up the Python environment (one of the following options): Option A: Use the provided setup script chmod +x setup_venv.sh ./setup_venv.sh
Option B: Manually create and activate a virtual environment python3 -m venv venv source venv/bin/activate pip install -r requirements.txt
-
Run doctests to verify: bash run_doctests.sh
-
Ensure the MCP server is reachable by Claude Desktop using the uvx integration described in the README.
Additional notes
Tips and notes:
- The server integrates with Claude Desktop using uvx with the --stdio flag to enable proper communication. Ensure the configuration in Claude’s mcpServers section matches the exact command and arguments.
- If you encounter dependency issues, verify that the active Python environment has SymPy, NumPy, and SciPy as required by the server.
- For development, you can run fastmcp or use the provided doctest suite to validate functionality before production use.
- When using matrix operations, ensure matrices are properly shaped for multiplication (e.g., M1: a×b, M2: b×c results in a×c).
- If you need to customize the server name or integration, you can adjust the "calculator" key under mcpServers in the Claude configuration as needed.
Related MCP Servers
mcp-vegalite
MCP server from isaacwasserman/mcp-vegalite-server
github-chat
A Model Context Protocol (MCP) for analyzing and querying GitHub repositories using the GitHub Chat API.
nautex
MCP server for guiding Coding Agents via end-to-end requirements to implementation plan pipeline
pagerduty
PagerDuty's official local MCP (Model Context Protocol) server which provides tools to interact with your PagerDuty account directly from your MCP-enabled client.
futu-stock
mcp server for futuniuniu stock
mcp -boilerplate
Boilerplate using one of the 'better' ways to build MCP Servers. Written using FastMCP