Calculator MCP Server
Click on "Install 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., "@Calculator MCP Serverwhat's 15 divided by 3 plus 7 squared?"
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.
Calculator MCP Server
A simple Model Context Protocol (MCP) server that provides basic calculator functionality through MCP tools.
Features
This MCP server provides the following calculator tools:
add: Add two numbers together
subtract: Subtract second number from first number
multiply: Multiply two numbers together
divide: Divide first number by second number (with zero-division protection)
power: Raise first number to the power of second number
sqrt: Calculate square root of a number (with negative number protection)
Related MCP server: Calculator MCP Server
Installation
Install dependencies:
npm installBuild the TypeScript code:
npm run buildUsage
Running the Server
Start the MCP server:
npm startOr run in development mode:
npm run devMCP Client Configuration
To use this calculator MCP server with an MCP client (like Claude Desktop), add it to your MCP configuration:
{
"mcpServers": {
"calculator": {
"command": "node",
"args": ["/path/to/calculator-mcp/dist/index.js"],
"env": {}
}
}
}Available Tools
add
Adds two numbers together.
Parameters:
a(number),b(number)Example:
add(5, 3)returns5 + 3 = 8
subtract
Subtracts the second number from the first.
Parameters:
a(number),b(number)Example:
subtract(10, 4)returns10 - 4 = 6
multiply
Multiplies two numbers together.
Parameters:
a(number),b(number)Example:
multiply(6, 7)returns6 × 7 = 42
divide
Divides the first number by the second.
Parameters:
a(number),b(number)Example:
divide(15, 3)returns15 ÷ 3 = 5Error handling: Returns error for division by zero
power
Raises the base to the power of the exponent.
Parameters:
base(number),exponent(number)Example:
power(2, 8)returns2^8 = 256
sqrt
Calculates the square root of a number.
Parameters:
number(number)Example:
sqrt(16)returns√16 = 4Error handling: Returns error for negative numbers
Development
Project Structure
calculator-mcp/
├── src/
│ └── index.ts # Main MCP server implementation
├── dist/ # Compiled JavaScript output
├── package.json # Dependencies and scripts
├── tsconfig.json # TypeScript configuration
└── README.md # This fileBuilding
npm run buildDevelopment Mode
npm run devError Handling
The calculator includes proper error handling for:
Division by zero
Square root of negative numbers
Invalid tool names
General execution errors
All errors are returned with appropriate error messages and the isError flag set to true.
License
MIT
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityDmaintenanceEnables AI applications to perform basic mathematical operations like addition and subtraction through MCP tools. Also provides REST API endpoints for the same operations.Last updatedMIT
- Flicense-qualityDmaintenanceProvides mathematical operation tools including basic arithmetic (add, subtract, multiply, divide), power and square root calculations, and safe evaluation of mathematical expressions.Last updated
- Alicense-qualityDmaintenanceProvides comprehensive mathematical capabilities including basic arithmetic, advanced functions, statistical tools, and access to mathematical constants. It allows users to perform computations and generate math-related prompts through a standardized MCP interface.Last updatedMIT
- Alicense-qualityDmaintenanceProvides a comprehensive set of mathematical functions as MCP tools, enabling language models to perform calculations including arithmetic, trigonometry, logarithms, and more.Last updated191MIT
Related MCP Connectors
This MCP server enables users to perform scientific computations regarding linear algebra and vect…
Number utilities MCP.
Precision math engine for AI agents. 203 exact methods. Zero hallucination.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/tech-sushant/calculator-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server