Adam 计算器 MCP 工具
项目概述
adam-calculator-mcp 是一个功能完整的计算器 MCP 工具,提供多种数学运算功能,版本为 0.1.1。
功能特性
- 基础运算:加法、减法、乘法、除法
- 高级运算:幂运算、平方根
- 统计分析:平均值、最大值、最小值、方差、标准差
- 错误处理:完善的输入验证和异常处理
依赖要求
- Python 版本需
>=3.10 - 依赖的 Python 包:
httpx>=0.28.1mcp[cli]>=1.21.0
安装方法
使用 pip 安装
pip install adam-calculator-mcp
使用 uvx 运行(无需安装)
uvx adam-calculator-mcp
使用方法
作为 MCP 服务器运行
# 直接运行
adam-calculator-mcp
# 使用 uvx 运行
uvx adam-calculator-mcp
在 Claude Desktop 中配置
在 claude_desktop_config.json 中添加:
{
"mcpServers": {
"adam-calculator": {
"command": "adam-calculator-mcp",
"args": []
}
}
}
可用的工具函数
add(a, b)- 加法运算subtract(a, b)- 减法运算multiply(a, b)- 乘法运算divide(a, b)- 除法运算(支持除零检查)power(base, exponent)- 幂运算sqrt(value)- 平方根(支持负数检查)average(values)- 计算平均值stats(values)- 统计分析(返回完整统计信息)
开发和使用示例
Python 代码中使用
from adam_calculator_mcp import add, multiply, stats
# 基础运算
result = add(10, 5)
print(f"10 + 5 = {result}")
# 统计分析
data = [1, 2, 3, 4, 5]
statistics = stats(data)
print(f"统计数据: {statistics}")
MCP 客户端调用
安装后,你的 MCP 客户端可以自动发现并调用这些计算器工具。
配置要求
- 确保 Python 3.10+ 环境
- 网络连接正常(用于下载依赖)
错误处理
所有函数都包含完善的错误处理:
- 除法运算自动检查除零错误
- 平方根运算自动检查负数输入
- 统计函数自动检查空列表
- 提供清晰的错误信息
许可证
MIT License
作者信息
adam adam@example.com
项目地址
- 主页: https://github.com/adam/adam-calculator-mcp
- 问题反馈: https://github.com/adam/adam-calculator-mcp/issues
发布和安装
开发者发布流程
# 构建包
uv build
# 发布到 PyPI (需要配置认证)
uv publish
# 测试发布
uv publish --dry-run
用户安装和使用
# 使用 pip 安装
pip install adam-calculator-mcp
# 使用 uvx 直接运行 (无需安装)
uvx adam-calculator-mcp
Metadata
Release files for adam-calculator-mcp 0.1.4
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 | Actions |
|---|---|---|---|---|
| adam_calculator_mcp-0.1.4.tar.gz | 51.0 kB | Without provenance | Details for adam_calculator_mcp-0.1.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| adam_calculator_mcp-0.1.4-py3-none-any.whl | Python 3 | none | any | Details for adam_calculator_mcp-0.1.4-py3-none-any.whl |
Total release size: 56.5 kB
Release files / adam_calculator_mcp-0.1.4.tar.gz
| Download URL | adam_calculator_mcp-0.1.4.tar.gz |
|---|---|
| Size | 51.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fadb1a630444b4bcb19321d19b6f35865c44b89c4324ba0eaef0ff710f0d3849
|
|
BLAKE2b-256 checksum How to use checksums |
0e0a11ddab0cd99643c7c8d9f6465be06190edaeb18de9e9f3fa314f91d8f2bd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.7
|
Release files / adam_calculator_mcp-0.1.4-py3-none-any.whl
| Download URL | adam_calculator_mcp-0.1.4-py3-none-any.whl |
|---|---|
| Size | 5.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
84ae040cc90484e76bb2a3d49ec40de5b7d83778209bb1256adbad504f6b2af8
|
|
BLAKE2b-256 checksum How to use checksums |
0e14fb377724e6508794a441000caad1e0cda95dfdf451a4dcd84e6d8fe3b61d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.7
|
Security for adam-calculator-mcp 0.1.4
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.