MCP Calculator

MCP Calculator

MCP server for mathematical calculations with high-precision arithmetic, statistics, unit conversion, and financial math tools.

Category
Visit Server

README

Logo

MCP Calculator

A modern Model Context Protocol server for mathematical calculations. Exposes 13 tools (6 core + 7 specialized) with high-precision arithmetic, a safe expression evaluator, statistics, unit conversion, and financial math.

Requirements

  • Python 3.10+
  • uv (or Docker, for the containerized setup)

Installation

uv venv

uv pip install -e ".[dev]"

Running

The server supports two transports, selected via the MCP_TRANSPORT environment variable (see Configuration).

STDIO

The server speaks MCP over stdio by default (the transport used by most MCP clients such as Claude Desktop and Claude Code):

source .venv/bin/activate

mcp-calculator

Streamable HTTP

To serve over streamable HTTP instead:

source .venv/bin/activate

MCP_TRANSPORT=http mcp-calculator

The HTTP endpoint is then available at http://0.0.0.0:8080/mcp/.

Docker

Build the image and run it in HTTP mode (the image defaults to HTTP on port 8080):

docker build -t mcp-calculator .

docker run --rm -p 8080:8080 mcp-calculator

Override any setting at runtime with -e, e.g. a different port:

docker run --rm -p 9000:9000 -e MCP_PORT=9000 mcp-calculator

Configuration

Variable Default Description
MCP_TRANSPORT stdio Transport to use: stdio or http (streamable HTTP).
MCP_HOST 0.0.0.0 Host/interface to bind when using HTTP. Use 0.0.0.0 to expose it.
MCP_PORT 8080 Port to listen on when using HTTP.

Available Tools

Core

Tool Description
basic_math add / subtract / multiply / divide with decimal precision (0-15)
advanced_math trig, inverse trig, log/ln, sqrt, abs, factorial, exp, pow
expression_eval evaluate expressions with variables, constants, and functions
statistics_analysis mean, median, mode, std_dev, variance, percentile, range, skewness, kurtosis, summary
unit_conversion length, weight, temperature, volume, area
financial_calc simple/compound interest, loan payment, ROI, present/future value

Specialized

Tool Description
stats_summary full statistical overview of a dataset
percentile a specific percentile (0-100) of a dataset
batch_conversion convert many values between units at once
npv Net Present Value of cash flows
irr Internal Rate of Return (Newton-Raphson)
loan_comparison compare loans, return the lowest monthly payment
investment_scenarios compare investments, return the highest return

Development

Testing

Run the test suite with:

pytest

License

MIT

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured