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

On this page you can find all versions of the php package dpt/mcp-phpstan-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-phpstan-warm

mcp-phpstan-warm

Stop paying PHPStan's cold-start tax on every edit. A warm-process MCP server that keeps a PHPStan worker alive via its built-in TCP worker protocol. Works with every MCP client.

Tests Packagist PHP

FAQ


Why

PHPStan is one of the most useful tools in modern PHP — static analysis, type inference, dead code detection. It is also slow to start.

Every phpstan analyse foo.php pays the same toll: bootstrap, config parse, autoloader load, rule compilation. 1-3 seconds before a single check runs. For agents and validators that run PHPStan after every edit, that cold-start cost dominates wall time.

mcp-phpstan-warm uses PHPStan's own built-in worker subcommand — the same TCP worker protocol PHPStan uses internally for parallel analysis. First call boots the worker once. Every subsequent call reuses the live process.

Install

Makes mcp-phpstan-warm available on $PATH.

Requires PHP 8.2+. PHPStan ^2.0 is pulled as a real Composer dependency.

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 PHPStan 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.

Tools exposed

phpstan_analyse

Analyse a PHP file with PHPStan.

Argument Type Required Description
path string yes Absolute path to the PHP file to analyse

Important: The file must be under one of the --paths declared at startup. PHPStan's worker fixes its analysed file set at boot — files outside that set will be rejected by the worker.

Returns:

How it works

PHPStan ships a worker subcommand used internally for parallel analysis. It connects to a TCP server you open, sends a hello handshake, then waits for {"action":"analyse","files":[...]} requests and replies with {"action":"result","result":{errors,...}}.

mcp-phpstan-warm is that TCP server:

Three things worth knowing:

  1. We are the TCP server, PHPStan is the client. stream_socket_server('tcp://127.0.0.1:0') opens on a random port; we pass it to phpstan worker --port=<N>. The worker dials us.

  2. The analysed file set is fixed at boot. PHPStan's worker builds its dependency graph from the <paths> passed on the command line. Files outside those paths will fail or return dependency errors at analysis time. Pass all relevant paths via --paths=src,tests at startup.

  3. Worker death is handled transparently. If proc_get_status() shows the worker died, the next phpstan_analyse call respawns it. The warm_boot: false flag in the response signals this happened.

FAQ

Does this replace vendor/bin/phpstan? No. Use it from MCP clients. For one-off CLI runs the regular binary is simpler.

Can I analyse multiple files at once? The current tool accepts one file per call. The underlying protocol supports "files":[...] arrays — multi-file support can be added as a separate tool.

Memory? The daemon sets memory_limit = -1. Idle worker ≈ 60-80MB resident depending on project size and PHPStan level.

Are ignoreErrors from my neon respected? Yes. At worker boot the daemon runs phpstan dump-parameters --json once to extract the project's ignoreErrors list and caches it. Every phpstan_analyse call filters worker results through that list — by identifier, message regex, or path glob — before returning errors to the MCP client. The output matches what phpstan analyse would show on the same file.

Does it survive PHPStan version updates? The TCP protocol (hello / analyse / result) is PHPStan's internal parallel transport — it's stable across patch versions. Pin a PHPStan version in your composer.json if you need determinism.

Why not just subprocess phpstan analyse and cache the result? You could. But you'd still pay the full cold-start on every cache miss (every new or modified file). The worker mode amortises that cost across the entire session.

Credits

Related

License

Community License — see Digital Process Tools.


All versions of mcp-phpstan-warm with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
mcp/sdk Version ^0.5
phpstan/phpstan 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-phpstan-warm contains the following files

Loading the files please wait ...