Skip to main content
Glama

mcp-rpn

MCP server that exposes an RPN calculator

PyPI Python Ruff

Install

pip install mcp-rpn

Related MCP server: Calculator MCP Server

Usage

mcp-rpn

The server uses stdio transport for MCP protocol communication.

MCP Tools

evaluate

Evaluate an RPN (Reverse Polish Notation) expression.

{
  "name": "evaluate",
  "arguments": {
    "expression": "3 4 +",
    "show_stack": true
  }
}

Operators:

  • + - Add

  • - - Subtract

  • - - Multiply

  • / - Divide

  • ** - Power

  • % - Modulo

Commands:

  • clear - Clear the stack

  • dup - Duplicate top of stack

  • swap - Swap top two elements

Examples:

  • 3 4 + returns 7

  • 10 5 2 + * 2 - returns 32

  • 3 2 / returns 1.5

clear

Clear the calculator stack.

{
  "name": "clear",
  "arguments": {}
}

Development

git clone https://github.com/daedalus/mcp-rpn.git
cd mcp-rpn
pip install -e ".[test]"

# run tests
pytest

# format
ruff format src/ tests/

# lint
ruff check src/ tests/

# type check
mypy src/

MCP Registry

mcp-name: io.github.daedalus/mcp-rpn

Available Tools

2 tools
clearA

Clear the RPN calculator stack.

Removes all values from the current session stack.

Returns: Confirmation message that stack was cleared.

Example: >>> clear() 'Stack cleared'

Inputs: no named parameters. Returns: result

evaluateA

Evaluate an RPN (Reverse Polish Notation) expression.

Operators: +, -, *, /, **, % (add, subtract, multiply, divide, power, modulo). Commands: clear (clear stack), dup (duplicate top), swap (swap top two). Example: '3 4 +' returns 7

Inputs: expression (required), show_stack. Returns: result

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 2 tools

    Disambiguation4/5

    The evaluate and clear tools have clearly distinct primary purposes: evaluate processes RPN expressions, while clear resets the stack. However, evaluate also supports a 'clear' command, creating a minor overlap where users might use a command inside an expression instead of the dedicated tool, but descriptions make the distinction clear enough.

    Naming Consistency5/5

    Both tool names are simple, lowercase, single-word verbs (evaluate and clear), following a consistent pattern. There is no mixing of conventions, and each name accurately reflects its action.

    Tool Count3/5

    With only 2 tools, the server feels slightly thin, though the scope is a narrow RPN calculator. The clear tool is somewhat redundant because the evaluate tool already supports a 'clear' command, making the count less justified than if it were a single evaluate tool.

    Completeness4/5

    The evaluate tool covers core arithmetic operators and stack manipulation commands (dup, swap), providing a functional surface for an RPN calculator. A minor gap is the lack of a dedicated stack inspection command or tool, but the primary lifecycle of evaluation and clearing is covered.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    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