FastMCP Calculator
这是一个基于FastMCP的测试项目,提供了基本的数学运算功能。
功能介绍
该项目实现了一个简单的MCP服务器,包含以下工具:
add: 计算两个整数的和subtract: 计算两个整数的差multiply: 计算两个整数的积divide: 计算两个数的商(包含除数为零检查)
安装要求
- Python 3.13或更高版本
- MCP CLI 1.13.0或更高版本
安装步骤
- 从PyPI安装:
pip install fastmcp-calculator - 或者克隆此项目后本地安装:
- 进入项目目录:
cd d:\MCP_test1 - 安装依赖:
uv install(如果使用uv)或pip install -e .
- 进入项目目录:
使用方法
- 启动服务器:
python main.py - 使用MCP客户端调用工具,例如:
mcp call mcp.config.usrlocalmcp.mcp-calculate add --a 10 --b 5
示例
调用add工具
mcp call mcp.config.usrlocalmcp.mcp-calculate add --a 233 --b 1
# 输出: 234
调用subtract工具
mcp call mcp.config.usrlocalmcp.mcp-calculate subtract --a 233 --b 1
# 输出: 232
调用multiply工具
mcp call mcp.config.usrlocalmcp.mcp-calculate multiply --a 10 --b 5
# 输出: 50
调用divide工具
mcp call mcp.config.usrlocalmcp.mcp-calculate divide --a 10 --b 2
# 输出: 5.0
贡献指南
欢迎提交问题和拉取请求来改进这个项目。
许可证
Metadata
Release files for fastmcp-calculator 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| fastmcp_calculator-0.1.1.tar.gz | 3.9 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| fastmcp_calculator-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.5 kB
Release files / fastmcp_calculator-0.1.1.tar.gz
| Download URL | fastmcp_calculator-0.1.1.tar.gz |
|---|---|
| Size | 3.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f36b0255d33e06fad9d9e9f4f69d0f1e4347e4f3e54967fbfeed8ab2e686e2aa
|
|
BLAKE2b-256 checksum How to use checksums |
6b4bfeac8d47679ed6acebfdbfee7d50dfa6a6540a49ae70ad425f83a7c50ed1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.6
|
Release files / fastmcp_calculator-0.1.1-py3-none-any.whl
| Download URL | fastmcp_calculator-0.1.1-py3-none-any.whl |
|---|---|
| Size | 4.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
23d6341c889007cf488c36cd324913fd0c56d7be5cd7d07aef2fd730bf799e24
|
|
BLAKE2b-256 checksum How to use checksums |
12d99ad1e6809962cf9106db8bfb252bdc35945f5b79b9511a782b2fb0f441b3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.6
|
Security for fastmcp-calculator 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.