RefactorMCP

by dave-hillier

Not rated
GitHub

About

Automated refactoring tools for C# code transformation using Roslyn.

Details

Author
dave-hillier
Categories
Developer Tools

Setup

Install RefactorMCP in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/dave-hillier/refactor-mcp

Follow the installation instructions in the repository README, then restart your MCP client.

RefactorMCP is a Model Context Protocol server that exposes Roslyn-based refactoring tools for C#.

Run the console application directly or host it as an MCP server:

dotnet run --project RefactorMCP.ConsoleApp

- Extract Method– create a new method from selected code and replace the original with a call (expression-bodied methods are not supported).
- Introduce Field/Parameter/Variable– turn expressions into new members; fails if a field already exists.
- Convert to Static– make instance methods static using parameters or an instance argument.
- Move Static Method– relocate a static method and keep a wrapper in the original class.
- Move Instance Method– move one or more instance methods to another class and delegate from the source. If a moved method no longer accesses instance members, it is made static automatically. Provide amethodNameslist along with optionalconstructor-injectionsandparameter-injectionsto control dependencies.
- Move Multiple Methods (instance)– move several methods and keep them as instance members of the target class. The source instance is injected via the constructor when required.
- Move Multiple Methods (static)– move multiple methods and convert them to static, adding athisparameter.
- Make Static Then Move– convert an instance method to static and relocate it to another class in one step.
- Move Type to Separate File– move a top-level type into its own file named after the type.
- Make Field Readonly– move initialization into constructors and mark the field readonly.
- Transform Setter to Init– convert property setters to init-only and initialize in constructors.
- Constructor Injection– convert method parameters to constructor-injected fields or properties.
- Safe Delete– remove fields or variables only after dependency checks.
- Extract Class– create a new class from selected members and compose it with the original.
- Inline Method– replace calls with the method body and delete the original.
- Extract Decorator– create a decorator class that delegates to an existing method.
- Create Adapter– generate an adapter class wrapping an existing method.
- Add Observer– introduce an event and raise it from a method.
- Use Interface– change a method parameter type to one of its implemented interfaces.
- List Tools– display all available refactoring tools as kebab-case names.

Metrics and summaries are also available via themetrics://andsummary://resource schemes.

- Rundotnet testto ensure all tests pass.
- Format the code withdotnet formatbefore opening a pull request.

Licensed under theMozilla Public License 2.0.

This is a web browser that enables your coding agent, such as Claude Code, to visit websites on your behalf and assist you in identifying bugs or creating UI test cases.

AI-to-AI code review platform — Claude, Codex, and Gemini cross-check each other via MCP, REST API, and CLI for consensus-based results.

A stateful LSP runtime for AI agents: warm language server sessions with 50+ tools for go-to-definition, find-references, diagnostics, rename, and more across 30+ languages.

Persistent code index using Tree-sitter for fast, precise code search. Replaces grep with ~50 token responses instead of 2000+.

Orchestrates a dual-AI engineering loop where a Primary AI plans and implements, while a Review AI validates and reviews, with continuous feedback for optimal code quality. Supports custom AI pairing (Claude, Codex, Gemini, etc.)

AmazingMCP — MCP Server for .NET / C# Codebases

An MCP server that gives AI agents deep understanding of C# codebases via Roslyn — type search, dependency graphs, usage analysis, and architecture overviews, all from a live in-memory compilation.

A platform-agnostic code analysis library with semantic search capabilities and MCP server support.

Enforce consistent C++ style and best practices across your codebase. Analyze naming conventions, memory safety, and const correctness, and get actionable modernization suggestions up to C++23. Accelerate reviews with ready-made prompts and quick access to curated guidelines.

AI-Safe Code Analysis with 113+ MCP tools for guard validation, memory, workflow, and testing.

A Rust-based CLI tool for code-related tasks, operating as an MCP server.

Provides AI assistants with a comprehensive, one-time analysis for complete codebase context and understanding.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.