
Refactoring MCP Server
io.github.marshallyPublished by GitHub account marshallyv0.1.2Updated Oct 24, 2026
MCP server exposing Martin Fowler's refactoring catalog to LLMs with 71+ refactorings
Overview
A local MCP server that exposes Martin Fowler's refactoring catalog, letting an assistant list, preview, apply and analyze code refactorings.
- What you can do
- List available refactorings with their parameter contracts, filtered by language and category, based on Martin Fowler's catalog of 71+ refactorings across composing methods, moving features, organizing data, conditionals, method calls and generalization. Preview what a refactoring would change as a dry run before applying it. Apply a refactoring to a codebase at a specified target such as a file, class, method or line range. Inspect the structure of code at file, class or method depth. Analyze code for smells and suggest refactorings.
- When to use it
- Useful when an assistant is asked to clean up or restructure Python code and you want it to work from a named, catalog-based set of refactorings with a preview step before changes are applied. Best suited to developers already using a supported language backend.
- Requirements
- Runs as a local process, typically launched with uvx or installed via pip or pipx. Needs Python 3.10+ and a language backend such as molting-cli for Python. Optional configuration in a config file or via environment variables such as MCP_REFACTORING_PYTHON_COMMAND and MCP_REFACTORING_PYTHON_ENABLED. No authentication declared.
Installation
In SourceWeft
- Open Refactoring MCP Server in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
mcp-refactoring
An MCP (Model Context Protocol) server that exposes Martin Fowler's refactoring catalog to LLMs through a pluggable, language-agnostic architecture.
Features
- 71+ Refactorings: Full implementation of Martin Fowler's refactoring catalog
- Pluggable Architecture: Support for multiple languages (Python first, Ruby/Java/Go planned)
- Safe by Default: Preview mode shows changes before applying
- LLM-Optimized: TOON output format for token efficiency
Installation
Requirements
- Python 3.10+
- A language backend (e.g.,
molting-clifor Python)
Install the Python backend:
Claude Desktop Configuration
Add to your Claude Desktop config:
Available Tools
list_refactorings
List available refactorings with their parameter contracts.
preview_refactoring
Preview what changes a refactoring would make (dry-run).
apply_refactoring
Apply a refactoring to the codebase.
inspect_structure
Get structural information about code.
analyze_code
Analyze code for smells and suggest refactorings.
Target Specification
Each language uses its native conventions:
Python
Configuration
Create ~/.mcp-refactoring/config.toml:
Environment variable overrides:
Refactoring Categories
Based on Martin Fowler's catalog:
- Composing Methods: extract-method, inline-method, etc.
- Moving Features: move-method, extract-class, etc.
- Organizing Data: encapsulate-field, replace-type-code, etc.
- Simplifying Conditionals: decompose-conditional, guard-clauses, etc.
- Simplifying Method Calls: rename-method, add-parameter, etc.
- Dealing with Generalization: pull-up-method, extract-interface, etc.
Development
License
MIT License - see LICENSE for details.
Source: README.md at commit 30d981a
Tools
0Version history
1- v0.1.2LatestSep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts