Download the PHP package dpt/mcp-rector-warm without Composer

On this page you can find all versions of the php package dpt/mcp-rector-warm. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package mcp-rector-warm

mcp-rector-warm

Stop paying Rector's cold-start tax on every edit. A warm-process MCP server that keeps the Rector container hot. ~9× faster per call. Works with every MCP client.

Tests Packagist PHP

FAQ


Why

Rector is one of the most useful tools in modern PHP — automated refactoring, type fixes, version upgrades. It is also one of the slowest to start.

Every rector process foo.php pays the same toll: autoloader bootstrap, DI container build, ruleset compile. ~3-5 seconds before a single rule fires. For agents and validators that run Rector after every edit, that cold-start cost dominates wall time.

mcp-rector-warm runs Rector inside a long-lived PHP process. First call pays the boot once. Every subsequent call reuses the live container.

Install

Makes mcp-rector-warm available on $PATH.

Requires PHP 8.2+. Pulls Rector ^2.4 as a real Composer dep (no phar gymnastics).

Use it

Claude Desktop

Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

Restart Claude. Ask: "Run Rector on src/Foo.php".

Cline / Continue / Cursor / Zed / any MCP client

Same command + args shape. The server speaks plain MCP over stdio — no client-specific glue.

Standalone

Reads MCP JSON-RPC on stdin, writes responses on stdout.

Benchmark

Measured on a real DVSI codebase (Rector config with 677 paths, ~50KB target file):

Setup Per-call wall Notes
Cold rector CLI ~4500ms autoloader + container + ruleset each time
mcp-rector-warm (warm) ~500ms container reused, opcache hot
Daemon cold boot ~3000ms paid once at server start

~9× faster per call. For a tool running Rector after 100 edits: 7.5 min → 50s.

Numbers vary with project size and rule set. The win is the cold-start amortization, not magic.

Compatibility

Client Status
Claude Desktop ✅ stdio MCP
Cline (VS Code) ✅ stdio MCP
Continue (VS Code / JetBrains) ✅ stdio MCP
Cursor ✅ stdio MCP
Zed ✅ stdio MCP
Custom (Python/Node/Go MCP clients) ✅ standard protocol

Any client that speaks MCP stdio works. No custom protocol.

Tools exposed

rector_process

Run Rector on a path.

Argument Type Default Description
path string required Absolute path to file or directory under the working dir
dryRun bool true Preview changes only. false writes them.

Returns:

warm_boot: true ⇒ container reused. false ⇒ first call (cold boot just finished).

How it works

Three decisions worth knowing:

  1. One daemon per project, not per call. Config + working dir pin at server startup. This keeps $_SERVER['argv'] clean for RectorConfigsResolver and lets the container cache across every call.

  2. Parallel mode forcibly disabled (--debug flag). Rector's worker fork model expects $_SERVER['argv'][0] to be the rector CLI binary. From an MCP server it isn't, so workers can't respawn. Single-thread analysis only — that's fine for the per-file edit loop this is designed for.

  3. Runtime-prefixed namespace handled. Rector's bundled Symfony is namespaced RectorPrefix<date>\\Symfony\\Component\\Console\\... to avoid dependency conflicts. The runner detects the prefix at boot and resolves Application/Input/Output class names dynamically. Survives Rector version bumps.

FAQ

Does this replace vendor/bin/rector? No. Use it from MCP clients (Claude Desktop, agents). For one-off CLI calls the regular binary is still simpler.

Does it support rector --fix? Yes — pass dryRun: false to apply changes.

Why not a phar? Rector ships as a real Composer library. Phar packaging would just add a runtime cost without a benefit here.

Memory? The daemon sets memory_limit = -1 like Rector's own CLI. Idle daemon ≈ 80MB resident.

Does it survive Rector version updates? Probably. The prefix-detection scheme is forward-compatible with new RectorPrefix<date> values. Pin a Rector version in your own composer.json if you need determinism.

Credits

Related

License

Community License — see Digital Process Tools.


All versions of mcp-rector-warm with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
mcp/sdk Version ^0.5
rector/rector Version ^2.0
symfony/finder Version ^7.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package dpt/mcp-rector-warm contains the following files

Loading the files please wait ...