About mcp-rpn
mcp-rpn is an MCP server that provides an RPN calculator for clients that need to evaluate calculator expressions. Its tools support arithmetic, stack commands, and optional stack display.
Key features
- 01Evaluate RPN expressions
- 02Perform arithmetic and modulo operations
- 03Use stack commands such as dup and swap
- 04Clear the calculator stack
- 05Optionally display the stack
Use cases
- 01Evaluate expressions written in RPN
- 02Perform chained arithmetic calculations
- 03Inspect or modify calculator stack state
MCP support
Exposes an RPN evaluation tool and a separate stack-clearing tool to MCP clients over stdio.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
Tools
2Saved tool list · updated 2w ago
| Parameter | Type | Required | Description |
|---|---|---|---|
| expression | string | Yes | Space-separated RPN expression (e.g., "3 4 +"). |
| show_stack | boolean | No | Whether to return full stack after evaluation (default: False). |
Details
From the project READMEmcp-rpn
MCP server that exposes an RPN calculator
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 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/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
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.