一个基于MCP的简单计算器服务
Project description
MCP计算器服务
这是一个基于MCP(Model Control Protocol)的简单计算器服务,提供基本的数学运算功能。
功能特性
- 加法运算
- 减法运算
- 乘法运算
- 除法运算(包含除零检查)
安装
pip install mcp-server-jisuanqi
使用方法
- 启动服务:
# 激活虚拟环境(如果使用)
source .venv/bin/activate
# 运行服务
python -m mcp_server_jisuanqi
- 使用MCP客户端调用:
from mcp.client import Client
client = Client()
# 加法运算
result = client.jisuanqi.mcp_jisuanqi_add(a=5, b=3) # 返回 8
# 减法运算
result = client.jisuanqi.mcp_jisuanqi_subtract(a=10, b=4) # 返回 6
# 乘法运算
result = client.jisuanqi.mcp_jisuanqi_multiply(a=6, b=7) # 返回 42
# 除法运算
result = client.jisuanqi.mcp_jisuanqi_divide(a=15, b=3) # 返回 5
开发环境设置
- 克隆仓库:
git clone https://github.com/yourusername/mcp-server-jisuanqi.git
cd mcp-server-jisuanqi
- 创建并激活虚拟环境:
python -m venv .venv
source .venv/bin/activate # Linux/Mac
# 或
.venv\Scripts\activate # Windows
- 安装依赖:
pip install -e ".[dev]"
许可证
MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
mcp_server_jisuanqi-0.1.1.tar.gz
(16.8 kB
view details)
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 mcp_server_jisuanqi-0.1.1.tar.gz.
File metadata
- Download URL: mcp_server_jisuanqi-0.1.1.tar.gz
- Upload date:
- Size: 16.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0caa74b6805cd281095662f967bf117a3b2f0e6793a2a79c703e9844e9d4317a
|
|
| MD5 |
804900bc42a778b0433085db293fbaae
|
|
| BLAKE2b-256 |
8cc82c830b0f14ac0e2bfb7d35ba26bdd3e641951088b58ed2f923fe2b6880af
|
File details
Details for the file mcp_server_jisuanqi-0.1.1-py3-none-any.whl.
File metadata
- Download URL: mcp_server_jisuanqi-0.1.1-py3-none-any.whl
- Upload date:
- Size: 2.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a4d14a848a578d43c11344e78387cd424d1bf478f9545b651d98388ccd2c0f92
|
|
| MD5 |
5e7fb3f927b3d96469d30f7608bd9e93
|
|
| BLAKE2b-256 |
838bf8c1a2a454425d598be495f79236f705bbf0e707de2b0450ec545fe0932b
|