Weavatrix Refactor logo

Weavatrix Refactor

Evidence-backed cross-file refactoring with preview plans, hash checks, explicit applies, and rollback.

Install Weavatrix Refactor

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "weavatrix-refactor": {
      "command": "npx",
      "args": [
        "-y",
        "weavatrix-refactor"
      ],
      "env": {
        "WEAVATRIX_ALLOW_SOURCE_EDITS": "YOUR_VALUE_HERE"
      }
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Values are written into the snippet above so you can paste it as is. They never leave your browser.

We couldn’t confirm it starts correctly

We ran the install command but it didn't respond within our test window — this can mean a slow first-time install rather than a real problem.

npx -y weavatrix-refactor

Process exited before answering initialize.

This is an experimental automated check and can have false negatives — missing environment variables, a slow cold install, etc. It doesn’t necessarily mean something’s wrong. Last checked .

Overview

The weavatrix-refactor MCP server provides an evidence-backed source-write layer for repository refactoring. It uses a repository graph to locate symbols, generate byte-exact edit plans, identify uncertain references, and apply changes only after hash-bound confirmation. Use it when an agent needs controlled renames or other refactoring operations across files, with rollback and drift checks. It runs as a native stdio MCP server against one launch-time repository root.

Use cases

  • Preview a cross-file symbol rename
  • Apply a reviewed edit plan
  • Check uncertain references before refactoring
  • Rollback the latest source transaction
  • Limit an agent to rename operations

Key features

  • Evidence-backed symbol refactoring
  • Byte-exact preview plans
  • Hash-bound confirmation tokens
  • Drift-safe rollback
  • Rename-focused MCP profile
  • Advisory move and deletion analysis

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

17/17 checks healthy over the last 80d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 6d ago via OSV.dev · weavatrix-refactor (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars1Stargazers on the source repository.
npm downloads1.6kPackage downloads in the last 30 days.
Last commit14d agoMost recent push to the default branch.
Install checkInconclusiveDidn't respond in our test window — often a slow first install.

How Weavatrix Refactor works

What the weavatrix-refactor MCP server does

The weavatrix-refactor MCP server adds controlled source editing to the Weavatrix ecosystem, whose Core component remains read-only. It works against a repository supplied at launch and uses the Rust Weavatrix graph internally to gather evidence for refactoring operations.

Its main workflow is preview first, then apply. A request can return an edit plan, file content hashes, the number of edits proven by the backend, and any references that require human review. An apply request must repeat the operation with the short-lived confirmation token associated with that exact plan.

How it works

The server exposes 11 Refactor methods. A bare symbol name that matches multiple declarations is rejected with candidate symbol identifiers rather than resolved arbitrarily. Once a specific symbol is selected, the server calculates the proposed changes and reports whether the result is complete or partial.

Every planned file carries a content hash. If the working tree changes before application, the old preview is considered stale and is not used. Applying source edits also requires the WEAVATRIX_ALLOW_SOURCE_EDITS=1 gate and the plan's single-use token. Multi-file changes are journaled so a crashed transaction can be recovered, although unrelated processes may briefly observe an intermediate filesystem state.

The weavatrix-refactor MCP server does not expose Weavatrix Core's read-only methods. Install Core separately when repository intelligence beyond these refactoring methods is needed.

Setup and configuration

Run the native server through npm with an absolute repository path:

Terminal
npx -y weavatrix-refactor mcp /absolute/path/to/repository

Cargo installation is also supported:

bash
cargo install weavatrix-refactor --locked
weavatrix-refactor mcp /absolute/path/to/repository

For MCP configuration, provide the executable command and repository path. ${workspaceFolder} can be used with Cursor. Leave WEAVATRIX_ALLOW_SOURCE_EDITS unset for preview-only operation; confirmed applies and rollbacks require it to be set to 1.

The default refactor profile exposes all 11 methods. The rename profile exposes only rename_symbol and rollback_last_apply, which can reduce the tool catalog for rename-focused agents. The removed full profile is not supported.

A bundled plugin is available for Cursor, Codex, Claude Code, and Grok Build. Its installation uses each client's marketplace process and starts the extension-only profile.

Tools and capabilities

The supported methods fall into four groups:

  • rename_symbol and rename_related_symbols: produce plans and support confirmed application.
  • change_signature, edit_symbol, bulk_replace, organize_imports, and move_file: produce byte-exact edits or review plans; returned edit-plan envelopes can be passed to apply_edit_plan.
  • move_symbol and delete_readiness: provide advisory impact, architecture, cycle, or deletion information without automatically writing source.
  • apply_edit_plan and rollback_last_apply: verify or apply edit-plan envelopes and restore the latest transaction when drift checks pass.

The rename workflow can preserve unrelated longer identifiers, strings, comments, and shadowed symbols when the backend cannot prove they are targets. Such cases are reported rather than silently changed.

Limitations and notes

A PARTIAL result means the server proved the edits in its plan but did not prove that no other semantic references exist. Its lexical or graph-based backend is intentionally more conservative than a language server and does not claim complete compiler semantics.

Rollback refuses to overwrite files that changed after the transaction. The server also does not silently retarget another repository during a session: the launch root is the repository it can edit. The write gate, confirmation token, exact plan, and hash checks remain in force even when the narrower rename profile is used.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Weavatrix Refactor

weavatrix-refactor is an MCP server that connects coding agents to a single repository and provides controlled refactoring tools, including symbol renames, signature changes, symbol edits, import organization, file moves, edit-plan application, and rollback. It previews byte-exact changes and requires confirmation before source writes.

Install it with `npx -y weavatrix-refactor mcp /absolute/path/to/repository` or with Cargo using `cargo install weavatrix-refactor --locked`. Then configure the native command in your MCP client with the repository path as an argument.

Yes, weavatrix-refactor works with Cursor as a native MCP server and has a bundled Cursor plugin. Use an absolute repository path or Cursor's `${workspaceFolder}` value, and set `WEAVATRIX_ALLOW_SOURCE_EDITS=1` only when confirmed writes or rollback are needed.

Leave `WEAVATRIX_ALLOW_SOURCE_EDITS` unset. The server can generate previews without the variable, while applying a confirmed edit or performing a rollback requires the variable to equal `1`.

No, it does not choose among multiple matching symbols. The server returns candidate symbol IDs, and the agent must retry with the intended ID before it can produce a rename plan.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewWeavatrix Refactor AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/weavatrix-refactor?style=directory)](https://allmcps.com/mcp/weavatrix-refactor)
HTML Embed
<a href="https://allmcps.com/mcp/weavatrix-refactor"><img src="https://allmcps.com/api/badge/weavatrix-refactor?style=directory" alt="Weavatrix Refactor on AllMCPs" /></a>