Navigation
PHPocalypse-MCP: Automates Tests & Static Analysis - MCP Implementation

PHPocalypse-MCP: Automates Tests & Static Analysis

PHPocalypse-MCP: Automates tests & static analysis so vibe developers can code uninterrupted. No more setups – focus on building while we handle the tedious. Time saved, quality guaranteed.

Developer Tools
4.1(167 reviews)
250 saves
116 comments

86% of users reported increased productivity after just one week

About PHPocalypse-MCP

What is PHPocalypse-MCP: Automates Tests & Static Analysis?

PHPocalypse-MCP is an MCP server designed to streamline repetitive testing and static analysis workflows for PHP developers. By automating these critical processes, it empowers teams to focus on core development tasks while ensuring code quality. The tool acts as a bridge between your IDE and command-line tools, eliminating manual intervention for tasks like linting, unit tests, and type checking.

How to Use PHPocalypse-MCP: Automates Tests & Static Analysis?

Deployment requires three key steps:
1. Setup Environment: Ensure Node.js, npx, and TypeScript are installed.
2. Configure MCP: Edit your Cursor settings with the provided JSON snippet, substituting absolute paths to the repo and project config file.
3. Define Workflows: Create a phpocalypse-mcp.yaml file in your PHP project root to map tool names to execution commands.

PHPocalypse-MCP Features

Key Features of PHPocalypse-MCP: Automates Tests & Static Analysis?

  • Zero-Interaction Automation: Runs predefined PHP toolchains without requiring manual CLI input
  • Customizable Pipelines: Define arbitrary commands for tools like php-cs-fixer or phpstan through YAML configuration
  • Output Handling: Captures console outputs for tool responses, though large outputs may require model-specific workarounds
  • IDE Integration: Native support for Cursor IDE environments through MCP server architecture

Use Cases of PHPocalypse-MCP: Automates Tests & Static Analysis?

Common scenarios include:
Pre-Commit Checks: Automatically run php-cs-fixer to enforce coding standards before version control operations
Continuous Integration: Trigger unit tests via phpunit and static analysis with phpstan during pull requests
Debugging Assistance: Generate error reports for Behat scenarios without manual intervention by enforcing --no-interaction flags
Multi-Tool Workflows: Sequentially execute multiple analysis tools in a single command chain

PHPocalypse-MCP FAQ

FAQ from PHPocalypse-MCP: Automates Tests & Static Analysis?

Q: Does this support PHP 8.2?
A: Yes, as long as your configured tools are compatible with your PHP version

Q: How do I fix path resolution errors?
A: Use absolute paths in both the MCP config and YAML file. Verify paths using realpath() in terminal

Q: Why are some outputs truncated?
A: Large outputs may require using claude-3.7-sonnet or optimizing command outputs through filters like | head -n 50

Q: Can I schedule periodic checks?
A: Yes, combine with cronjobs or task runners to execute MCP workflows at defined intervals

Content

PHPocalypse-MCP

MCP server for vibe developers that are too busy to run tests and static analysis.

Prerequisites

  • You need to have node, npx and tsx installed

How to

  • First, git clone this repo to chosen directory

  • Run npm install

  • Next, open your Cursor settings and add the following MCP config:

    {
    "mcpServers": {
    "phpocalypse-mcp": {
    "command": "npx",
    "args": ["tsx", "/Absolute/Path/To/PHPocalypse-MCP/src/index.ts", "--config", "/Absolute/Path/To/Your/PHP/Based/Project/phpocalypse-mcp.yaml"]
    }
    }
    }

Make sure the paths are correct!

  • In your PHP project, create phpocalypse-mcp.yaml file

phpocalypse-mcp.yaml config

The structure is straightforward. Define the tools by giving them a name and a command to run.

tools:
  - name: php-cs-fixer
    command: make php-cs

  - name: php-stan
    command: /vendor/bin/phpstan analyse -c phpstan.neon --memory-limit=-1

  - name: tests-unit
    command: docker compose run --rm php ./vendor/bin/phpunit --testsuite=Unit

  - name: tests-behat
    command: task behat -- --no-interaction

Caveats

  • This MCP is just a proof of concept and it may not work in every case. One thing that will not work for sure is any interactive CLI input. A good example is behat, that - if not run in non-inteartvice mode - will prompt user with a question of whether to generate missing snippets. Make sure that your commands just run and output something meaningful and leave the rest to your favourite LLM.
  • Some bigger outputs are not handler correctly yet. To fix that, try to either use claude-3.7-sonnet or craft your commands to return less.

Related MCP Servers & Clients