rpn-mcp
MCP server that exposes an RPN calculator
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 stackdup- Duplicate top of stackswap- Swap top two elements
Examples:
3 4 +returns710 5 2 + * 2 -returns323 2 /returns1.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