使用说明
MCP数学服务器
一种模型上下文协议(MCP)服务器,提供一套全面的数学运算和函数。
特性
此MCP服务器提供14个数学工具,分为以下几类:
基本的算术运算
- 总和 -加两个数字
- 减去 -减去两个数字
- 乘 -将两个数字相乘
- 分割 -除以两个数字
- 模 -计算除法的余数
阵列操作
- sum_array -计算数组中所有数字的总和
- 平均 -计算数组中所有数字的平均值
- 分钟 -查找数组中的最小值
- 最大 -查找数组中的最大值
高级操作
- 力量 -将数字提高到幂
- 根 -计算一个数的n次根
三角函数
- 正弦 -计算角度的正弦值(单位:弧度)
- 余弦 -计算角度的余弦(以弧度为单位)
- 正切 -计算角度的切线(以弧度为单位)
安装
Docker(推荐)
拉取并运行最新图像:
docker pull riccardotornesello/mcp-math:latest
docker run -d -p 8080:8080 riccardotornesello/mcp-math:latest
服务器将可在以下位置访问 http://localhost:8080/mcp
来自Binary
从下载最新的二进制文件 发布页面,然后运行:
chmod +x mcp-math
./mcp-math
从源代码构建
git clone https://github.com/riccardotornesello/mcp-math.git
cd mcp-math
go build
./mcp-math
发展
项目结构
mcp-math/
├── main.go # Server entry point and tool registration
├── tools/ # Individual tool implementations
├── Dockerfile # Docker image configuration
├── .github/
│ └── workflows/ # CI/CD pipelines
└── README.md
建造和测试
# Format code
go fmt ./...
# Run linter
go vet ./...
# Build
go build
# Test Docker build
docker build -t mcp-math .
发布过程
发布是通过GitHub Actions自动完成的。当发布新版本时:
- 二进制构建:Go二进制文件已构建并附加到版本中
- Docker镜像:构建多平台映像(amd64、arm64)并将其推送到:
- GitHub容器注册表:
ghcr.io/riccardotornesello/mcp-math - Docker Hub:
riccardotornesello/mcp-math
- GitHub容器注册表:
- 标签:图像标记有版本号(例如。,
v1.0.0,latest)
许可证
此项目根据存储库中指定的条款获得许可。
贡献
欢迎投稿!请随时提交拉取请求。
