Metadata-Version: 2.4
Name: calculator-mcp-rubens
Version: 0.0.31
Summary: A calculator MCP server using the FastMCP framework.
License-Expression: MIT
License-File: LICENSE
Keywords: ai,calculator,math,llm,mcp,utility
Author: Rubens Gomes
Author-email: rubens.s.gomes@gmail.com
Maintainer: Rubens Gomes
Maintainer-email: rubens.s.gomes@gmail.com
Requires-Python: >=3.14,<4.0.0
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Python :: 3.14
Requires-Dist: calculator-lib-rubens (>=0.2.0,<1.0.0)
Requires-Dist: colorlog (>=6.12.0,<7.0.0)
Requires-Dist: cryptography (==50.0.2)
Requires-Dist: fastmcp (>=4.0.10,<5.0.0)
Requires-Dist: key-value (>=0.1.2,<1.0.0)
Requires-Dist: py-key-value-aio (>=0.4.6,<1.0.0)
Requires-Dist: pydantic (>=2.13.5,<3.0.0)
Requires-Dist: pyyaml (>=6.0.3,<7.0.0)
Project-URL: Documentation, https://github.com/rubensgomes-org/calculator-mcp/blob/main/README.md
Project-URL: Homepage, https://github.com/rubensgomes-org/calculator-mcp
Project-URL: Repository, https://github.com/rubensgomes-org/calculator-mcp
Description-Content-Type: text/markdown

# Calculator MCP Server

[![Python](https://img.shields.io/badge/Python-3.14%2B-0969da?logo=python)](https://www.python.org/downloads/release/python-3147/)
[![FastMCP](https://img.shields.io/badge/FastMCP-4-8250df)](https://gofastmcp.com/getting-started/welcome)
[![Poetry](https://img.shields.io/badge/Poetry-2.5%2B-0969da?logo=poetry)](https://python-poetry.org/)
[![GitHub](https://img.shields.io/badge/GitHub-Actions-0969da?logo=github+actions)](https://github.com/features/actions)
[![Microsoft](https://img.shields.io/badge/Microsoft-Azure-0969da)](https://azure.microsoft.com/en-us)
[![AI Assisted](https://img.shields.io/badge/AI%20Assisted-Development-d29922)](https://github.com/rubensgomes-org/calculator-mcp/blob/main/AI_DISCLAIMER.md)

`calculator-mcp` is an MCP (Model Context Protocol) server that exposes 16
arithmetic operations as callable tools for use by LLMs within agentic
applications. It contains no mathematical logic of its own. Instead, each tool
is a thin synchronous wrapper that logs its arguments and delegates execution to
the open-source `calculator-lib-rubens` package published on PyPI.

---

## Features

16 calculator functions exposed through an MCP server for consumption by AI 
agentic programs:

- **Two-operand operations**: `add`, `subtract`, `multiply`, `divide`, `power`,
  `nth_root`, `modulo`, `floor_divide`
- **Single-operand operations**: `sqrt`, `absolute`, `floor`, `ceil`, `log10`,
  `ln`, `exp`
- **Rounding**: `round_number` (with configurable decimal places)

The following are the supported MCP JSON-RPC 2.0 methods:

- **Lifecycle Methods:** `initialize`, `notifications/initialized`
- **Tools Methods:** `tools/list`, `tools/call`

The following MCP protocols are supported:

- **Legacy MCP (Version: 2025-06-18)** when stateless is true in `config.yaml`
- **Modern MCP (Version: 2026-07-28)** when stateless is false in `config.yaml`

## Non-Supported Features

- **Server-sent events (SSE)** are not supported for the MCP communication.
- **Streaming communication channels**, such as HTTP Streamable, are not
  supported. In other words, the MCP server is expected to generate the
  entire output before sending it.

Non-supported JSON-RPC methods:

- **Resources Methods:** `resources/list`, `resources/read`
- **Prompts Methods:** `prompts/list`, `prompts/get`
- **Logging & Progress Utilities**
- **Server-to-Client** calls are not supported

## AI Disclaimer

This project includes code and documentation created with the assistance of AI
tools. For details on usage, limits, and review practices, please see the
[AI Disclaimer](https://github.com/rubensgomes-org/calculator-mcp/blob/main/AI_DISCLAIMER.md).

## Prerequisites

- python 3.14+
- pip

## Installation

1. Install in `pip` default installation folder

```bash
pip install calculator-mcp-rubens
```

2. Install in the Python user install directory

```bash
pip --no-cache-dir install -U --user calculator-mcp-rubens
```

3. Confirm the installed version matches the latest GitHub release at
   [calculator-mcp/releases](https://github.com/rubensgomes-org/calculator-mcp/releases)

```bash
calculator-mcp --version
pip show calculator-mcp-rubens
```

## Uninstall

- Uninstall as follows

```bash
pip uninstall calculator-mcp-rubens
pip cache purge
```

## Configuration

- Copy the file
  [config.yaml](https://github.com/rubensgomes-org/calculator-mcp/blob/main/config/config.yaml)
  to `${HOME}/cfg/calculator-mcp/config.yaml`.

```bash
export CALCULATOR_MCP_CONFIG="${HOME}/cfg/calculator-mcp/config.yaml"
```

## Usage

1. Simply run

```bash
calculator-mcp
```

2. Health check

```bash
curl -v http://localhost:8080/health
# Expect: OK
```

3. To stop, go to the running terminal and press `Ctrl+C`

## License

The project is licensed under
[MIT License](https://github.com/rubensgomes-org/calculator-mcp/blob/main/LICENSE).

## Links

- [GitHub Project](https://github.com/rubensgomes-org/calculator-mcp)
- [Azure CLI Commands](https://github.com/rubensgomes-org/calculator-mcp/blob/main/docs/AZ_CMD.md)
- [Azure Container App Provisioning](https://github.com/rubensgomes-org/calculator-mcp/blob/main/docs/AZURE_ACA.md)
- [Development Setup](https://github.com/rubensgomes-org/calculator-mcp/blob/main/docs/DEVELOPMENT_SETUP.md)
- [Docker](https://github.com/rubensgomes-org/calculator-mcp/blob/main/docs/DOCKER.md)
- [Integration Test](https://github.com/rubensgomes-org/calculator-mcp/blob/main/docs/INTEGRATION_TEST.md)
- [MCP](https://github.com/rubensgomes-org/calculator-mcp/blob/main/docs/MCP.md)
- [Miscellaneous](https://github.com/rubensgomes-org/calculator-mcp/blob/main/docs/MISC.md)
- [OAuth Diagram](https://github.com/rubensgomes-org/calculator-mcp/blob/main/docs/OAUTH_DIAGRAM.md)
- [PyCharm](https://github.com/rubensgomes-org/calculator-mcp/blob/main/docs/PYCHARM.md)
- [Release Process](https://github.com/rubensgomes-org/calculator-mcp/blob/main/docs/RELEASE.md)

---
Author: [Rubens Gomes](https://rubensgomes.com/)

