daedalus avatar

Mcp Rpn

daedalus/mcp-rpn

Exposes a stateful RPN calculator through MCP with two tools: evaluate and clear. The evaluate tool handles standard arithmetic operators (add, subtract, multiply, divide, power, modulo) plus stack commands like dup, swap, and clear. Stack state persists between calls unless you explicitly clear it. Reach for this when you need Claude to chain multi-step calculations without juggling intermediate results in conversation context. The RPN approach means you can build complex expressions incrementally, useful for financial calculations, unit conversions, or any scenario where you're iteratively computing values. Runs over stdio transport and packages cleanly via pip.

tools
2
transport
STDIO
last updated
Apr 9, 2026

Tools

2 tools

Public tool metadata for what this MCP can expose to an agent.

evaluateEvaluate an RPN (Reverse Polish Notation) expression.

Evaluate an RPN (Reverse Polish Notation) expression.

No parameter schema in public metadata yet.

clearClear the calculator stack.

Clear the calculator stack.

No parameter schema in public metadata yet.

Sponsors

Readme

mcp-rpn

MCP server that exposes an RPN calculator

PyPI Python Ruff

Install

pip install mcp-rpn

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


View the full README on GitHub

Details

Repository
github.com/daedalus/mcp-rpn
Package
mcp-rpn
Transport
STDIO
Registry
MCP registry, active

More from daedalus