logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

mcp-arithmetic-utility

A simple Model Context Protocol service offering fundamental numerical computations like summing, differencing, product calculation, and quotient derivation for LLM augmentation.

Author

mcp-arithmetic-utility logo

simonberner

MIT License

Quick Info

GitHub GitHub Stars 0
NPM Weekly Downloads 0
Tools 1
Last Updated 2026-02-19

Tags

calculatorapishttpserver calculatorcalculator providessimonberner mcp

Building an MCP Endpoint: Arithmetic Service Example

smithery badge License: MIT

Overview

This repository presents a minimal demonstration of creating an MCP server capable of executing basic arithmetic procedures for an MCP client application.

What is MCP?

Model Context Protocol (MCP) defines a standardized mechanism enabling Large Language Models (LLMs) to invoke external, custom capabilities and services. An MCP client leverages this protocol to query registered MCP servers for specific functions. This artifact specifically implements a server providing elementary mathematical functions.

"MCP furnishes a unified, consistent interface for artificial intelligence systems to interface with external computational environments. Code written once becomes universally accessible across diverse AI frameworks." 1

"Servers form the essential infrastructure layer that enhances the contextual knowledge and external data access capabilities of LLMs." 2

Technical Foundation

  • Python 3 Environment
  • Pytest for verification
  • MCP Software Development Kit (SDK)
  • MCP Command Line Interface (CLI)
  • Nix (Optional for environment management)

Deployment and Utilization Guide

Integration via Smithery

To seamlessly integrate mcp-arithmetic-utility with supported clients (e.g., Claude Desktop) using Smithery:

bash npx -y @smithery/cli install @simonberner/mcp-server-calculator --client claude

Local Development Setup

Due to the inclusion of Nix, this project ensures an isolated and repeatable development environment, negating the necessity for manual setup of Python or transitive dependencies. System prerequisites include installing Nix.

  • Install the direnv utility (for environment loading).
  • Install Lix (if using the Nix dependency management approach).
  • Obtain the repository source code via cloning.
  • Navigate into the project directory.
  • Execute direnv allow to activate the environment.
  • Run tests with pytest.

Alternate Installation Path

Should the Smithery or Nix methodologies be unsuitable, standard package management tools like uv can be utilized for building and installing the package:

bash

Fetch and execute the uv installer (consult https://astral.sh/uv/getting-started/installation/ for latest)

curl -LsSf https://astral.sh/uv/install.sh | sh

Establish a virtual environment named .venv

uv venv

Activate the environment (example for bash/zsh shells)

source .venv/bin/activate

Proceed with installation or packaging

uv pip install -e .

OR create distribution wheels

uv pip wheel . -w dist

Server Execution and Verification

Testing your custom MCP service locally is simplified using the MCP Inspector, a graphical interface available at http://localhost:5173, which bypasses immediate LLM integration:

bash mcp dev src/mcp_server_calculator/calculator.py

Host Integration Configuration

To enable an MCP Host environment (like a local proxy) to communicate with this calculator service, update its configuration file with the following block:

{ "mcpServers": { "calculator": { "command": "python", "args": [ "/mcp-server-calculator/src/mcp_server_calculator/calculator.py" ] } } }

Operational Notes

  • When leveraging Windsurf IDE as the MCP Host, access to Cascade functionality (for MCP Client operations with servers) necessitates a Pro Plan.

Identified Challenges

Consult the Issues tracker for a roster of existing problems or to report novel incidents.

Supporting Documentation

Acknowledgment

  • The environment configuration scaffolding for Nix was adapted from the ical2json project.

Supplemental Knowledge

Nix Ecosystem

Cloudflare Integration

return

See Also

`