Labsco
ericvrp logo

Calculator MCP Server

โ˜… 1

from ericvrp

Performs basic arithmetic calculations. A TypeScript-based server demonstrating core MCP concepts.

๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedFreeQuick setup

Calculator MCP Server

A TypeScript-based MCP server that implements a robust calculator with precise decimal arithmetic. This server demonstrates core MCP concepts by providing arithmetic operations with support for multiple operands and configurable precision using Decimal.js.

Features

Tools

Arithmetic Functions

These functions take an array of at least two numbers and return a single numerical result.

  • add - Adds an array of numbers.
  • subtract - Subtracts numbers sequentially from the first.
  • multiply - Multiplies an array of numbers.
  • divide - Divides numbers sequentially. Handles division by zero.

Trigonometric Functions

These functions operate on arrays of numbers and return an array of results. The angles input requires at least one number.

  • Basic Trigonometry: sin, cos, tan
    • Input: angles (array of numbers), mode ('radians' or 'degrees', defaults to 'radians').
  • Inverse Trigonometry: asin, acos, atan
    • Input: values (array of numbers).
  • Hyperbolic Functions: sinh, cosh, tanh
    • Input: values (array of numbers).
  • Inverse Hyperbolic Functions: asinh, acosh, atanh
    • Input: values (array of numbers).

Miscellaneous

  • set_precision - Configures decimal precision for all subsequent calculations.
    • Takes precision parameter as the number of decimal places.

Development

Install dependencies:

bun install

Run the development server:

bun start