mcp-calculator-server

abdulrehmankhalid786/mcp-calculator-server

3.1

If you are the rightful owner of mcp-calculator-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

A simple calculator server built using the MCP framework, providing basic mathematical operations as callable tools.

The MCP Calculator Server is a lightweight and efficient server designed to perform basic and advanced mathematical operations using the Machine Communication Protocol (MCP). It is built to seamlessly integrate with MCP-compatible clients, offering a range of mathematical functions such as addition, subtraction, multiplication, division, and more complex operations like power, square root, and trigonometric functions. The server is implemented in Python and requires the MCP package, making it easy to set up and use. It listens for requests via standard input/output, ensuring smooth communication with clients.

Features

  • Basic arithmetic operations: addition, subtraction, multiplication, division
  • Advanced mathematical functions: power, square root, cube root, factorial
  • Logarithmic operations: natural logarithm, remainder
  • Trigonometric functions: sine, cosine, tangent

Usages

usage with stdio

python
mcp.run(transport='stdio')  # Tools defined via @mcp.tool() decorator

usage with vscode

{
  "mcpServers": {
    "calculator": {
      "command": "python",
      "args": ["server.py"]
    }
  }
}