Simple Calculator MCP
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Simple Calculator MCPadd 15 and 27"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
简单计算器MCP工具
这是一个简单的计算器MCP(Model Context Protocol)工具,提供基本的数学运算功能。
{
"name": "simple-calculator-mcp",
"version": "1.0.0",
"description": "一个简单的计算器MCP工具,提供基本的数学运算功能",
"author": "SanLangLOVE",
"license": "MIT",
"runtime": "node",
"entry": "dist/index.js",
"dependencies": {
"@modelcontextprotocol/sdk": "^0.4.0"
},
"tools": [
{
"name": "add",
"description": "计算两个数字的和",
"parameters": {
"type": "object",
"properties": {
"a": {
"type": "number",
"description": "第一个数字"
},
"b": {
"type": "number",
"description": "第二个数字"
}
},
"required": ["a", "b"]
}
},
{
"name": "subtract",
"description": "计算两个数字的差",
"parameters": {
"type": "object",
"properties": {
"a": {
"type": "number",
"description": "被减数"
},
"b": {
"type": "number",
"description": "减数"
}
},
"required": ["a", "b"]
}
},
{
"name": "multiply",
"description": "计算两个数字的乘积",
"parameters": {
"type": "object",
"properties": {
"a": {
"type": "number",
"description": "第一个数字"
},
"b": {
"type": "number",
"description": "第二个数字"
}
},
"required": ["a", "b"]
}
},
{
"name": "divide",
"description": "计算两个数字的商",
"parameters": {
"type": "object",
"properties": {
"a": {
"type": "number",
"description": "被除数"
},
"b": {
"type": "number",
"description": "除数"
}
},
"required": ["a", "b"]
}
},
{
"name": "power",
"description": "计算一个数字的幂",
"parameters": {
"type": "object",
"properties": {
"base": {
"type": "number",
"description": "底数"
},
"exponent": {
"type": "number",
"description": "指数"
}
},
"required": ["base", "exponent"]
}
}
]
}功能特性
加法运算
减法运算
乘法运算
除法运算
幂运算
Related MCP server: Math MCP Server
安装和设置
1. 安装依赖
npm install2. 构建项目
npm run build3. 配置MCP客户端
在你的MCP客户端配置文件中添加以下配置:
对于Claude Desktop (macOS)
编辑 ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"simple-calculator": {
"command": "node",
"args": ["/Users/sanrosang/Documents/mcp/dist/index.js"],
"env": {}
}
}
}对于其他MCP客户端
根据你的MCP客户端文档,添加相应的服务器配置。
使用方法
启动MCP客户端后,你可以使用以下工具:
1. 加法 (add)
参数:
a(数字),b(数字)示例:计算 5 + 3
2. 减法 (subtract)
参数:
a(被减数),b(减数)示例:计算 10 - 4
3. 乘法 (multiply)
参数:
a(数字),b(数字)示例:计算 6 × 7
4. 除法 (divide)
参数:
a(被除数),b(除数)示例:计算 15 ÷ 3
注意:除数不能为零
5. 幂运算 (power)
参数:
base(底数),exponent(指数)示例:计算 2^8
开发
运行开发版本
npm run dev项目结构
├── src/
│ └── index.ts # 主程序文件
├── dist/ # 编译输出目录
├── package.json # 项目配置
├── tsconfig.json # TypeScript配置
└── README.md # 说明文档扩展功能
你可以通过修改 src/index.ts 文件来添加更多功能:
在
tools数组中添加新的工具定义在
CallToolRequestSchema处理函数中添加对应的处理逻辑
许可证
MIT License
ModelScope 部署
本项目已配置为支持ModelScope平台部署。主要配置信息:
运行时: Node.js
入口文件:
dist/index.js依赖管理: npm
构建命令:
npm run build启动命令:
node dist/index.js
部署要求
确保项目已构建(
npm run build)确保所有依赖已安装(
npm install)确保
dist/index.js文件存在且可执行
ModelScope平台配置
在ModelScope平台的设置页面中,使用以下配置:
服务名称: mcp-calculator
服务描述: 一个简单的计算器MCP工具,提供基本的数学运算功能
运行环境: Node.js
启动命令: node dist/index.js
工作目录: /
工具列表
本MCP服务器提供以下工具:
add - 加法运算
subtract - 减法运算
multiply - 乘法运算
divide - 除法运算
power - 幂运算
所有工具都支持数字类型参数,并提供完整的错误处理机制。
环境变量
{
"NODE_ENV": "production"
}健康检查
服务支持MCP协议标准健康检查,确保服务正常运行。
Available Tools
5 toolsaddB
计算两个数字的和
| Name | Required | Description | Default |
|---|---|---|---|
| a | Yes | 第一个数字 | |
| b | Yes | 第二个数字 |
divideB
计算两个数字的商
| Name | Required | Description | Default |
|---|---|---|---|
| a | Yes | 被除数 | |
| b | Yes | 除数 |
multiplyB
计算两个数字的乘积
| Name | Required | Description | Default |
|---|---|---|---|
| a | Yes | 第一个数字 | |
| b | Yes | 第二个数字 |
powerB
计算一个数字的幂
| Name | Required | Description | Default |
|---|---|---|---|
| base | Yes | 底数 | |
| exponent | Yes | 指数 |
subtractB
计算两个数字的差
| Name | Required | Description | Default |
|---|---|---|---|
| a | Yes | 被减数 | |
| b | Yes | 减数 |
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
5 tool updates
- First observed
add - First observed
divide - First observed
multiply - First observed
power - First observed
subtract
TDQS
Scored across 5 tools
Each tool has a clearly distinct mathematical operation: addition, division, multiplication, exponentiation, and subtraction. There is no overlap in purpose, and the descriptions explicitly state what each tool does, making misselection unlikely.
All tool names follow a consistent verb-only pattern (e.g., add, divide, multiply, power, subtract). They are all in lowercase and describe the core operation without unnecessary variation, making the set highly predictable.
With 5 tools, this server is well-scoped for a simple calculator. Each tool covers a fundamental arithmetic operation, and there are no extraneous tools. The count is appropriate for the domain, providing essential functionality without bloat.
The tool set covers all basic arithmetic operations (addition, subtraction, multiplication, division) and includes exponentiation, which is a common extension. There are no obvious gaps for a simple calculator, as it supports the core mathematical workflows agents would need.
Maintenance
Related MCP Connectors
Deterministic time-value-of-money and fund-performance tools for AI agents — future value, present value, CAGR, annuities, perpetuities, loan payments, payback, discounted payback, DPI, RVPI and TVPI via Model Context Protocol. Useful for corporate finance, financial projections, financial analysis, quantitative analysis, financial formulas and financial modeling.
Deterministic profitability and market-value analysis tools for AI agents — margins, ROA, ROE, ROCE, ROIC, EPS, P/E, P/B, dividend yield and payout ratio via Model Context Protocol. Useful for corporate finance, equity analysis, financial analysis, quantitative analysis, financial formulas and financial modeling.
Deterministic operational-efficiency ratio tools for AI agents — asset, fixed-asset, inventory, receivables and payables turnover, days outstanding measures and cash conversion cycle via Model Context Protocol. Useful for corporate finance, financial analysis, working-capital analysis, financial formulas and financial modeling.
Deterministic company valuation and corporate finance tools for AI agents — IRR, NPV, MOIC, DCF, WACC, enterprise value, EV multiples, CAPM, beta and sensitivity analysis via Model Context Protocol. Useful for financial analysis, equity analysis, quantitative analysis, financial projections, financial formulas and financial modeling.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceProvides basic arithmetic operations and advanced mathematical functions through the Model Context Protocol (MCP), with features like calculation history tracking and expression evaluation.1-
- AlicenseAqualityDmaintenanceEnables basic arithmetic operations (addition, subtraction, multiplication, division) with 64-bit precision and matrix multiplication capabilities. Provides mathematical computation tools for AI assistants through the Model Context Protocol.51MIT
- AlicenseBqualityDmaintenanceProvides mathematical computation capabilities including basic arithmetic operations (add, subtract, multiply, divide), advanced functions (square root, factorial, logarithm), and trigonometric functions (sin, cos, tan) through the Model Context Protocol.5MIT
- AlicenseNot gradedqualityDmaintenanceProvides basic arithmetic operations (add, multiply, divide) for AI assistants through the Model Context Protocol.ISC