Skip to content

daedalus/mcp-rpn

Repository files navigation

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

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

About

A MCP server with that exposes a RPN calculator

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages