Calculator MCP Server
by QA-Shivam
Calculator MCP Server
A simple Model Context Protocol server that exposes calculator tools for addition, subtraction, multiplication, and division.
Features
Add two numbers
Subtract two numbers
Multiply two numbersP
Divide two numbers with zero-division protection
Requirements
Node.js 18 or newer
npm
Install
npm installRun locally
node npx-server.jsUse with npx
This package exposes a CLI entry point through the bin field in package.json.
npx calculator-mcp-serverInspect with the MCP Inspector
npx @modelcontextprotocol/inspector npx calculator-mcp-serverClaude Desktop or VS Code configuration
{
"servers": {
"Calculator": {
"command": "npx",
"args": ["-y", "sk-calculator-mcp-server"],
"env": {}
}
}
}Publish to npm
npm login
npm config set //registry.npmjs.org/:_authToken=YOUR_TOKEN
npm publish --access publicBefore publishing, make sure the package name is available on npm.
Project files
npx-server.js: MCP server implementationpackage.json: package metadata and CLI entry pointI have built this just for learning !