Skip to content
MCP server

Weavatrix Refactor

Transactional refactoring for coding agents: previews, apply gate and rollback

Runs locallyStatus and history
Install
Pricing
Open source
Platforms
CLI, self-hosted
Runs
Locally
Version
1.0.16
Listing updated
3 days ago

About Weavatrix Refactor

Weavatrix Refactor is an open-source MCP server for developer tools. It runs locally on your machine and is started by your AI client.

Refactor is the write-capable member of the Weavatrix family, installed separately and composing the read-only Core. It adds evidence-backed plans, write-gated apply and drift-checked rollback. The registry counts 12 tools; the site describes 11 MCP methods.

By default it is preview-only. Previews are byte-exact and report every same-named occurrence the tool could not safely change. Applying or rolling back needs WEAVATRIX_ALLOW_SOURCE_EDITS=1 and a single-use token bound to the exact preview, so a token from one child process does not work in another.

A rename profile exposes only rename_symbol and rollback_last_apply, which the site says cuts fixed MCP context from 9,331 to 485 measured tokens. The profile narrows context but does not grant write authority. The package is MIT licensed on npm.

Install

Run in a terminal

claude mcp add weavatrix-refactor -- npx -y weavatrix-refactor

Add to claude_desktop_config.json

{
  "mcpServers": {
    "weavatrix-refactor": {
      "command": "npx",
      "args": [
        "-y",
        "weavatrix-refactor"
      ]
    }
  }
}
Install in CursorOpens Cursor, which asks you to confirm. Or add it by hand:

Add to ~/.cursor/mcp.json

{
  "mcpServers": {
    "weavatrix-refactor": {
      "command": "npx",
      "args": [
        "-y",
        "weavatrix-refactor"
      ]
    }
  }
}
Install in VS CodeOpens VS Code, which asks you to confirm. Or add it by hand:

Add to .vscode/mcp.json

{
  "servers": {
    "weavatrix-refactor": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "weavatrix-refactor"
      ]
    }
  }
}

Add to ~/.codeium/windsurf/mcp_config.json

{
  "mcpServers": {
    "weavatrix-refactor": {
      "command": "npx",
      "args": [
        "-y",
        "weavatrix-refactor"
      ]
    }
  }
}

Add to your client's MCP settings (most use this shape)

{
  "mcpServers": {
    "weavatrix-refactor": {
      "command": "npx",
      "args": [
        "-y",
        "weavatrix-refactor"
      ]
    }
  }
}

Configuration

  • WEAVATRIX_ALLOW_SOURCE_EDITSSet to 1 to authorize confirmed apply operations and rollback to write source files; unset, the refactor tools stay preview-only

Tools this server provides (2)

Taken from the project documentation; the running server may differ.

rename_symbol
Renames a symbol using an evidence-backed plan.
rollback_last_apply
Rolls back the last applied refactor, checking for drift.

What it does

Preview first
Byte-exact previews before any write.
Write gate
Edits need an environment flag and a plan-bound token.
Drift-checked rollback
Undo the last apply.
Rename profile
Expose only two tools for rename tasks.
Unsafe-match report
Lists same-named occurrences it left alone.

Good for

  • Rename a symbol across a codebase with a reviewed preview
  • Roll back an agent's last refactor
  • Limit an agent to preview-only changes
  • Keep tool context small for a single task

Pricing

Open source

MIT licensed

Prices change. Check weavatrix.com before you buy.

Weavatrix Refactor FAQ

Can it edit files by default?

No. It stays preview-only until WEAVATRIX_ALLOW_SOURCE_EDITS is set to 1.

What does the rename profile do?

It exposes only rename_symbol and rollback_last_apply.

Does the profile grant write access?

No, it only narrows what the agent sees.

Is it MIT?

The site lists Refactor among MIT packages.

Is Weavatrix Refactor free?

Yes. Weavatrix Refactor is open source, so you can use and self-host it for free.

How do I add Weavatrix Refactor to Claude Code?

Run this command in your terminal: claude mcp add weavatrix-refactor -- npx -y weavatrix-refactor

What are the best alternatives to Weavatrix Refactor?

The closest alternatives to Weavatrix Refactor are REA, Codebase Memory, GitHub, Serena MCP: the IDE for your agent and XERJ.

Alternatives to Weavatrix Refactor

  1. REA

    MCP server

    CLI and MCP server that lets coding agents reverse engineer apps and binaries

    Runs locally
    • Open source
    • 464K GitHub stars
    • Developer tools
  2. Codebase Memory

    MCP server

    Local MCP server that builds a code knowledge graph for AI coding agents

    Runs locally
    • Open source
    • 48.7K GitHub stars
    • Knowledge and memory
  3. GitHub

    MCP server

    Official MCP server connecting AI assistants to GitHub repos, issues and workflows

    Not checked yet
    • Remote
    • Open source
    • 34.5K GitHub stars
    • Developer tools
  4. MCP toolkit giving coding agents symbol-level code retrieval and editing

    Runs locally
    • Open source
    • 31.5K GitHub stars
    • Developer tools
  5. XERJ

    MCP server

    Local search engine for AI agents with cited answers over your code and docs

    Runs locally
    • Open source
    • 19.2K GitHub stars
    • Knowledge and memory
  6. Ouroboros

    MCP server

    Spec-first layer that pins requirements and verifies results of AI coding agent work

    Runs locally
    • Open source
    • 6.4K GitHub stars
    • Developer tools