关于 Math Mcp Server
Math Mcp Server 是一个基于 Python 的 MCP 服务,为 LLM 提供数学计算工具和绘图功能。可通过 uvx 启动,也可直接运行 Python 服务文件。
主要功能
- 01数学计算工具
- 02矩阵计算
- 03绘图功能
适用场景
- 01通过 LLM 执行数学计算
- 02进行矩阵运算
- 03为数学任务生成图表
MCP 相关
它为 MCP 客户端注册数学计算和绘图工具。
配置
本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。
工具
22收录的工具列表 · 更新于 2 周前
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| numbers | array | 是 | 运算用的数字列表。必须至少包含一个数字 |
| operation | string | 是 | 算术运算类型。支持:'add'、'subtract'、'multiply'、'product'、'divide'、'power'、'modulo'、'gcd'、'lcm'、'sum'、'average' |
| precision | any | 否 | 结果的小数位数。范围:0-15 |
| use_decimal | boolean | 否 | 是否使用高精度十进制计算 |
详细介绍
Math MCP 服务
一个基于 Python 的数学计算 MCP 服务,提供一套数学计算工具和绘图实用程序。
运行 MCP 服务
uvx math-mcp # using uvx
# Or run the .py file directly (dependencies must be installed manually)
python math_mcp/math_mcp_server.py
项目结构
math_mcp/
├── __init__.py # Package initialization
├── __main__.py # CLI entry point
├── math_mcp_server.py # Main server file (MCP tool registration)
├── file_utils.py # File path utilities
# Core computation modules
├── basic.py # Basic math computation
├── matrix.py # Matrix computations
├── mstatistics.py # Statistical analysis (avoid conflicts)
├── calculus.py # Calculus
├── optimization.py # Optimization algorithms
├── regression.py # Regression analysis
├── plotting.py # Data visualization
├── geometry.py # Geometric computations
├── number_theory.py # Number theory
├── complex_analysis.py # Complex analysis
├── probability.py # Probability and statistics
# Extended specialized modules
├── signal_processing.py # Signal processing
├── financial.py # Financial mathematics
└── graph_theory.py # Graph theory analysis
在 Claude Desktop 中配置
将以下配置添加到 Claude Desktop 配置文件中:
{
"mcpServers": {
"math-calculator": {
"command": "uvx",
"args": ["math-mcp"],
"env": {
"OUTPUT_PATH": "path/to/output",
"FONT_PATH": "path/to/font"
}
}
}
}
或者直接启动服务:
{
"mcpServers": {
"math-calculator-local": {
"command": "path/to/python_interpreter",
"args": [
"path/to/math_mcp_server.py"
],
"env": {
"OUTPUT_PATH": "path/to/output",
"FONT_PATH": "path/to/font"
}
}
}
}
评论
支持 Markdown
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。