Math MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Math MCP Server What is 15 divided by 3?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Math MCP Server
A clean and simple Model Context Protocol (MCP) server built with FastMCP that provides four fundamental mathematical operations as tools.
Features
This MCP server exposes the following tools:
add - Add two numbers together
subtract - Subtract the second number from the first
multiply - Multiply two numbers together
divide - Divide the first number by the second (with zero-division protection)
Related MCP server: Calculator MCP Server
Installation
# Install dependencies
uv syncUsage
Running the Server
The server can be run directly using:
uv run math-mcp-serverConfiguring in Kiro or Other MCP Clients
Add this server to your MCP client configuration (e.g., ~/.kiro/settings/mcp.json):
{
"mcpServers": {
"math": {
"command": "uv",
"args": [
"--directory",
"d:\\MCP\\math-mcp-server",
"run",
"math-mcp-server"
]
}
}
}Example Tool Usage
Once configured, you can use the tools through your MCP client:
Addition:
Input:
a=5, b=3Output:
5 + 3 = 8
Subtraction:
Input:
a=10, b=4Output:
10 - 4 = 6
Multiplication:
Input:
a=7, b=6Output:
7 × 6 = 42
Division:
Input:
a=15, b=3Output:
15 ÷ 3 = 5.0
Code Structure
The implementation is extremely simple and readable using FastMCP:
from fastmcp import FastMCP
mcp = FastMCP("Math Operations Server")
@mcp.tool()
def add(a: float, b: float) -> str:
"""Add two numbers together."""
result = a + b
return f"{a} + {b} = {result}"
# ... and so on for subtract, multiply, divideEach operation is a separate @mcp.tool() decorated function, making the code:
Easy to read and understand
Simple to extend with new operations
Self-documenting with type hints and docstrings
Project Structure
math-mcp-server/
├── src/
│ └── math_mcp_server/
│ └── __init__.py # Main server implementation (4 simple functions!)
├── pyproject.toml # Project configuration
└── README.md # This fileRequirements
Python >= 3.14
fastmcp >= 3.4.6
License
MIT
Available Tools
4 toolsaddA
Add two numbers together.
Inputs: a (required), b (required). Returns: result
divideA
Divide first number by second number.
Inputs: a (required), b (required). Returns: result
multiplyA
Multiply two numbers together.
Inputs: a (required), b (required). Returns: result
subtractA
Subtract second number from first number.
Inputs: a (required), b (required). Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool performs a distinct arithmetic operation (add, subtract, multiply, divide) with no overlap or ambiguity. An agent can clearly tell them apart based on their names and descriptions.
All tool names are single, lowercase verbs that directly describe their operation (add, subtract, multiply, divide). The naming pattern is perfectly consistent and predictable.
With exactly four tools, this server is well-scoped for basic arithmetic operations. It neither feels thin nor bloated, fitting comfortably within the ideal range for a focused utility server.
The four fundamental arithmetic operations cover the core domain of a basic math server. There are no obvious gaps for the stated purpose, as these are the essential operations one would expect.
Maintenance
Related MCP Connectors
Math.js MCP — wraps the mathjs.org API (free, no auth)
Safe scientific calculator MCP for numeric expressions
Free calculators as MCP tools: finance, taxes, health, units, dates. Search, fetch & compute.
Related MCP Servers
- AlicenseAqualityDmaintenanceProvides basic mathematical calculation functionality through MCP tools including arithmetic operations, exponentiation, and square root calculations. Features proper error handling for edge cases like division by zero and negative square roots.653 npm2MIT
- FlicenseNot gradedqualityDmaintenanceProvides basic calculator operations (add, subtract, multiply, divide) as MCP tools for use with Claude Desktop and other MCP clients.-
- AlicenseAqualityDmaintenanceProvides basic arithmetic operations (add, subtract, multiply, divide) through MCP, enabling AI clients to perform calculations via natural language.410 npmMIT
- FlicenseNot gradedqualityCmaintenanceEnables AI agents to perform arithmetic operations such as addition, subtraction, multiplication, and division through standardized MCP tools.1-