Transactional refactoring MCP with 11 evidence-backed tools, hash-bound previews, and rollback.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
We haven't yet run this listing's install command through our automated sandbox check. This isn't a red flag β we're steadily working through the catalog.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
Part of the Weavatrix ecosystem. This repository preserves the explicit JavaScript refactoring line.
This is the JavaScript refactoring engine of Weavatrix, continued as
weavatrix-refactor-js. Theweavatrix-refactorpackage ships the native Rust MCP host built on weavatrix-rust and theweavatrix-edit/weavatrix-refactor-plan/weavatrix-worktreecrates. This package continues that version line:weavatrix-refactor@0.1.5was the last JavaScript release under the old name, andweavatrix-refactor-js@0.1.6picks up from it. Installweavatrix-refactor-js, or pinweavatrix-refactor@0.1.5, to stay on the JavaScript implementation.
Evidence-backed, transactional refactoring for coding agents.
weavatrix-refactor-js is the write-capable member of the JavaScript family. It
combines the complete read-only weavatrix-js code-intelligence MCP with 11
refactoring tools that can prove a change, preview it against the current
working tree, apply it atomically, refresh the graph, and roll it back.
Engine boundary: this package hosts the
weavatrix-jsengine. It does not use the nativeweavatrix-rustengine, and installing both packages does not silently upgrade this one's analysis layer. Its state lives in~/.weavatrix-refactor-js, kept separate from the Rust host's so the two never share a lock, a token store, or a rollback journal.
It is substantially more than a rename wrapper:
before text, provenance, uncertainty, and graph revision in every applyable plan;The MIT weavatrix-js core is physically read-only: its published artifact has no
repository source-write path. This package is the explicit write
boundary. Installing it and selecting its refactor profile makes the edit
capability visible; without this package, the server cannot modify source.
The split is a safety property, not packaging cosmetics:
The implementation is a ports-and-adapters system with one-way boundaries:
weavatrix.edit-plan.v1 envelope and applies
byte-exact edits as pure string transformations.weavatrix-js catalog and exposes one stdio server.The checked-in strict architecture contract enforces zero runtime cycles, files no longer than 300 lines, and functions no longer than 100 lines. It has no exceptions or ratchet baseline.
An ordinary editor rename answers: "Which text edits should I make now?" Weavatrix Refactor also answers:
| Question | Evidence returned |
|---|---|
| Is this the exact symbol? | Stable graph symbol id plus parser/LSP selection range |
| Which references are proven? | Per-edit provenance: EXACT_LSP, RESOLVED, EXTRACTED, or LEXICAL_EXACT |
| What was not proven? | Explicit uncertainReferences, notModified, warnings, and PARTIAL completeness |
| Which files were even looked at? | The rename session seeds every graph-declared reference plus every indexed file whose text contains the identifier; anything it could not open is named and forces PARTIAL |
| Did the tree change after preview? | File sha256 plus exact before text rechecked under the write lock |
| Can several renames partially succeed? | No. Related renames are conflict-checked and applied as one transaction |
| What happens after a disk/write failure? | Already-written files are restored; a durable rollback bundle remains |
| Will a move worsen architecture? | Projected runtime cycles, boundary violations, improvements, and blast radius |
| Did the refactor preserve behavior-shaped structure? | Refreshed graph plus verified_change caller/import/reference conservation |
The system fails closed when proof is insufficient. It never upgrades an
INFERRED edge into an applyable edit and never hides an ambiguous reference.
rename_symbol and rename_related_symbols are complete operations, not
PLANNED-only helpers. Each method owns both phases.
Call the rename method normally:
The method computes the rename, validates every plan file against the working
tree, and returns PREVIEW_OK with a short-lived confirmToken. Preview never
writes source and does not require the environment write gate.
Repeat the same operation inputs and add the confirmation:
The tool recomputes the deterministic plan, verifies that the token belongs to
that plan and repository, takes the repository lock, rechecks hashes and
before text, writes a rollback bundle, and applies every edit bottom-up.
The same contract applies to a coordinated set:
rename_related_symbols detects overlapping edits, chains, swaps, shadowing
risk, and per-sub-rename failure before it issues a token. Apply is one atomic
multi-file operation.
| Tool | What it actually does |
|---|---|
rename_symbol | Cross-language preview/confirm/apply rename. Dispatches to exact JS/TS LSP, SQL schema, or strict graph+lexical backends; returns honest backend completeness and every uncovered reference. |
rename_related_symbols | Coordinates up to 50 JS/TS symbol renames in one shared language-server session and one atomic edit plan. Detects conflicts, chains, swaps, snapshot drift, and any failed sub-rename before writing. |
apply_edit_plan | Generic two-phase executor for weavatrix.edit-plan.v1 envelopes from the other tools or weavatrix-online. Preview issues a plan-bound token; apply writes atomically with rollback. |
rollback_last_apply | Restores the latest pre-apply bundle. Refuses if post-apply files drifted; retries converge after an incomplete restore. |
| Tool | What it actually does |
|---|---|
change_signature | Adds or removes a JS/TS function or method parameter. Performs byte-exact declaration and call-argument surgery; spread calls and value-requiring additions remain explicit uncertainty. |
edit_symbol | Uses the indexed parser range for replace_symbol_body, insert_before_symbol, or insert_after_symbol. JS/TS output is parse-gated; line endings and UTF-16 coordinates are preserved. |
bulk_replace | Two-stage, occurrence-selective replacement over indexed files. First returns stable occurrence ids; the second call accepts chosen ids or an exact expected count and emits a hash-bound plan. Literal mode is the default; regex replacements use real capture expansion. |
organize_imports | Removes only provably unused named JS/TS imports. Default and namespace imports stay uncertain; side-effect imports are untouched; sorting is deliberately left to the formatter. |
These plans are applied with apply_edit_plan, using the same preview, token,
atomic-write, and rollback protocol as rename.
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/weavatrix-refactor-js)<a href="https://allmcps.com/mcp/weavatrix-refactor-js"><img src="https://allmcps.com/api/badge/weavatrix-refactor-js?style=directory" alt="Weavatrix Refactor Js on AllMCPs" /></a>