MCP ExplorerExplorer

Simple Python Mcp Calculator

@ItsMistahJion 21 days ago
1 MIT
FreeCommunity
AI Systems
This is a simple python MCP calculator. Simple to create, implement and run a MCP server. This also help with creation of MCP server locally.

Overview

What is Simple Python Mcp Calculator

Simple_Python_MCP_calculator is a straightforward Python-based Model Context Protocol (MCP) calculator designed to facilitate the creation, implementation, and operation of an MCP server locally.

Use cases

Use cases include developing and testing calculator applications, integrating MCP tools into larger software systems, and educational purposes for learning about MCP server functionalities.

How to use

To use Simple_Python_MCP_calculator, clone the repository, set up a virtual environment, install the required dependencies, and run the MCP server using the MCP CLI. You can then test the calculator functions interactively using the MCP Inspector.

Key features

Key features include the implementation of a basic MCP server in Python, exposure of calculator operations as MCP tools, a sample resource endpoint, and easy local testing with MCP Inspector.

Where to use

Simple_Python_MCP_calculator can be utilized in software development, particularly in projects that require a local MCP server for testing and development of calculator functionalities.

Content

Simple_Python_MCP_calculator

This is a simple python MCP calculator. Simple to create, implement and run a MCP server. This also help with creation of MCP server locally.

# MCP Server Example

A simple example of building and testing a Model Context Protocol (MCP) server locally using Python and MCP Inspector. This project demonstrates how to expose calculator functions as MCP tools and test them interactively.

---

## 🚀 Features

- Implements a basic MCP server in Python
- Exposes calculator operations as MCP tools
- Includes a sample resource endpoint
- Easily testable locally with MCP Inspector

---

## 🛠️ Prerequisites

- Python 3.8 or higher
- [MCP Python SDK]
- [MCP CLI]
- (Recommended) Virtual Environment

---

## 📦 Installation

1. Clone the repository

git clone https://github.com/ItsMistahJi/Simple_Python_MCP_calculator.git


cd Simple_Python_MCP_calculator



2. Create and activate a virtual environment


python3 -m venv venv
source venv/bin/activate



3. Install dependencies


pip install mcp
pip install mcp[cli]



## ▶️ Running & Testing the Server

1. Start the MCP server using the MCP CLI:

mcp dev calculator.py



2. Open the MCP Inspector link provided in your terminal.

3. Test your tools and resources interactively in the Inspector UI.

---

## To add it in your MCP client. Use the below JSON in the MCP client settings.

            "Calculator": {
                "type": "stdio",
                "command": "/path/to/your/venv/bin/python",
                "args": [
                    "/path/to/your/calculator.py"
                ]
            }


*Happy building with MCP!*

Tools

No tools

Comments