MCP server that gives you calculator tools
Project description
Calculator MCP - Learning Project
This project, calculator-mcp, was built for learning purposes. It provides an MCP (Multi-Agent Communication Protocol) server that exposes basic calculator tools. These tools can be integrated with other systems, such as LangGraph agents.
The server gives you access to the following calculator tools:
add(a: float, b: float) -> floatsubtract(a: float, b: float) -> floatmultiply(a: float, b: float) -> floatdivide(a: float, b: float) -> float
Installation
You can install the calculator-mcp package directly using pip:
pip install calculator-mcp
Usage with LangGraph
You can use calculator-mcp as a tool within a LangGraph agent.
-
Create a Python script to run the MCP server (e.g.,
cal_mcp.py):# cal_mcp.py from calculator_mcp import serve if __name__ == "__main__": serve()
-
Configure the tool in your LangGraph agent:
# Example LangGraph tool configuration tools_config = { "calculator": { "command": "python", # Replace with the absolute path to your cal_mcp.py file "args": ["/path/to/your/cal_mcp.py"], "transport": "stdio", } }
Author: Azam Afridi (azamafridi.ai@gmail.com) Version: 0.1.4 Python: >=3.10
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file calculator_mcp-0.1.4.tar.gz.
File metadata
- Download URL: calculator_mcp-0.1.4.tar.gz
- Upload date:
- Size: 2.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.2 CPython/3.10.12 Linux/6.8.0-58-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
52f62e2b39ebf9bc2097d965994f7dd00365fd1f20e889aaff03ed31dcaa4705
|
|
| MD5 |
ff8a61a5b442492971d772fbc8a1c7a3
|
|
| BLAKE2b-256 |
a25d1583124d299d904a4d2d413a393711518374df827a326bb28b6fc93b745a
|
File details
Details for the file calculator_mcp-0.1.4-py3-none-any.whl.
File metadata
- Download URL: calculator_mcp-0.1.4-py3-none-any.whl
- Upload date:
- Size: 3.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.2 CPython/3.10.12 Linux/6.8.0-58-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cf13f0b1af2ab15e3fd500ec9a2ee895b996b673e482c0c9b1066df71573f22d
|
|
| MD5 |
c21b4b49c674ce765bdb976a879e234d
|
|
| BLAKE2b-256 |
c0297962cff18f33307621040a547ef63fa1583cf36f92bb5110b7c6ab735276
|