LabscoMCP early access ↗
codedrop-codesMCP SERVER

Refactory

Split a monolith file into modules — the LLM picks the boundaries, code does the extraction.

by codedrop-codes ↗Code Generation, Scaffolding & MigrationCommunity

LABSCO 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 first
  • refactory_plan — a multi-module decomposition strategy: which functions go where, and an import structure that avoids circular dependencies
  • refactory_extract — writes the new module with correct imports and re-exports the moved logic from the original file
  • refactory_verify — syntax check, import resolution, circular-dependency scan, and the existing tests run for behavioural parity
  • refactory_metrics and refactory_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