MCP Hub
Back to servers

rpn-mcp

An MCP server that provides tools for evaluating Reverse Polish Notation (RPN) expressions and managing a calculator stack. It supports standard arithmetic operators along with stack operations like duplicate, swap, and clear.

glama
Updated
Mar 27, 2026

rpn-mcp

MCP server that exposes an RPN calculator

PyPI Python Ruff

Install

pip install rpn-mcp

Usage

rpn-mcp

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/dclavijo/rpn-mcp.git
cd rpn-mcp
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.dclavijo/rpn-mcp

Reviews

No reviews yet

Sign in to write a review