1.0.0 • Published 9 months ago
@mikefd097021/mcp-server-test v1.0.0
MCP 計算器伺服器
這是一個簡單的 MCP (Model Context Protocol) 計算器伺服器,提供基本的加減運算功能。
功能
- 支援基本的加減運算
- 完整的輸入驗證
- 清晰的錯誤提示
使用方法
透過 npx 使用
在 VS Code 的 MCP 設定檔中加入:
{
"mcpServers": {
"calculator": {
"command": "cmd /c npx -y",
"args": ["@mikefd097021/mcp-server-test"],
"disabled": false,
"autoApprove": []
}
}
}本地開發
- 克隆倉庫:
git clone [repository-url]
cd mcp-server-test- 安裝依賴:
npm install- 建置專案:
npm run build- 本地測試:
npm link
npx mcp-server-testAPI
calculate
執行基本的加減運算。
參數:
operand1(number, 必要): 第一個數字operand2(number, 必要): 第二個數字operator(string, 必要): 運算符('+' 或 '-')
回傳:
- 計算結果文字,格式為:
計算結果: [operand1] [operator] [operand2] = [result]
授權
MIT