mcp-phpcs-server MCP Server

A Model Context Protocol server that brings PHP_CodeSniffer into your AI coding workflow — lint PHP against your coding standard and auto-fix violations, straight from any MCP client.

Local serverstdio

What is the mcp-phpcs-server MCP Server?

mcp-phpcs-server is an MCP project maintained in the larspohlmann/mcp-phpcs-server repository. The maintainer describes its purpose as “A Model Context Protocol server that brings PHP_CodeSniffer into your AI coding workflow — lint PHP against your coding standard and auto-fix violations, straight from…”. Read the project documentation for the complete scope.

Local setup

The project provides a local client configuration using /absolute/path/to/mcp-phpcs-server/bin/mcp-phpcs. Follow the repository’s build and installation steps before copying it, and replace example paths with the paths on your own computer.

Configuration values

The example declares MCP_PHPCS_PATH, MCP_PHPCBF_PATH, MCP_PHPCS_RULESET. Secret-looking values have been replaced with placeholders. Required and optional labels are shown only when the documentation states them.

Source

Project documentation · Repository · Discovery listing. This profile records the public documentation checked on 2026-10-08.

Recorded tools

Check the linked publisher documentation and your connected client's tool list. Names and availability can vary with the server version and account permissions.

ToolWhat it does
phpcs_checkRuns PHP_CodeSniffer against a file or directory and returns a readable report of violations.
phpcbf_fixRuns PHP Code Beautifier and Fixer (phpcbf) to automatically fix fixable violations.

How to install the mcp-phpcs-server MCP Server

{
  "mcpServers": {
    "phpcs": {
      "command": "/absolute/path/to/mcp-phpcs-server/bin/mcp-phpcs",
      "env": {
        "MCP_PHPCS_PATH": "/usr/local/bin/phpcs",
        "MCP_PHPCBF_PATH": "/usr/local/bin/phpcbf",
        "MCP_PHPCS_RULESET": "/path/to/your/phpcs.xml"
      }
    }
  }
}

From the project documentation. Replace placeholders and example paths before connecting.

Configuration

VariableDescriptionRequired
MCP_PHPCS_PATHDeclared in the maintainer’s client configuration.Check documentation
MCP_PHPCBF_PATHDeclared in the maintainer’s client configuration.Check documentation
MCP_PHPCS_RULESETDeclared in the maintainer’s client configuration.Check documentation