Skip to main content

PyPI version Python License


✅ README.md for mcp-math-server

# 📐 MCP Math Server

An [MCP (Model Context Protocol)](https://modelcontextprotocol.io) server that provides basic arithmetic operations — addition, subtraction, multiplication, and division — to integrate easily with LLMs like Claude.

> Built using the official `mcp` Python SDK and `FastMCP`.

---

## 🚀 Features

- ✨ Claude/LLM-ready math tools
- 🔢 Four core operations: add, subtract, multiply, divide
- 🧠 Designed for seamless MCP integration
- 🐍 Easy CLI usage via `mcp-math` command

---

## 📦 Installation

You need Python 3.10 or later.

### Option 1: From PyPI (once published)

```bash
pip install mcp-math-server

Then run:

mcp-math

Option 2: From source (for development)

git clone https://github.com/yourusername/mcp-math-server.git
cd mcp-math-server

# Recommended: use virtualenv or uv
python3 -m venv venv
source venv/bin/activate

pip install -e .
mcp-math

🧪 Usage

After running mcp-math, your server will expose these tools:

🔧 Tools

Tool Description
add Adds two numbers
subtract Subtracts one number from another
multiply Multiplies two numbers
divide Divides one number by another

🤖 Using with Claude Desktop

  1. Download Claude Desktop if you haven’t.
  2. Make sure your MCP server is running via:
mcp-math
  1. In another terminal, register it with Claude:
mcp install $(which mcp-math) --name "Math Assistant"
  1. Claude will now show “Math Assistant” as an available context/tool.

🧠 Example prompt in Claude:

“Use the multiply tool from Math Assistant to calculate 12 × 6.”


🧰 Example MCP Inspector Test

You can also test it manually:

mcp dev mcp_math/server.py

Try calling:

{
  "tool": "divide",
  "arguments": { "x": 100, "y": 5 }
}

📁 Project Structure

mcp-math-server/
├── mcp_math/
│   ├── __init__.py
│   └── server.py  # All MCP logic
├── pyproject.toml  # Package config
├── README.md       # You're reading this

🛠️ Development

Feel free to fork or clone this repo and add more math tools, logging, or context history!

To build & publish to PyPI:

pip install build twine
python -m build
twine upload dist/*

📃 License

MIT © 2025 Ajinkya
See LICENSE for details.


🙌 Contributions Welcome

If you have an idea or improvement, feel free to open an issue or pull request. Let's make LLMs better at math — together!


---

## ✅ Next Steps for You

- ✅ Save this `README.md` to your root folder
- ✅ Replace placeholder fields:
  - `https://github.com/yourusername/...`
  - Your name + email
- ✅ Add a `LICENSE` file (MIT recommended — I can generate one)

---

Would you like me to:
- Create a matching `LICENSE` file?
- Help write a `setup.cfg` or GitHub Actions CI?
- Add more advanced math (e.g. percentages, square roots)?

Let’s keep leveling it up 🚀

Metadata

Release files for mcp-math-server 0.1.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mcp-math-server 0.1.9
File Size Uploaded
mcp_math_server-0.1.9.tar.gz 3.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mcp-math-server 0.1.9
File Interpreter ABI Platform
mcp_math_server-0.1.9-py3-none-any.whl Python 3 none any Details

Total release size: 8.4 kB

Release files / mcp_math_server-0.1.9.tar.gz

Download URL mcp_math_server-0.1.9.tar.gz
Size 3.9 kB
Tags Source
SHA-256 checksum
How to use checksums
6d71243becbba98ff43e47c527f7408fae74d46b07add4c8b03c8f745f712eaa
BLAKE2b-256 checksum
How to use checksums
951440506dadf06a4f661ece949a395118b932293423f2e10baa0a3ae83ce96e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.1

Release files / mcp_math_server-0.1.9-py3-none-any.whl

Download URL mcp_math_server-0.1.9-py3-none-any.whl
Size 4.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5a62f4eedff191a1325c2ed60e79518a00600fff9117bcef82e5c6fdc17722a9
BLAKE2b-256 checksum
How to use checksums
5fe32f05464e9516b55208fd2c29d5774e1676af78cd46766836aca84aaf0f57
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.1

Release history Release notifications | RSS feed

This release

0.1.9 This release

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page