refactory_analyzeLABSCO SUMMARY
The score is one number, and it is honest about what it measures.
Refactory Score is clean_rate multiplied by size_reduction — how many modules load without error, times how much smaller the largest module is than the original. A 1.0 means everything loads and nothing is bigger than what you started with. Across 15 production monoliths the published figures are 32,736 lines decomposed, 1,017 functions extracted and a pipeline score of 0.89, with roughly 80% of extractions mechanical. Go, Rust, Java, C#, Kotlin and Swift mechanical extraction sits behind the paid tier.
What it is
A decomposition tool with a deliberate division of labour: a model decides which functions belong together, and a deterministic engine does the boundary detection, import resolution, module assembly, syntax validation and scoring.
What you get
refactory_analyze— function count, lines, a dependency graph, and the routines worth extracting firstrefactory_plan— a multi-module decomposition strategy: which functions go where, and an import structure that avoids circular dependenciesrefactory_extract— writes the new module with correct imports and re-exports the moved logic from the original filerefactory_verify— syntax check, import resolution, circular-dependency scan, and the existing tests run for behavioural parityrefactory_metricsandrefactory_report— the Refactory Score plus a summary with Mermaid dependency graphs and any manual cleanup left- A seven-step pipeline where 6 of 7 steps are deterministic; the model only decides where to split and never touches your code
Requirements
The package.json names @refactory/mcp at version 0.2.0, which npm does not have; from a clone it runs as a CLI with node src/cli.js decompose. Node >= 20. One free LLM key is needed, and only for the plan step — set at least one of GROQ_API_KEY, GOOGLE_API_KEY, OPENROUTER_API_KEY or SAMBANOVA_API_KEY. JavaScript, TypeScript and Python extraction is mechanical and needs no key at all; other languages fall back to LLM extraction with compression.
Setup effort
Build from source — git clone https://github.com/codedrop-codes/refactory.git
USE CASES
Breaking up a file nobody wants to open any more
Analyse it, get a module plan, and let the deterministic engine move the functions.
Proving the split did not break anything
Syntax, import resolution, circular dependencies and the existing tests are all checked after extraction.
Deciding whether the refactor was worth it
Compare before and after and read one score rather than arguing about it.
Refactoring without spending on tokens
For JavaScript and Python only the planning step calls a model; the extraction is mechanical.
6 tools
Listed in project docs. Your client may show a different list.
refactory_planrefactory_extractrefactory_verifyrefactory_metricsrefactory_reportBEFORE YOU INSTALL
What to know first
Tools you get
6 tools named in the project's documentation.
Requires
- Node.js 20 or newer
- One LLM key for the plan step: GROQ_API_KEY, GOOGLE_API_KEY, OPENROUTER_API_KEY or SAMBANOVA_API_KEY
INSTALLATION
Connect your client
Server setup
git clone https://github.com/codedrop-codes/refactory.git
cd refactory && npm installMCP Clients
Any MCP client
Clone and install
@refactory/mcp is not on npm, so the server runs from a clone.
git clone https://github.com/codedrop-codes/refactory.git
cd refactory && npm installAdd this to .mcp.json or your client's config
<YOUR_PATH_TO_REFACTORY> is the full path of the clone. One free key is enough, and only the plan step uses it: GROQ_API_KEY as shown, or GOOGLE_API_KEY, OPENROUTER_API_KEY or SAMBANOVA_API_KEY instead.
{
"mcpServers": {
"refactory": {
"command": "node",
"args": [
"<YOUR_PATH_TO_REFACTORY>/src/server.js"
],
"env": {
"GROQ_API_KEY": "<YOUR_GROQ_API_KEY>"
}
}
}
}