Calculator MCP Server
Click on "Install 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 ServerWhat 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: Math Operations 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 = 56088Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Flicense-qualityDmaintenanceProvides basic mathematical operations (addition, subtraction, multiplication, division) through a Model Context Protocol server. Enables MCP-compatible clients like chatbots to perform calculations by sending structured math requests.Last updated
- Alicense-qualityDmaintenanceEnables AI applications to perform basic mathematical operations like addition and subtraction through MCP tools. Also provides REST API endpoints for the same operations.Last updatedMIT
- Alicense-qualityDmaintenanceEnables basic arithmetic operations (add, subtract, multiply, divide, modulo) via natural language, with a FastMCP-based server and client for exploring MCP tool calling.Last updatedMIT
- Flicense-qualityDmaintenanceEnables performing arithmetic operations (add, subtract, multiply, divide, power, modulo) via natural language through HTTP SSE transport, allowing integration with Claude or other MCP clients for AI-powered calculations.Last updated
Related MCP Connectors
This MCP server enables users to perform scientific computations regarding linear algebra and vect…
Precision math engine for AI agents. 203 exact methods. Zero hallucination.
Give AI agents real phone numbers, messages, and voice calls via MCP.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/doudou-fly/open-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server