Refactoring MCP Server logo

Refactoring MCP Server

Expose Fowler's refactoring catalog to LLMs with preview, analysis, inspection, and application tools.

Install Refactoring MCP Server

Pick your client, then add it in one click or paste the config.

STDIOPython
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "refactoring-mcp-server": {
      "command": "uvx",
      "args": [
        "mcp-refactoring"
      ],
      "env": {
        "MCP_REFACTORING_PYTHON_COMMAND": "YOUR_VALUE_HERE",
        "MCP_REFACTORING_PYTHON_ENABLED": "YOUR_VALUE_HERE"
      }
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Values are written into the snippet above so you can paste it as is. They never leave your browser.

We couldn’t confirm it starts correctly

We ran the install command but it didn't respond within our test window — this can mean a slow first-time install rather than a real problem.

uvx mcp-refactoring

No response to initialize.

This is an experimental automated check and can have false negatives — missing environment variables, a slow cold install, etc. It doesn’t necessarily mean something’s wrong. Last checked .

Overview

Refactoring MCP Server MCP server exposes Martin Fowler's refactoring catalog to LLMs through MCP. It provides tools to list refactorings, inspect code structure, analyze smells, preview edits, and apply changes through language backends. Python is supported first through a backend such as molting-cli, while Ruby, Java, and Go are planned. Use it when an agent needs structured, reviewable refactoring operations rather than free-form code edits.

Use cases

  • List available refactorings by language or category
  • Preview code changes before applying them
  • Apply named refactorings to methods and classes
  • Inspect code structure for agent planning
  • Analyze code smells and suggest refactorings

Key features

  • 71+ catalog refactorings
  • Dry-run change previews
  • Language-backend architecture
  • Code structure inspection
  • Code-smell analysis
  • TOON output format

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

13/13 checks healthy over the last 73d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 16h ago via OSV.dev · mcp-refactoring (PyPI)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars5Stargazers on the source repository.
Last commit1y agoMost recent push to the default branch.
Install checkInconclusiveDidn't respond in our test window — often a slow first install.

How Refactoring MCP Server works

What Refactoring MCP Server MCP server does

Refactoring MCP Server MCP server makes Martin Fowler's refactoring catalog available to MCP-compatible LLM clients. The project describes more than 71 refactorings across categories including composing methods, moving features, organizing data, simplifying conditionals, simplifying method calls, and dealing with generalization.

Ruby, Java, and Go are identified as planned backends. Refactoring targets can identify files, classes, methods, or line ranges using language-specific conventions.

How it works

The server communicates with an MCP client and delegates language-specific work to a configured backend. For Python, the example backend is molting, installed from the molting-cli package. A target such as src/order.py::Order::calculate_total#L10-L15 identifies a specific method and line range for an operation.

Operations are designed to support review before modification. Preview mode performs a dry run and shows the changes that a requested refactoring would make. Applying a refactoring then sends the requested operation to the code backend with its target and parameters.

Setup and configuration

Python 3.10 or newer is required. Install the server with uvx, pip, or pipx; the documented uvx mcp-refactoring command is the recommended installation path. Python users must also install a compatible backend, such as molting-cli.

Claude Desktop can launch the server with a configuration that uses uvx as the command and mcp-refactoring as its argument. Backend settings can be stored in ~/.mcp-refactoring/config.toml. The example enables the Python backend and disables the Ruby backend, while assigning each backend a command. The Python command and enabled state can also be overridden with MCP_REFACTORING_PYTHON_COMMAND and MCP_REFACTORING_PYTHON_ENABLED.

Tools and capabilities

The available tools are:

  • list_refactorings: returns refactorings and their parameter contracts, with optional language and category filters.
  • preview_refactoring: produces a dry-run view of a requested change.
  • apply_refactoring: applies a named refactoring to a target with supplied parameters.
  • inspect_structure: returns structural information for a path at a requested depth, such as methods.
  • analyze_code: checks code for specified smells and suggests refactorings.

The output format is TOON, which the project identifies as an optimization for LLM token use. Refactoring MCP Server MCP server therefore fits workflows where an agent needs discoverable operation contracts and a separate preview step before changing files.

Limitations and notes

The material documents Python support and a Python backend requirement; it does not document completed support for Ruby, Java, or Go. Backend availability and configuration determine whether a language can be processed. Applying a refactoring changes the codebase, so previewing the operation is the safer inspection step before execution.

The target syntax shown in the documentation is Python-specific, and the project notes that each language uses its native conventions. The repository also provides development commands for tests, linting, and type checking, but no additional client-specific setup is documented beyond Claude Desktop. Refactoring MCP Server MCP server should be evaluated against the capabilities of the selected language backend before use in an automated editing workflow.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Refactoring MCP Server

Refactoring MCP Server is an MCP server that connects LLM clients to language backends such as molting-cli for Python. Its main tools list refactorings, inspect code structure, analyze smells, preview changes, and apply named refactorings to files, classes, methods, or line ranges.

Install it with `uvx mcp-refactoring`, `pip install mcp-refactoring`, or `pipx install mcp-refactoring`. Python 3.10 or newer is required, and Python workflows also require a language backend such as `molting-cli`.

Use the `preview_refactoring` tool with the refactoring name, target, and parameters. It performs a dry run and shows the expected changes without applying them to the codebase.

Yes, Claude Desktop is documented as a supported client. Add an MCP server entry that launches `uvx` with `mcp-refactoring` as its argument, then configure any required language backend separately.

Ruby, Java, and Go are described as planned languages, not documented as completed backends.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewRefactoring MCP Server AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/refactoring-mcp-server?style=directory)](https://allmcps.com/mcp/refactoring-mcp-server)
HTML Embed
<a href="https://allmcps.com/mcp/refactoring-mcp-server"><img src="https://allmcps.com/api/badge/refactoring-mcp-server?style=directory" alt="Refactoring MCP Server on AllMCPs" /></a>