Calculator MCP Server
A mathematical utility server implementing the Model Context Protocol to provide tools for basic and advanced calculations. It enables users to perform operations such as addition, subtraction, powers, square roots, and percentages through natural language.
README
Calculator MCP Server
A simple calculator server implementing the Model Context Protocol (MCP).
Features
This MCP server provides the following calculator operations:
- add: Add two numbers together
- subtract: Subtract second number from first
- multiply: Multiply two numbers
- divide: Divide first number by second (with zero-check)
- power: Raise a number to a power
- sqrt: Calculate square root
- percentage: Calculate percentage of a number
Installation
Using uv (recommended)
The easiest way is to use uvx which was just installed:
# Test the server directly
export PATH="$HOME/.local/bin:$PATH"
uvx --from . --with mcp calculator-mcp-server
Manual Installation with pip
If you prefer pip, install in a virtual environment:
# Create virtual environment
python -m venv venv
source venv/bin/activate
# Install dependencies
pip install git+https://github.com/modelcontextprotocol/python-sdk.git
# Run the server
python calculator_mcp_server.py
Configuration
Add this to your Kiro MCP configuration file (.kiro/settings/mcp.json):
{
"mcpServers": {
"calculator": {
"command": "/Users/anshikagupta/.local/bin/uvx",
"args": ["--from", "/Users/anshikagupta/calculator", "--with", "mcp", "python", "calculator_mcp_server.py"],
"disabled": false,
"autoApprove": ["add", "subtract", "multiply", "divide", "power", "sqrt", "percentage"]
}
}
}
Usage Examples
Once configured, you can use the calculator through Kiro:
- "Add 5 and 3"
- "What's 10 divided by 2?"
- "Calculate 2 to the power of 8"
- "What's the square root of 144?"
- "Calculate 20% of 500"
Tools Available
add
Add two numbers together.
- Parameters:
a(number),b(number) - Example:
{"a": 5, "b": 3}→ "5 + 3 = 8"
subtract
Subtract second number from first.
- Parameters:
a(number),b(number) - Example:
{"a": 10, "b": 3}→ "10 - 3 = 7"
multiply
Multiply two numbers.
- Parameters:
a(number),b(number) - Example:
{"a": 4, "b": 5}→ "4 × 5 = 20"
divide
Divide first number by second.
- Parameters:
a(number),b(number) - Example:
{"a": 20, "b": 4}→ "20 ÷ 4 = 5"
power
Raise base to exponent.
- Parameters:
base(number),exponent(number) - Example:
{"base": 2, "exponent": 8}→ "2^8 = 256"
sqrt
Calculate square root.
- Parameters:
number(number, non-negative) - Example:
{"number": 144}→ "√144 = 12"
percentage
Calculate percentage of a number.
- Parameters:
number(number),percent(number) - Example:
{"number": 500, "percent": 20}→ "20% of 500 = 100"
License
MIT
Recommended Servers
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.
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.
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.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
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.
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.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
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.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.