Code Refactor
v1.0.4Refactor legacy code into modern, idiomatic code without changing its behavior.
Values you need
| Variable | What it is | |
|---|---|---|
REFACTOR_BACKEND | optional | Inference backend: 'ollama' (local, code stays on your machine, default) or 'openai' (any OpenAI-compatible cloud endpoint, e.g. DeepSeek). Default: ollama |
OPENAI_BASE_URL | optional | Base URL of the OpenAI-compatible endpoint, e.g. https://api.deepseek.com/v1. Required when REFACTOR_BACKEND=openai. |
OPENAI_API_KEY | optional secret | API key for the cloud endpoint, e.g. a DeepSeek key. Only needed when REFACTOR_BACKEND=openai. |
OPENAI_MODEL | optional | Cloud model name, e.g. deepseek-chat. Default: deepseek-chat |
OLLAMA_HOST | optional | Ollama server address used when REFACTOR_BACKEND=ollama. Default: http://127.0.0.1:11434 |
OLLAMA_MODEL | optional | Ollama model name used when REFACTOR_BACKEND=ollama. Default: qwen2.5-coder |
REFACTOR_TIMEOUT_MS | optional | Per-call timeout in milliseconds. Raise it for slow local CPU inference. Default: 180000 |
npm (npx) discovery passed
Requires Node.js 18+
Run in a terminal
claude mcp add code-refactor -- npx -y workbuddy-code-refactor-connector@1.0.4Add to
claude_desktop_config.json{
"mcpServers": {
"code-refactor": {
"args": [
"-y",
"workbuddy-code-refactor-connector@1.0.4"
],
"command": "npx"
}
}
}Add to
~/.cursor/mcp.json{
"mcpServers": {
"code-refactor": {
"args": [
"-y",
"workbuddy-code-refactor-connector@1.0.4"
],
"command": "npx"
}
}
}Add to
.vscode/mcp.json{
"servers": {
"code-refactor": {
"args": [
"-y",
"workbuddy-code-refactor-connector@1.0.4"
],
"command": "npx",
"type": "stdio"
}
}
}Add to
~/.codex/config.toml[mcp_servers.code-refactor]
command = "npx"
args = ["-y", "workbuddy-code-refactor-connector@1.0.4"]Remote (hosted)
Run in a terminal
claude mcp add --transport http code-refactor https://code-refactor-api.app.workbuddy.host/mcpAdd to
Settings → Connectors → Add custom connector (or claude_desktop_config.json via mcp-remote){
"mcpServers": {
"code-refactor": {
"args": [
"-y",
"mcp-remote",
"https://code-refactor-api.app.workbuddy.host/mcp"
],
"command": "npx"
}
}
}Add to
~/.cursor/mcp.json{
"mcpServers": {
"code-refactor": {
"url": "https://code-refactor-api.app.workbuddy.host/mcp"
}
}
}Add to
.vscode/mcp.json{
"servers": {
"code-refactor": {
"type": "http",
"url": "https://code-refactor-api.app.workbuddy.host/mcp"
}
}
}Add to
~/.codex/config.toml[mcp_servers.code-refactor]
command = "npx"
args = ["-y", "mcp-remote", "https://code-refactor-api.app.workbuddy.host/mcp"]For AI agents
- Pick the user's MCP client and apply the matching config from the first install method (it is the one verified by the smoke test when available).
- Restart or reload the client so it starts the server.
- Verify: the server should expose these tools: refactor_code, check_status.
- If it fails, check that the required runtime is installed (Node.js 18+) and that the values above are set.
Machine-readable: install.md · manifest.json