Calculator MCP Server
Calculator MCP Server
一个基于 Model Context Protocol (MCP) 的小型服务器,可通过 stdio 提供基本的计算器操作。

功能
该服务器提供以下工具:
工具 | 说明 | 参数 |
| 将两个数字相加 |
|
| 用第一个数字减去第二个数字 |
|
| 将两个数字相乘 |
|
| 将第一个数字除以第二个数字 |
|
所有参数都必须为数字。当 op2 为 0 时,div 会返回错误。
Related MCP server: Math MCP Server
环境要求
Node.js 18 或更高版本
npm
安装
从当前目录安装依赖:
npm install运行服务器
通过 stdio 启动 MCP 服务器:
npm start服务器会等待 MCP 客户端连接,因此不会在终端中打印正常的应用程序输出。
使用示例客户端进行测试
示例客户端会启动服务器、列出其工具,并以 10 和 0 调用 div,以演示除以零错误:
npm run test-client要测试成功运算,请更新 mcp-client-test.ts 中的 callTool 参数,例如:
arguments: { op1: 10, op2: 2 },使用 MCP Inspector
使用以下命令运行交互式 MCP Inspector:
npm run mcp-inspect打开命令输出的 URL,然后选择一个计算器工具,并为 op1 和 op2 提供值。
项目文件
mcp-server.ts- MCP 服务器和计算器工具定义mcp-client-test.ts- 示例 MCP 客户端mcp-calculator.gif- 教程演示package.json- 脚本和依赖
This server cannot be installed
Maintenance
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
- FlicenseCqualityDmaintenanceA server that provides tools for performing basic arithmetic operations (addition, subtraction, multiplication, division) via the Model Context Protocol.4
- AlicenseAqualityCmaintenanceEnables 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
- FlicenseAqualityDmaintenanceProvides basic mathematical operations including addition, subtraction, multiplication, division, and power calculations through a Model Context Protocol interface.51
- FlicenseNot gradedqualityDmaintenanceProvides file reading and mathematical calculation tools through the Model Context Protocol. Enables reading file contents and evaluating mathematical expressions via stdio transport.
Related MCP Connectors
Precision math engine for AI agents. 203 exact methods. Zero hallucination.
A Model Context Protocol server for Wix AI tools
AI-callable calculators and engineering models with real formulas. No hallucinated math.
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/souravjai/calculator-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server