
A directory listing describing a cancellation-letter and mailing-address service. The configured public GitHub repository returned 404 during source verification.

An MCP server offering regex-based code refactoring and search tools for coding agents, with an additional standalone CLI mode.
refactor-mcp is cataloged as an MCP server attributed to myuon. An MCP server offering regex-based code refactoring and search tools for coding agents, with an additional standalone CLI mode. It is categorized under developer tools. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.
Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.
Catalog license label: MIT. Check the source repository's current license and terms before using, modifying or distributing this software.
Capability definitions are not reviewed. Unreviewed imports are not exposed as trusted interfaces.
No reviewed records to display. This does not establish that upstream lacks this capability.
No reviewed records to display. This does not establish that upstream lacks this capability.
No reviewed records to display. This does not establish that upstream lacks this capability.
Email delivery is not connected. This page does not collect email addresses or create subscriptions.
Browse the registry for current listings instead.
Reviews for refactor-mcp are not available yet
Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.
Yes, the replacement pattern supports capture groups like $1 and $2.
Yes, a glob file pattern can limit which files are searched or refactored.
README.md · 32bac1b92a0a · Fetched 2026-11-13 09:09:18 UTC
Original upstream text, without AI rewriting. Scripts, forms and unsafe links are filtered for safety.
Showing the last retrieved documentation snapshot; check the source for current changes.
A Model Context Protocol (MCP) server that provides powerful refactoring tools for Coding Agents. It can run in two modes:
This MCP server implements two main tools to assist with code refactoring:
Performs regex-based search and replace operations across files with advanced filtering capabilities.
Parameters:
search_pattern (string) - Regular expression pattern to search forreplace_pattern (string) - Replacement pattern (supports capture groups like $1, $2)context_pattern (string, optional) - Only replace matches within this contextfile_pattern (string, optional) - Glob pattern to limit files (e.g., *.js, src/**/*.ts)Example:
// Replace foo() calls with bar() calls
code_refactor("foo\\((.+)\\)", "bar($1)")
// Before: let k = foo(1,2,3);
// After: let k = bar(1,2,3);
Context-aware refactoring:
// Only replace "legacy_sdk" within import statements
code_refactor("legacy_sdk", "brand_new_sdk", "import")
Searches for regex patterns and returns file locations with precise line numbers.
Parameters:
search_pattern (string) - Regular expression pattern to search forcontext_pattern (string, optional) - Filter matches by surrounding contextfile_pattern (string, optional) - Glob pattern to limit search scopeExample:
code_search("foo\\(.+\\)")
// Result:
// ./src/utils.js (line: 15)
// ./src/helpers.ts (lines: 23-27)
MCP Server Mode (for Claude Code and other MCP clients):
# Install globally for MCP integration
npm install -g @myuon/refactor-mcp
# Or use with npx (recommended for MCP clients)
npx @myuon/refactor-mcp@latest
CLI Mode (for direct command-line usage):
# Search for patterns
npx @myuon/refactor-mcp@latest cli search -p "function.*\(" -f "src/**/*.js"
# Refactor with preview
npx @myuon/refactor-mcp@latest cli refactor -s "const (\w+)" -r "let \$1" --dry-run
# Clone and install dependencies
git clone https://github.com/myuon/refactor-mcp.git
cd refactor-mcp
npm install
You can use the refactor tools directly from the command line by adding cli after the main command:
# Search for patterns
refactor-mcp cli search -p "function (.*) \{" -f "src/**/*.ts"
# Search with matched content display
refactor-mcp cli search -p "function (.*) \{" -f "src/**/*.ts" --print
# Refactor with dry-run (preview changes)
refactor-mcp cli refactor -s "const (\w+) = " -r "let \$1 = " --dry-run
# Refactor with matched content display
refactor-mcp cli refactor -s "const (\w+) = " -r "let \$1 = " --print --dry-run
# Refactor with file pattern
refactor-mcp cli refactor -s "old_function" -r "new_function" -f "src/**/*.js"
# Context-aware refactoring
refactor-mcp cli refactor -s "legacy_sdk" -r "new_sdk" -c "import" -f "src/**/*.ts"
CLI Commands:
search - Search for code patterns
-p, --pattern <pattern> - Regular expression pattern to search for-c, --context <context> - Optional context pattern to filter matches-f, --files <files> - Optional file glob pattern to limit search scope--print - Print matched content to stdout--matched - Show only matched text with capture groupsrefactor - Refactor code with regex replacement
-s, --search <search> - Regular expression pattern to search for-r, --replace <replace> - Replacement pattern (supports $1, $2, etc.)-c, --context <context> - Optional context pattern to filter matches-f, --files <files> - Optional file glob pattern to limit search scope--dry-run - Preview changes without modifying files--print - Print matched content and replacements to stdoutImportant Notes:
\$1, \$2, etc.refactor-mcp cli refactor -s "const (\w+) = " -r "let \$1 = " --dry-run$1 as a shell variableBy default, refactor-mcp runs as an MCP server via stdio transport:
# Run as MCP server (default mode)
refactor-mcp
# Or explicitly with npx
npx @myuon/refactor-mcp@latest
npm run dev # Run server in development mode
npm run dev:cli # Run CLI in development mode with arguments
npm run cli # Run CLI directly (for testing)
npm run build # Build for production
npm start # Run built server (MCP mode)
npm run check # Run all quality checks
npm run lint # Run ESLint
npm run format # Format code with Prettier
npm test # Run tests
This server uses the Model Context Protocol to communicate with compatible clients. It runs via stdio transport and can be integrated into any MCP-compatible environment.
For Claude Code users, you can easily add this MCP server with:
claude mcp add refactor npx @myuon/refactor-mcp@latest
Add to your MCP client configuration:
{
"mcpServers": {
"refactor-mcp": {
"command": "npx",
"args": ["@myuon/refactor-mcp@latest"]
}
}
}
{
"mcpServers": {
"refactor-mcp": {
"command": "refactor-mcp"
}
}
}
npm installnpm testnpm run checknpm run buildMIT
Claim this server with your GitHub account to request manual ownership verification.
Link to the catalog listing for refactor-mcp from your README. This badge does not certify ownership, compatibility or security.
[](https://awesome-mcp.com/servers/refactor)Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.
Separate sources, scopes and periods. Never combined or treated as installations, active users or security reviews.
No reviewed package or image identity; download statistics are not listed yet.
Alternative and complementary servers in the same category

A directory listing describing a cancellation-letter and mailing-address service. The configured public GitHub repository returned 404 during source verification.

A hosted MCP service for browsing and searching through Singapore mobile-network proxies.

A directory listing describing a Markdown-to-PDF service. The configured public GitHub repository returned 404 during source verification.