Skip to main content
Glama
basic-mcp-calculator-server

basic-mcp-calculator-server

by Yash-synergy

Basic MCP Calculator Server

A simple Model Context Protocol (MCP) server that provides basic calculator functionality.

Features

  • 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 division by zero protection)

Related MCP server: Calculator MCP Server

Installation

  1. Install dependencies:

npm install
  1. Build the project:

npm run build

Usage

Running the Server

npm start

The server runs on stdio and communicates using the MCP protocol.

Available Tools

  • add(a, b) - Returns the sum of a and b

  • subtract(a, b) - Returns a minus b

  • multiply(a, b) - Returns the product of a and b

  • divide(a, b) - Returns a divided by b

Example MCP Configuration

Add this to your MCP client configuration:

{
  "mcpServers": {
    "calculator": {
      "command": "node",
      "args": ["path/to/basic-mcp-calculator-server/dist/index.js"]
    }
  }
}

Development

npm run dev

This will build and start the server in one command.

License

MIT

Available Tools

4 tools
addA

Add two numbers together

Inputs: a (required), b (required).

divideA

Divide first number by second number

Inputs: a (required), b (required).

multiplyB

Multiply two numbers together

Inputs: a (required), b (required).

subtractB

Subtract second number from first number

Inputs: a (required), b (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4/5.0

    Scored across 4 tools

    Disambiguation5/5

    Each tool performs a distinct arithmetic operation with no overlap. An agent can easily select the correct tool for the intended calculation.

    Naming Consistency5/5

    All tool names are single lowercase verbs representing the operation: add, subtract, multiply, divide. The naming pattern is perfectly uniform and intuitive.

    Tool Count5/5

    Four tools is exactly right for a basic calculator, covering the essential operations without any redundancy or unnecessary extras.

    Completeness5/5

    The four basic arithmetic operations provide complete coverage for the stated purpose of a basic calculator. There are no obvious gaps in functionality.

    Maintenance

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      A simple MCP server that provides basic calculator functionality for performing mathematical operations. Built with FastMCP and demonstrates fundamental MCP server implementation patterns.
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      A simple MCP server that provides calculator tools for basic arithmetic operations with zero-division protection.
      ISC
    • A
      license
      Not graded
      quality
      D
      maintenance
      A simple MCP server that provides a calculator tool for basic arithmetic operations.
      6 npm
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      MCP server that offers basic arithmetic operations (addition, subtraction, multiplication, division) via HTTP.
      -