๐งฎ MCP Calculator Server
A simple MCP server that exposes calculator operations as tools and connects them to Cursor.
๐ Project Overview
This project demonstrates how to build a simple Model Context Protocol (MCP) server using Python.
The MCP server exposes calculator operations as tools that can be called by an MCP-compatible client such as Cursor.
Instead of manually writing Python code for every calculation, Cursor can understand the user's request and call the appropriate MCP tool.
๐ฅ Available Calculator Tools
| ๐ง Tool | ๐ Description | ๐ก Example |
|---|---|---|
โ add |
Adds two numbers | add(10, 20) โ 30 |
โ subtract |
Subtracts two numbers | subtract(20, 10) โ 10 |
โ๏ธ multiply |
Multiplies two numbers | multiply(10, 5) โ 50 |
โ divide |
Divides two numbers | divide(100, 4) โ 25 |
๐ข power |
Calculates power | power(2, 10) โ 1024 |
๐๏ธ Architecture
๐ค USER
โ
โ
โผ
๐ค CURSOR AGENT
โ
โ MCP Protocol
โผ
๐ MCP CLIENT
โ
โ stdio
โผ
๐งฎ CALCULATOR MCP SERVER
โ
โโโโโโโโโโโโโโผโโโโโโโโโโโโโ
โ โ โ
โผ โผ โผ
โ add โ subtract โ๏ธ multiply
โ โ โ
โโโโโโโโโโโโโโผโโโโโโโโโโโโโ
โ
โโโโโโโดโโโโโโ
โผ โผ
โ divide ๐ข power