mcpField
M
Math Mcp Server

Math Mcp Server

本地服务
github.com/111-test-111开发工具572 周前更新

关于 Math Mcp Server

Math Mcp Server 是一个基于 Python 的 MCP 服务,为 LLM 提供数学计算工具和绘图功能。可通过 uvx 启动,也可直接运行 Python 服务文件。

主要功能

  1. 01数学计算工具
  2. 02矩阵计算
  3. 03绘图功能

适用场景

  1. 01通过 LLM 执行数学计算
  2. 02进行矩阵运算
  3. 03为数学任务生成图表

MCP 相关

它为 MCP 客户端注册数学计算和绘图工具。

配置

本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。

mcp.json · 通用配置
{
"mcpServers": {
"math-mcp-server-111-test-111": {
"command": "uvx",
"args": [
"math-mcp"
],
"env": {
"OUTPUT_PATH": "<OUTPUT_PATH>",
"FONT_PATH": "<FONT_PATH>"
}
}
}
}
启动命令uvx math-mcp
需要配置的环境变量
OUTPUT_PATH
FONT_PATH

本地服务需要在你的电脑上安装运行环境(如 Node.js 18+)。各客户端的配置文件位置不同,请参考客户端文档。

安装包
pypimath-mcp

工具

22

收录的工具列表 · 更新于 2 周前

参数类型必填说明
numbersarray是运算用的数字列表。必须至少包含一个数字
operationstring是算术运算类型。支持:'add'、'subtract'、'multiply'、'product'、'divide'、'power'、'modulo'、'gcd'、'lcm'、'sum'、'average'
precisionany否结果的小数位数。范围:0-15
use_decimalboolean否是否使用高精度十进制计算

详细介绍

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

第一次接触 MCP?

从协议是什么,到在客户端里装上第一个服务,这几条回答覆盖了大多数入门问题。

一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。