Calcport

io.github.CloudCorpRecords由 GitHub 账号 CloudCorpRecords 发布v0.1.0更新于 Oct 29, 2026

Safe arithmetic: evaluate expressions and add, subtract, multiply, divide.

已验证STDIO仅桌面开发者工具

概览

AI 生成的概览

Calcport 是一个本地 MCP 服务器,为助手提供安全的算术能力:一个表达式求值器,以及加、减、乘、除四个工具。

可以做什么
  • 求值表达式,支持运算符、括号、sqrt、abs、floor、ceil、round 以及常量 pi 和 e
  • 把两个数相加
  • 用一个数减去另一个数
  • 把两个数相乘
  • 用一个数除以另一个数,除数为零时报错
适用场景
适合需要助手进行精确算术或核对计算结果的场景,尤其是希望使用一个极小、受限的求值器而不是通用代码执行工具时。
运行要求
以本地进程通过 stdio 运行,可用 npx 从 npm 包启动,或用 docker 从容器镜像启动。未声明账号、API 密钥、环境变量或请求头,运行时不需要网络访问。
安装前请注意
这些工具只做数值计算并返回结果,不会写入、发送或删除任何数据。求值器是手写解析器,仅限算术,无法执行代码、shell 命令或属性查找。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Calcport,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

calcport

calcport does arithmetic safely. Its centrepiece is an expression evaluator that understands the usual operators, parentheses, a handful of functions, and the constants pi and e — and nothing else. The evaluator is a hand-written parser, so an expression can never turn into code execution, a shell call, or a property lookup. Around it sit four single-purpose operations for callers that just need one sum, difference, product, or quotient.

Install

bash
npx @reneturcios/calcport calculate "2+3*4"

Or run the container image:

bash
docker run -i ghcr.io/cloudcorprecords/calcport

The container defaults to the MCP server (see below). Pass CLI arguments to use it as a CLI instead.

CLI

bash
# Evaluate an expressioncalcport calculate "sqrt(3^2 + 4^2) + pi"# 8.141592653589793
# Single operationscalcport add 2 3          # 5calcport subtract 10 4    # 6calcport multiply 2.5 4   # 10calcport divide 7 2       # 3.5
# Machine-readable outputcalcport calculate "2^10" --jsoncalcport add 2 3 --json
calcport --version

Expressions may use + - * / % ^, parentheses, unary minus, the functions sqrt, abs, floor, ceil, and round, and the constants pi and e. ^ is right-associative, so 2^3^2 is 512.

Exit codes: 0 on success, 1 when a calculation cannot be done (division by zero, a malformed expression — the error says why), 2 for usage errors.

MCP server

One bin serves both faces. The mcp subcommand starts a stdio MCP server:

bash
npx -y @reneturcios/calcport mcp

MCP client configuration:

json
{  "mcpServers": {    "calcport": {      "command": "npx",      "args": ["-y", "@reneturcios/calcport", "mcp"]    }  }}

Tools

ToolInputWhat it returns
calculateexpression (string, required)The numeric result of the expression, with the expression echoed back.
adda, b (numbers, required)a + b, with both operands.
subtracta, b (numbers, required)a - b, with both operands.
multiplya, b (numbers, required)a * b, with both operands.
dividea, b (numbers, required)a / b, with both operands. Dividing by zero is an error.

Development

bash
npm installnpm run build   # tsc -> dist/npm test        # node test runner over test/*.test.ts, no networknpm run dev     # run the CLI from source via tsx

License

MIT — see LICENSE.

来源:README.md,提交 b3087c2

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.1.0最新Oct 29, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分