数学MCP服务

@EthanHenrickson/math-mcp
1 Stars 726 次浏览 EthanHenrickson 更新于 2026-08-23

一个模型上下文协议服务器,为大语言模型提供基本的数学和统计函数,使它们能够通过简单的API进行精确的数值计算。

该服务暂未提供标准配置,请参考 README 手动接入

可用工具 (13 个)

该服务在 MCP 协议中暴露的工具,AI 可按需调用

add 2 个参数 需填 2 项

Adds two numbers together

必填参数:firstNumber、secondNumber

subtract 2 个参数 需填 2 项

Subtracts the second number from the first number

必填参数:minuend、subtrahend

multiply 2 个参数 需填 2 项

Multiplies two numbers together

必填参数:firstFactor、secondFactor

division 2 个参数 需填 2 项

Divides the first number by the second number

必填参数:numerator、denominator

sum 1 个参数 需填 1 项

Adds any number of numbers together

必填参数:numbers

mean 1 个参数 需填 1 项

Calculates the arithmetic mean of a list of numbers

必填参数:numbers

median 1 个参数 需填 1 项

Calculates the median of a list of numbers

必填参数:numbers

mode 1 个参数 需填 1 项

Finds the most common number in a list of numbers

必填参数:numbers

min 1 个参数 需填 1 项

Finds the minimum value from a list of numbers

必填参数:numbers

max 1 个参数 需填 1 项

Finds the maximum value from a list of numbers

必填参数:numbers

floor 1 个参数 需填 1 项

Rounds a number down to the nearest integer

必填参数:value

ceiling 1 个参数 需填 1 项

Rounds a number up to the nearest integer

必填参数:value

round 1 个参数 需填 1 项

Rounds a number to the nearest integer

必填参数:value

服务介绍

Math-MCP

一个提供基本数学和统计功能给大型语言模型(LLMs)的模型上下文协议(MCP)服务器。该服务器通过简单的API使LLMs能够执行精确的数值计算。

特性

  • 基本算术运算(加法、减法、乘法、除法)
  • 统计函数(求和、平均值、最小值、最大值)
  • 取整函数(向下取整、向上取整、四舍五入)

安装

只需克隆此仓库并保存在你电脑上的某个本地位置。

然后将此服务器添加到你的MCP配置文件中:

"math": {
  "command": "node",
  "args": ["PATH\\TO\\PROJECT\\math-mcp\\build\\index.js"]
}

PATH\\TO\\PROJECT 替换为你实际克隆仓库的位置。

可用函数

Math-MCP 服务器提供了以下数学操作:

函数 描述 参数
add 将两个数相加 firstNumber: 第一个加数secondNumber: 第二个加数
subtract 从第一个数中减去第二个数 minuend: 被减数subtrahend: 减数
multiply 将两个数相乘 firstFactor: 第一个因数secondFactor: 第二个因数
division 将第一个数除以第二个数 numerator: 被除数denominator: 除数
sum 将任意数量的数相加 numbers: 需要相加的数字数组
average 计算一组数的算术平均值 numbers: 需要求平均值的数字数组
min 从一组数中找到最小值 numbers: 需要找最小值的数字数组
max 从一组数中找到最大值 numbers: 需要找最大值的数字数组
floor 将一个数向下取整到最接近的整数 value: 需要向下取整的数
ceiling 将一个数向上取整到最接近的整数 value: 需要向上取整的数
round 将一个数四舍五入到最接近的整数 value: 需要四舍五入的数

相关 MCP 服务