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 个工具