Calculator Mcp

io.github.tech-sushant由 GitHub 帳號 tech-sushant 發布v1.0.1更新於 Oct 24, 2026

A simple Model Context Protocol calculator server

發布方自己的服務:Calculator Tools MCP

已驗證STDIO僅桌面

概覽

AI 產生的概覽

一個本機 MCP 伺服器,為助理提供基本算術工具:加、減、乘、除、次方與平方根。

可以做什麼
對兩個數字執行加、減、乘運算,並以類似 5 + 3 = 8 的算式形式回傳結果。
適用情境
適合希望助理透過專用工具完成簡單算術、而非自行計算的情境,例如在 Claude Desktop 等桌面 MCP 用戶端中使用。
執行需求
以本機 Node.js 程序執行,從 npm 套件安裝;README 說明需安裝相依套件、建置 TypeScript 程式碼,並在 MCP 用戶端設定中指向編譯後的進入檔案。未宣告任何帳號、API 金鑰或環境變數。
安裝前請注意
這些工具僅進行計算並回傳結果;README 未提及寫入、網路請求或將資料分享給第三方。除以零與對負數取平方根會回傳錯誤而非數值。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Calculator Mcp,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

Calculator MCP Server

A simple Model Context Protocol (MCP) server that provides basic calculator functionality through MCP tools.

Features

This MCP server provides the following calculator tools:

  • add: Add two numbers together
  • subtract: Subtract second number from first number
  • multiply: Multiply two numbers together
  • divide: Divide first number by second number (with zero-division protection)
  • power: Raise first number to the power of second number
  • sqrt: Calculate square root of a number (with negative number protection)

Installation

  1. Install dependencies:
bash
npm install
  1. Build the TypeScript code:
bash
npm run build

Usage

Running the Server

Start the MCP server:

bash
npm start

Or run in development mode:

bash
npm run dev

MCP Client Configuration

To use this calculator MCP server with an MCP client (like Claude Desktop), add it to your MCP configuration:

json
{  "mcpServers": {    "calculator": {      "command": "node",      "args": ["/path/to/calculator-mcp/dist/index.js"],      "env": {}    }  }}

Available Tools

add

Adds two numbers together.

  • Parameters: a (number), b (number)
  • Example: add(5, 3) returns 5 + 3 = 8
subtract

Subtracts the second number from the first.

  • Parameters: a (number), b (number)
  • Example: subtract(10, 4) returns 10 - 4 = 6
multiply

Multiplies two numbers together.

  • Parameters: a (number), b (number)
  • Example: multiply(6, 7) returns 6 × 7 = 42
divide

Divides the first number by the second.

  • Parameters: a (number), b (number)
  • Example: divide(15, 3) returns 15 ÷ 3 = 5
  • Error handling: Returns error for division by zero
power

Raises the base to the power of the exponent.

  • Parameters: base (number), exponent (number)
  • Example: power(2, 8) returns 2^8 = 256
sqrt

Calculates the square root of a number.

  • Parameters: number (number)
  • Example: sqrt(16) returns √16 = 4
  • Error handling: Returns error for negative numbers

Development

Project Structure

calculator-mcp/├── src/│   └── index.ts          # Main MCP server implementation├── dist/                 # Compiled JavaScript output├── package.json          # Dependencies and scripts├── tsconfig.json         # TypeScript configuration└── README.md            # This file

Building

bash
npm run build

Development Mode

bash
npm run dev

Error Handling

The calculator includes proper error handling for:

  • Division by zero
  • Square root of negative numbers
  • Invalid tool names
  • General execution errors

All errors are returned with appropriate error messages and the isError flag set to true.

License

MIT

來源:README.md,提交 9dfd897

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v1.0.1最新Sep 16, 2026

評分

已滿足適用檢查項的 40%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

    請在儲存庫或註冊中心條目中宣告授權條款。

其他 Calculator 整合