code_refactor
Refactor code by replacing search pattern with replace pattern using regex
Regex search and replace across a codebase, with a context filter so a mechanical rename only fires where you meant it to.
LABSCO SUMMARY
A bare regex rename hits every occurrence in the repository, including the ones in comments and strings you did not think about. Constraining the match to a surrounding context, or to a file glob, is what makes the rewrite safe. Search first with the matched text included, read what came back, then run the replacement.
Two tools — find a pattern, replace a pattern — with scoping that keeps a repo-wide regex from doing repo-wide damage.
Nothing to authorize. Run it over stdio with npx @myuon/refactor-mcp@latest, or install @myuon/refactor-mcp globally. The same binary doubles as a CLI — put cli after the command to search or refactor from a terminal, where a dry run shows the changes before anything is written. One shell caveat there: escape the dollar sign in capture groups so the shell does not expand them before the tool sees them.
One command — npx @myuon/refactor-mcp@latest
USE CASES
Search the tree and get file paths with line numbers back.
Confirm the matches first, then replace with capture groups carried through.
Constrain the replacement to matches inside import statements.
Scope the file glob so nothing outside that path is rewritten.
Search with the matched text and capture groups included and read them before committing to a change.
Counted once with only startup setup. Other versions, modes or optional credentials may expose a different list.
code_refactorRefactor code by replacing search pattern with replace pattern using regex
code_searchSearch for code patterns using regex and return file locations with line numbers
BEFORE YOU INSTALL
2 tools when we connected.
npx on PATH
CONTEXT COST
Rated by the size of the 2 tool definitions that ride along on every turn, not by how many there are
INSTALLATION
npx @myuon/refactor-mcp@latestclaude mcp add refactor npx @myuon/refactor-mcp@latest