Skip to main content
Glama
@halfords-pro/calculator

@halfords-pro/calculator

by halfords-pro

@halfords-pro/calculator

An MCP (Model Context Protocol) server providing calculator tools with precise decimal arithmetic, suitable for accounting and tax calculations.

Features

  • Precise decimal arithmetic — uses decimal.js to avoid floating-point errors

  • Excel-style rounding — round half away from zero (ROUND_HALF_UP), the standard for accounting and tax

  • MCP protocol — integrates with any MCP-compatible client (Claude Desktop, Claude Code, etc.)

Related MCP server: mcp-abacus

Installation

npm install -g @halfords-pro/calculator

Usage

Claude Desktop

Add to your Claude Desktop configuration (claude_desktop_config.json):

{
  "mcpServers": {
    "calculator": {
      "command": "npx",
      "args": ["-y", "@halfords-pro/calculator"]
    }
  }
}

Claude Code

claude mcp add calculator -- npx -y @halfords-pro/calculator

Tools

sum

Sum an array of signed decimal numbers and round the result to a specified number of decimal places.

Parameters:

Name

Type

Required

Description

values

number[]

Yes

Array of signed decimal numbers to sum

decimalPlaces

number

Yes

Number of decimal places to round the result to

Examples:

sum({ values: [1.00, -2.50, 3.89], decimalPlaces: 2 })
→ "2.39"

sum({ values: [1.00, -2.50, 3.89283829, -539.38390293], decimalPlaces: 4 })
→ "-536.9911"

sum({ values: [0.1, 0.2], decimalPlaces: 2 })
→ "0.30"  (not 0.30000000000000004)

Rounding behaviour:

Uses "round half away from zero" (equivalent to Excel ROUND()):

Value

Rounded to 2dp

2.125

2.13

-2.125

-2.13

2.124

2.12

Development

# Install dependencies
npm install

# Build
npm run build

# Run tests
npm test

# Run tests with coverage
npm run test:coverage

# Launch MCP Inspector
npm run inspector

License

ISC

Available Tools

1 tool
sumA

Sum an array of signed decimal numbers and round the result to a specified number of decimal places. Uses precise decimal arithmetic suitable for accounting and tax calculations. Rounding uses the 'round half away from zero' strategy (equivalent to Excel ROUND).

Inputs: values (required), decimalPlaces (required).

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A4.1/5.0

    Scored across 1 tool

    Disambiguation5/5

    With only one tool, there is zero ambiguity—the 'sum' tool has a clear, singular purpose that cannot be confused with anything else.

    Naming Consistency5/5

    The single tool name 'sum' is simple, descriptive, and perfectly aligned with its operation, presenting no inconsistency issues.

    Tool Count2/5

    A calculator server exposing only one tool is too sparse for its apparent domain; even a minimal arithmetic toolkit would include multiple basic operations.

    Completeness1/5

    The server covers only addition, missing essential operations like subtraction, multiplication, division, or more advanced calculator functions, making the surface severely incomplete.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      B
      maintenance
      Pure-Python MCP server for type-faithful calculation — evaluate expressions under fixed-point, IEEE-754 double, or exact rational arithmetic, with every answer labelled with its precision (exact vs inexact).
      6
      1
      GPL 3.0
    • A
      license
      A
      quality
      D
      maintenance
      An MCP server and CLI providing business, financial, and tax calculations including math expressions, income tax estimates, loan amortization, depreciation, and more.
      10
      2
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      MCP server for deterministic numeric verification and spreadsheet auditing. Enables AI agents to verify math/finance claims, audit rows, and evaluate covenant rules with signed, independently checkable receipts.
      4
      15 PyPI
      MIT