simple-calculator-mcp-server

varunidealabs/simple-calculator-mcp-server

3.2

If you are the rightful owner of simple-calculator-mcp-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.

This document provides a tutorial on building a simple MCP calculator server and connecting it to Claude for Desktop.

The Model Context Protocol (MCP) allows developers to extend AI assistants with custom tools and servers, providing them with additional functionalities. This tutorial guides you through building a simple MCP calculator server that exposes four tools: add, subtract, multiply, and divide. The server is then connected to an MCP host, specifically Claude for Desktop, to demonstrate its capabilities. MCP servers can provide resources, tools, and prompts, but this tutorial focuses on tools. The server is built using Python and requires the Python MCP SDK 1.2.0 or higher. The tutorial includes steps for setting up the environment, implementing tool execution, and running the server. It also provides instructions for configuring Claude for Desktop to use the MCP server.

Features

  • Customizable MCP server for AI assistants
  • Supports basic arithmetic operations: add, subtract, multiply, divide
  • Integration with Claude for Desktop
  • Python-based implementation
  • Utilizes FastMCP for server setup

Tools

  1. add

    Perform addition of two numbers

  2. Subtract

    Perform subtraction operation of two numbers

  3. Multiply

    Perform multiplication of two numbers

  4. divide

    Perform division operation of two numbers (processing zero division error)