Refactory MCP Server

Mechanical code decomposition. AI plans module boundaries, deterministic extraction copies the code. JS/Python built in.

Local serverstdioPython

What is the Refactory MCP server?

Mechanical code decomposition. AI plans module boundaries, deterministic extraction copies the code. JS/Python built in. Exposed over MCP by the refactory mcp server, that capability becomes something an assistant can invoke while it works, not something you go and do afterwards.

What it actually does

Refactory splits monolith source files into clean modules. It uses an LLM for one thing — deciding which functions group together. Everything else is mechanical: function boundary detection, import resolution, module assembly, syntax validation, scoring.

Its toolset

Everything the assistant can do here goes through one of these:

  • clean_rate — modules that load without errors / total modules
  • size_reduction — 1 − (largest module / original file)
  • Metric — Value
  • Language — Extraction
  • Provider — Output

Adding it to your client

Installation goes through your MCP client rather than a global install: point it at node on npm and it is fetched when the client starts. The copy-paste blocks for Claude Desktop, Claude Code and Cursor are further down this page.

Configuration

You will need 4 environment variables: GROQ_API_KEY, GOOGLE_API_KEY, OPENROUTER_API_KEY, SAMBANOVA_API_KEY. The server will not start without them, which is usually why the tools fail to appear on a first run. Keep credentials in your client's env block or a secrets manager rather than in a file you might commit.

When to reach for it

Among the developer tooling options, the useful question is rarely "what can it do" but "what does it cost you to run" — permissions, credentials, and how much of your context its toolset consumes. Refactory's toolset — clean_rate, size_reduction, Metric and 2 more — is a fair guide to whether it matches your workflow. It is maintained by codedrop-codes; worth a glance at recent repository activity before you build anything load-bearing on it.

This entry was verified against Refactory's own documentation before publication; SyncDev keeps the directory reviewed rather than auto-generated.

Caveats

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • Missing credentials fail quietly in some clients — if no tools show up, check the environment block first.
  • MCP clients confirm each tool call by default. Leave that on until you have watched what the refactory mcp server does with a few real requests.

Available tools

ToolWhat it does
clean_ratemodules that load without errors / total modules
size_reduction1 − (largest module / original file)
MetricValue
LanguageExtraction
ProviderOutput

How to install the Refactory MCP server

{
  "mcpServers": {
    "refactory": {
      "command": "npx",
      "args": ["@refactory/mcp"],
      "env": {
        "GROQ_API_KEY": "your-key-here"
      }
    }
  }
}

Configuration as documented by the project. Restart the client after saving.

Configuration

VariableDescriptionRequired
GROQ_API_KEYCredential the server authenticates with.Yes
GOOGLE_API_KEYCredential the server authenticates with.Yes
OPENROUTER_API_KEYCredential the server authenticates with.Yes
SAMBANOVA_API_KEYCredential the server authenticates with.Yes

Example prompts to try

  • Use Refactory to clean rate.
  • Use Refactory to size reduction.
  • Use Refactory to Metric.

Frequently asked questions

It connects Refactory to MCP-compatible AI assistants such as Claude and Cursor, exposing 5 tools (clean_rate, size_reduction, Metric, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with Refactory directly.