# Refactoring MCP Server [Health: Active]

**Category:** 💻 Developer Tools  
**Repository:** https://github.com/marshally/mcp-refactoring.git  
**GitHub Stars:** 5  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/refactoring-mcp-server

## Description
MCP server exposing Martin Fowler's refactoring catalog to LLMs with 71+ refactorings

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `uvx` (confidence: high):

```json
"mcpServers": {
  "refactoring-mcp-server": {
    "command": "uvx",
    "args": ["mcp-refactoring"],
    "env": {
      "MCP_REFACTORING_PYTHON_COMMAND": "",
      "MCP_REFACTORING_PYTHON_ENABLED": ""
    }
  }
}
```

**Requires environment variables:** `MCP_REFACTORING_PYTHON_COMMAND`, `MCP_REFACTORING_PYTHON_ENABLED` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## 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.

_Full upstream README: https://allmcps.com/mcp/refactoring-mcp-server/readme_

