mcp-calculator
by mitvvce-mdot
MCP Calculator Server
A simple Model Context Protocol server that exposes basic calculator tools. Built with the official mcp Python SDK and FastMCP.
Tools
Tool | Description |
| Add two numbers |
| Subtract one number from another |
| Multiply two numbers |
| Divide one number by another |
| Raise a number to a power |
| Compute the square root of a number |
Setup
Requires Python 3.12+ and uv.
cd mcp-calculator
uv syncRun
Start the server (stdio transport, default for MCP clients like Cursor):
uv run calculator_server.pyFor HTTP transport (e.g. MCP Inspector), change the last line of calculator_server.py to mcp.run(transport="streamable-http") and connect to http://localhost:8000/mcp.
Cursor configuration
Add this to your Cursor MCP settings:
{
"mcpServers": {
"calculator": {
"command": "uv",
"args": [
"run",
"--directory",
"/Users/premithun/Downloads/cursor_projects/mcp-calculator",
"calculator_server.py"
]
}
}
}Replace the --directory path with the absolute path to this project on your machine.