一个基于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.2.tar.gz
(16.7 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.2.tar.gz.
File metadata
- Download URL: mcp_server_jisuanqi-0.1.2.tar.gz
- Upload date:
- Size: 16.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c01d9ea86741cc8eeb6303cf65c1db4fc4386837ec3bcd5c18b00232686c7396
|
|
| MD5 |
15a4e6c84e6d0396cb602afa979a155b
|
|
| BLAKE2b-256 |
2774895ed8071bb56b28cfdfcb9a33666a359097f1ab1aaddf3266105e50d132
|
File details
Details for the file mcp_server_jisuanqi-0.1.2-py3-none-any.whl.
File metadata
- Download URL: mcp_server_jisuanqi-0.1.2-py3-none-any.whl
- Upload date:
- Size: 2.6 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 |
66321a0d5f52ec964551dba3d20cab930bfe35ed82f39bd9d568a12ca0f0c8b4
|
|
| MD5 |
64757f69c34c6fdb5a3e8be233c990e5
|
|
| BLAKE2b-256 |
06007ee69ad22124d1cde32310e54a46aa6b0f4531c9aef07587efbd655327c2
|