Code Refactor

io.github.zhouhengchang/code-refactor

Refactor legacy code into modern, idiomatic code without changing its behavior.

Connect this server

Add this to your MCP client config — claude_desktop_config.json (Claude Desktop) or .cursor/mcp.json (Cursor).Suits: Claude Desktop · Cursor.

{
  "mcpServers": {
    "code-refactor": {
      "command": "npx",
      "args": [
        "-y",
        "workbuddy-code-refactor-connector@1.0.4"
      ],
      "env": {
        "REFACTOR_BACKEND": "ollama",
        "OPENAI_API_KEY": "<your OPENAI_API_KEY>",
        "OPENAI_MODEL": "deepseek-chat",
        "OLLAMA_HOST": "http://127.0.0.1:11434",
        "OLLAMA_MODEL": "qwen2.5-coder",
        "REFACTOR_TIMEOUT_MS": "180000"
      }
    }
  }
}
Environment variables
  • REFACTOR_BACKENDInference backend: 'ollama' (local, code stays on your machine, default) or 'openai' (any OpenAI-compatible cloud endpoint, e.g. DeepSeek).
  • OPENAI_API_KEYsecretAPI key for the cloud endpoint, e.g. a DeepSeek key. Only needed when REFACTOR_BACKEND=openai.
  • OPENAI_MODELCloud model name, e.g. deepseek-chat.
  • OLLAMA_HOSTOllama server address used when REFACTOR_BACKEND=ollama.
  • OLLAMA_MODELOllama model name used when REFACTOR_BACKEND=ollama.
  • REFACTOR_TIMEOUT_MSPer-call timeout in milliseconds. Raise it for slow local CPU inference.

A starting point — check the repository for exact arguments and setup. Restart your client after editing the config.

Category
Developer Tools
Version
1.0.4
Registry
active
Published
10/18/2026

Remotes

  • streamable-httphttps://code-refactor-api.app.workbuddy.host/mcp
Browse all Developer Tools →

Add the badge to your site

Show visitors that Code Refactor is listed here — it’s also the link we check for a free listing.

Code Refactor — listed on Serverdex

HTML — for your website

<a href="https://serverdex.io/server/io-github-zhouhengchang-code-refactor?utm_source=badge"><img src="https://serverdex.io/brand/badge.svg" alt="Code Refactor — listed on Serverdex" width="123" height="40" loading="lazy"></a>

Recommended. A dofollow link from your own domain is the one that counts for search engines, and it's the link we check for a free listing.

Markdown — for your README

[![Code Refactor — listed on Serverdex](https://serverdex.io/brand/badge.svg)](https://serverdex.io/server/io-github-zhouhengchang-code-refactor?utm_source=badge)

Nice for visibility, but GitHub marks README links nofollow, so it doesn't pass authority. Use the HTML badge on your site as well.