Skip to main content
Glama
souravjai

Calculator MCP Server

by souravjai

Calculator MCP Server

A small Model Context Protocol (MCP) server that exposes basic calculator operations over stdio.

Calculator MCP server tutorial

Features

The server provides these tools:

Tool

Description

Arguments

add

Adds two numbers

op1, op2

sub

Subtracts the second number from the first

op1, op2

mul

Multiplies two numbers

op1, op2

div

Divides the first number by the second

op1, op2

All arguments must be numbers. div returns an error when op2 is 0.

Related MCP server: Math MCP Server

Requirements

  • Node.js 18 or later

  • npm

Setup

Install the dependencies from this directory:

npm install

Run the server

Start the MCP server over stdio:

npm start

The server waits for an MCP client to connect, so it does not print normal application output to the terminal.

Test with the example client

The example client starts the server, lists its tools, and calls div with 10 and 0 to demonstrate the division-by-zero error:

npm run test-client

To test a successful operation, update the callTool arguments in mcp-client-test.ts, for example:

arguments: { op1: 10, op2: 2 },

Use MCP Inspector

Run the interactive MCP Inspector with:

npm run mcp-inspect

Open the URL printed by the command, then select a calculator tool and provide values for op1 and op2.

Project files

  • mcp-server.ts - MCP server and calculator tool definitions

  • mcp-client-test.ts - example MCP client

  • mcp-calculator.gif - tutorial walkthrough

  • package.json - scripts and dependencies

A
license - permissive license
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

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

  • A
    license
    A
    quality
    C
    maintenance
    Enables basic arithmetic operations (addition, subtraction, multiplication, division) with 64-bit precision and matrix multiplication capabilities. Provides mathematical computation tools for AI assistants through the Model Context Protocol.
    5
    1
    MIT
  • F
    license
    A
    quality
    D
    maintenance
    Provides basic mathematical operations including addition, subtraction, multiplication, division, and power calculations through a Model Context Protocol interface.
    5
    1
  • F
    license
    Not graded
    quality
    D
    maintenance
    Provides file reading and mathematical calculation tools through the Model Context Protocol. Enables reading file contents and evaluating mathematical expressions via stdio transport.

View all related MCP servers

Related MCP Connectors

  • Precision math engine for AI agents. 203 exact methods. Zero hallucination.

  • A Model Context Protocol server for Wix AI tools

  • AI-callable calculators and engineering models with real formulas. No hallucinated math.

View all MCP Connectors

Latest Blog Posts

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/souravjai/calculator-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server