Calculator 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., "@Calculator MCP Serverwhat is 20% of 500?"
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 built in Node.js that provides some basic arithmetic calculation tools.The srver uses official MCP JavaScript SDK, Zod for input validation and Standard Input/Output (stdio to communicate with MCP clients.
Features:
Addition of two numbers
Subtraction of one number from another
Multiplication of two numbers
Division of a number by another number with handling of divide by zero error
Percentage calculation
Technologies used:
JavaScript ES Module
Node.js
Model Context Protocol (MCP)
MCP JavaScript SDK
Zod
Tools Available:
Name | Description | Example |
Add | Adds two numbers and returns their sum | a = 2, b = 3, result = 5 |
Subtract | Subtracts the second number from the first and returns the difference | a = 10, b = 5, result = 5 a = 5, b = 8, result = -3 |
Multiply | Multiplies two numbers and returns their product | a = 4, b = 3, result = 12 |
Divide | Divides the first number by the second and returns the quotient | a = 4, b = 2 result = 2 a = 5, b = 2, result = 2.5 a = 6, b = 0, result = Division by zero is not allowed |
Percentage | Calculates a specified percent of a given number | value is 500 percent is 20 result is 100 |
Note Add, Subtract, Multiply and Divide take a and b as input, while Percentage takes Value and Percent as inputs.
Project Folder Structure:
calculator-mcp-server
├── src
│ ├── server
│ │ └── calculatorServer.js
│ ├── tools
│ │ ├── addition.js
│ │ ├── division.js
│ │ ├── multiplication.js
│ │ ├── percentage.js
│ │ └── subtraction.js
│ └── index.js
├── .gitignore
├── LICENSE
├── README.md
├── package-lock.json
└── package.jsonPrerequisites:
Node.js Version: v24.11.1
npm Version: v11.6.2
Install dependencies:
Clone repository using https://github.com/sdewanshu-lab/calculator-mcp-server.git
npm install
Run Server:
npm run start
Testing:
Launch MCP Inspector via npx @modelcontextprotocol/inspector
This will open MCP Inspector in browser or give an URL. Copy that URL and paste it in browser.
Server Settings:
Setting | Value |
Transport | stdio |
Command | node |
Arguments | src/index.js |
Directory | Project Root Diroctory |
Note After configuring the server, connect it and open Tools. Select the desired tool from the list and perform the calculations. Examples are provided in Tools Available section.
Version
1.0.0
More functionalities are yet to be added and new versions are to be released.
Author
Dewanshu Sharma
This server cannot be deployed
Maintenance
Related MCP Connectors
Developer utilities over MCP: Base64 encode and decode, decode JWTs, format JSON, do percentages.
Free calculators as MCP tools: finance, taxes, health, units, dates. Search, fetch & compute.
SmartMoney77 MCP v0.6.0 — 14 public tools that turn financial questions into exact numbers and citable links. New: historical_investment_return and compare_investments, which compute "what if I had invested" results from real yearly price data. Also compound interest, FIRE number, credit-card payoff, emergency fund, inflation, latte factor, investment fees, cost of waiting, plus discovery/deep-link/share-pack tools for a catalog of calculators in 6 languages (he/en/ar/es/pt/in). Public, no login. Endpoint: https://smartmoney77.com/mcp
61 text, security, converter, calculator, and PDF tools -- callable via MCP on one host.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables basic calculator operations such as add, subtract, multiply, and divide through an MCP interface.2 npmISC
- FlicenseNot gradedqualityCmaintenanceExposes add, subtract, multiply, and divide as MCP tools, implemented with the FastMCP SDK and a raw stdio version.-
- FlicenseNot gradedqualityCmaintenanceEnables AI agents to perform arithmetic operations such as addition, subtraction, multiplication, and division through standardized MCP tools.1-
- FlicenseAqualityCmaintenanceEnables AI agents to perform arithmetic operations — addition, subtraction, multiplication, and division with divide-by-zero validation — through MCP tool calls. It can be run locally over stdio or as an HTTP microservice via streamable-http transport.4-