这是一个可以进行64位精度基本算术运算以及矩阵乘法的MCP(模型上下文协议)服务器。
<a href="https://glama.ai/mcp/servers/@avanishd-3/math-mcp"> <img width="380" height="200" src="https://gips1.baidu.com/it/u=2357375568,521790922&fm=3081&app=3081&f=PNG?w=760&h=400" alt="数学服务器MCP服务器" /> </a>加法
减法
乘法
除法
矩阵乘法
确保已安装以下内容:
查看安装指南以获取所有选项。
curl -LsSf https://astral.sh/uv/install.sh | sh
或
brew install uv
winget install --id=astral-sh.uv -e
git clone https://github.com/avanishd-3/math-mcp.git
cd math-mcp-server
uv sync
fastmcp install claude-code src/math_server.py:math_mcp
fastmcp install claude-desktop src/math_server.py:math_mcp
fastmcp install cursor src/math_server.py:math_mcp
添加以下.vscode/mcp.json并使用实际路径。
{
"servers": {
"Math MCP Server": {
"command": "uv",
"args": [
"run",
"--with",
"fastmcp",
"--with",
"numpy",
"fastmcp",
"run",
"/绝对路径/Desktop/to/math-mcp-server/src/math_server.py:math_mcp"
]
}
},
}
分叉仓库
创建新分支:
git checkout -b add-feature
test/目录中添加单元测试)git commit -m "添加了一个新功能"
git push origin add-feature
/
├── src
│ └── math_server.py
├── tests
│ ├── test_arithmetic.py
│ │ └── astro.svg
│ ├── test_linear_algebra.py
├── pytest.ini
├── pyproject.toml
└── uv.lock
此MCP服务器使用Fast MCP 2.0,它比官方Python SDK使用的Fast MCP 1.0提供了更多功能。
此外,单元测试是用Pytest编写的,这是Fast MCP 2.0推荐的工具。
最后,如果您不知道的话,uv是一个比pip快得多的版本,并且还提供了一个用于项目依赖项的锁文件(如果您之前使用过npm或cargo,这应该很熟悉)。MCP Python SDK本身使用uv,我将其用于所有新的Python项目,因为它比pip快10-100倍,而锁文件使依赖项版本管理更加简单。