Code Refactor
Refactor legacy code into modern, idiomatic code without changing its behavior.
我該用這個嗎
品質與安全性
B
發現項目(2)
- LOW在 refactor_code 中
- LOW在 check_status 中
根據工具定義與協定合規性的自動化分析。
上下文成本
~300Token(工具定義)
~509 B典型回應大小
極小的注意力影響(128k 上下文的 0.23%)
這是每次將伺服器的工具載入模型上下文時所消耗的約略 token 數量。數量越高,可用於其他工作的注意力就越少。
安裝
一鍵安裝
將以下內容加入你的 `claude_desktop_config.json` 檔案:
{
"mcpServers": {
"code-refactor": {
"command": "npx",
"args": [
"workbuddy-code-refactor-connector"
]
}
}
}可執行的套件
npmworkbuddy-code-refactor-connector
1.0.4stdio遠端端點
https://code-refactor-api.app.workbuddy.host/mcpstreamable-http它能做什麼
工具清單
工具(2)
🟢 唯讀🟡 寫入🔴 刪除⚪ 未知
⚪refactor_code(code, task, language)
把遗留代码重构为现代规范代码,行为保持不变。会做语义化重命名、补全类型标注、生成中文注释、优化结构。适用于 Python / JavaScript / TypeScript / Java / Go / Rust / C / C++。
輸入結構描述
{
"type": "object",
"properties": {
"code": {
"type": "string",
"description": "待重构的原始代码全文。"
},
"task": {
"type": "string",
"description": "重构要求,自然语言描述。例如:把函数名与变量名改为有意义的命名,补充类型标注与中文注释,保持行为不变。"
},
"language": {
"type": "string",
"description": "代码语言,如 python / javascript / java / go。留空或 auto 表示自动识别。"
}
},
"required": [
"code",
"task"
]
}🟢check_status
检查重构服务与云端模型(DeepSeek)是否可用,返回后端类型、模型名与密钥校验状态。建议在调用 refactor_code 前先调用本工具。
輸入結構描述
{
"type": "object",
"properties": {}
}社群
證據
近期觀測
已驗證未記錄版本2 個工具