
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
bachai-mcp-calculator
Advanced tools
一个基于 SSE (Server-Sent Events) 的 Model Context Protocol 计算器服务器,运行在 8000 端口。
✨ 支持的计算操作:
🔒 安全特性:
# 安装依赖
npm install
# 构建项目
npm run build
⚠️ 必须设置环境变量才能启动服务器!
创建 .env 文件:
cp .env.example .env
编辑 .env 文件,设置启动者姓名:
# 启动者姓名(必需)
OPERATOR_NAME=张三
# 服务器端口
PORT=8000
# Node 环境
NODE_ENV=development
# 启动服务器
npm start
# 或者直接在命令行设置环境变量
OPERATOR_NAME=张三 npm start
# 开发模式(自动重新构建)
npm run dev
服务器将运行在 http://localhost:8000
GET http://localhost:8000/health
返回服务器状态信息。
GET http://localhost:8000/sse
建立 SSE 连接,用于 MCP 通信。
// 客户端连接示例
const eventSource = new EventSource('http://localhost:8000/sse');
eventSource.onmessage = (event) => {
console.log('收到消息:', event.data);
};
加法运算
{
"name": "add",
"arguments": {
"a": 10,
"b": 5
}
}
返回: 10 + 5 = 15
减法运算
{
"name": "subtract",
"arguments": {
"a": 10,
"b": 5
}
}
返回: 10 - 5 = 5
乘法运算
{
"name": "multiply",
"arguments": {
"a": 10,
"b": 5
}
}
返回: 10 × 5 = 50
除法运算
{
"name": "divide",
"arguments": {
"a": 10,
"b": 5
}
}
返回: 10 ÷ 5 = 2
幂运算
{
"name": "power",
"arguments": {
"a": 2,
"b": 3
}
}
返回: 2^3 = 8
平方根
{
"name": "sqrt",
"arguments": {
"a": 16
}
}
返回: √16 = 4
阶乘
{
"name": "factorial",
"arguments": {
"n": 5
}
}
返回: 5! = 120
获取启动者信息
{
"name": "get_operator_info",
"arguments": {}
}
返回服务器信息,包括启动者姓名、版本、端口等
mcp-calculator/
├── src/
│ └── index.ts # 主服务器文件
├── dist/ # 编译输出目录
├── package.json
├── tsconfig.json
├── .env.example
├── .gitignore
└── README.md
# 监听文件变化,自动重新编译
npm run watch
# 在另一个终端运行
npm start
MIT
FAQs
一个基于 SSE 的计算器 MCP 服务器
The npm package bachai-mcp-calculator receives a total of 1 weekly downloads. As such, bachai-mcp-calculator popularity was classified as not popular.
We found that bachai-mcp-calculator demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.