Calculator MCP Server
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., "@Calculator MCP Server What is 123 times 456?"
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.
Calculator MCP Server
一个简单的计算器 MCP 服务器,基于 Model Context Protocol 协议,提供加减乘除四则运算功能。
项目简介
Calculator MCP Server 是一个基于 TypeScript 开发的 Model Context Protocol 服务器,为 AI 客户端提供标准化的计算工具能力。通过 MCP 协议,AI 助手可以自动调用加、减、乘、除四则运算工具,无需用户手动计算。
功能特性
➕ 加法运算: 计算两个数的和
➖ 减法运算: 计算两个数的差
✖️ 乘法运算: 计算两个数的积
➗ 除法运算: 计算两个数的商(自动校验除数不为零)
🔒 参数校验: 基于 zod 的自动参数类型校验
📝 调用日志: 服务器端输出每次工具调用的详细日志
工具列表
工具名 | 功能 | 参数 |
| 加法 |
|
| 减法 (a - b) |
|
| 乘法 |
|
| 除法 (a ÷ b) |
|
技术栈
TypeScript + Node.js
@modelcontextprotocol/sdk(McpServer 高层 API)
zod(参数校验)
Related MCP server: Calculator MCP Server
部署指南
环境依赖
Node.js >= 18
本地构建
# 安装依赖
npm install
# 构建
npm run build构建完成后生成 dist/index.js,MCP 客户端会通过 stdio 方式调用它,无需手动启动。
服务配置
在 MCP 客户端中添加以下 STDIO 类型服务配置:
{
"mcpServers": {
"calculator": {
"command": "npx",
"args": [
"-y",
"calculator-mcp-server"
]
}
}
}Windows 系统下,建议使用以下配置:
{
"mcpServers": {
"calculator": {
"command": "cmd",
"args": [
"/c",
"npx",
"-y",
"calculator-mcp-server"
]
}
}
}如果使用本地源码运行,请将 args 替换为实际路径:
{
"mcpServers": {
"calculator": {
"command": "node",
"args": ["D:\\project\\open-mcp\\dist\\index.js"]
}
}
}各客户端配置示例
Trae
打开 Trae 设置 → MCP 服务器,添加以下配置:
{
"mcpServers": {
"calculator": {
"command": "node",
"args": ["D:\\project\\open-mcp\\dist\\index.js"]
}
}
}MCP Inspector 调试
npx @modelcontextprotocol/inspector node dist/index.js浏览器打开后,可以在可视化界面中直接测试所有工具。
命令行测试
项目提供了测试脚本 test.cjs:
# 查看所有工具
node test.cjs list
# 调用具体工具(参数:工具名 a b)
node test.cjs call add 3 5
node test.cjs call multiply 123 456
node test.cjs call divide 100 3使用示例
示例 1:加法运算
在 AI 客户端中输入:
帮我算一下 3 + 5 等于多少?
AI 自动调用 add 工具,返回结果:
3 + 5 = 8示例 2:乘法运算
帮我算一下 123 × 456 等于多少?
AI 自动调用 multiply 工具,返回结果:
123 × 456 = 56088示例 3:除法运算
帮我算一下 100 ÷ 3 等于多少?
AI 自动调用 divide 工具,返回结果:
100 ÷ 3 = 33.333333333333336服务器运行日志
工具调用时,服务器终端会输出调用日志:
计算器 MCP 服务器已启动
[2026-08-04T05:46:55.953Z] 收到调用: multiply {"a":123,"b":456}
[2026-08-04T05:46:55.954Z] 结果(multiply): 123 × 456 = 56088Available Tools
4 toolsTool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool performs a unique arithmetic operation (addition, subtraction, multiplication, division) with no overlap. The distinct mathematical symbols in descriptions remove any ambiguity.
All tool names follow the same verb pattern using the operation name (add, subtract, multiply, divide). This is perfectly consistent and predictable.
Four tools is an ideal scope for a basic calculator server, covering the core arithmetic operations without unnecessary bloat.
The four basic operations cover the primary use case for a calculator. A modulo or power operation could be added, but the surface is not severely incomplete.
Maintenance
Related MCP Connectors
Unofficial Math.js MCP — wraps the mathjs.org API (free, no auth)
This MCP server enables users to perform scientific computations regarding linear algebra and vect…
Tested financial & practical calculators as free, no-auth MCP tools for AI agents.
SmartMoney77 MCP v0.6.0 — 14 public tools that turn financial questions into exact numbers and citable links. New: historical_investment_return and compare_investments, which compute "what if I had invested" results from real yearly price data. Also compound interest, FIRE number, credit-card payoff, emergency fund, inflation, latte factor, investment fees, cost of waiting, plus discovery/deep-link/share-pack tools for a catalog of calculators in 6 languages (he/en/ar/es/pt/in). Public, no login. Endpoint: https://smartmoney77.com/mcp
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI applications to perform basic mathematical operations like addition and subtraction through MCP tools. Also provides REST API endpoints for the same operations.MIT
- FlicenseNot gradedqualityDmaintenanceProvides basic calculator operations (add, subtract, multiply, divide) as MCP tools for use with Claude Desktop and other MCP clients.-
- FlicenseNot gradedqualityDmaintenanceEnables basic calculator operations such as add, subtract, multiply, and divide through an MCP interface.-
- FlicenseNot gradedqualityCmaintenanceEnables AI agents to perform arithmetic operations such as addition, subtraction, multiplication, and division through standardized MCP tools.1-