aicoolies logo
Mago logo
Mago logo

Mago

Blazing-fast PHP linter, formatter, and static analyzer in Rust

open sourceupdated Jul 8, 2026

Mago is a comprehensive PHP toolchain written in Rust that unifies linting, formatting, and static analysis into a single binary. It enforces PER-CS formatting standards, catches code smells with 100+ lint rules, and performs deep type inference for semantic analysis. Inspired by Clippy and OXC from the Rust ecosystem, it delivers performance orders of magnitude faster than PHPStan and Psalm while requiring no PHP runtime to execute.

Mago reimagines PHP development tooling by combining three traditionally separate tools into a single Rust-powered binary. The formatter takes a parse-and-reprint approach inspired by Prettier and rustfmt, parsing PHP code into an AST, discarding original formatting entirely, and reprinting according to PER-CS compliant rules. This guarantees 100 percent consistent output regardless of input style, ending code formatting debates across teams with a single command that never alters runtime behavior.

The linter operates at the structural level with over 100 rules for identifying code smells, redundant patterns, and outdated syntax. It sits between the parser and the analyzer in the processing pipeline, catching issues that relate to how code is written rather than what it does. The semantic checker validates PHP version compatibility and catches syntax that the tolerant parser accepts but the PHP runtime would reject, making it a faster and more capable replacement for php -l validation in CI pipelines.

The static analyzer goes deeper by building a semantic understanding of the entire codebase with type inference, property initialization checking, and exception flow analysis. It identifies logical impossibilities like calling methods that do not exist on inferred types, accessing properties before initialization, and unchecked exception propagation. An architectural guard component validates module boundaries and coding standards at the project structure level, preventing dependency violations that accumulate over time in large PHP codebases.

Pricing

Free and open source under MIT License

Platforms

CLI on macOS, Linux, Windows — no PHP required

Categories

Tags

Use Cases

Knip logo

Knip

Find unused files, dependencies, and exports in JavaScript and TypeScript projects

Knip is an open-source CLI tool that detects unused files, dependencies, devDependencies, and exports in JavaScript and TypeScript codebases. It analyzes the full dependency graph to identify dead code that accumulates over time — especially relevant for AI-generated codebases where unused artifacts pile up faster than manual cleanup can handle. With over 10,800 GitHub stars, it has become a standard code hygiene tool in the JS/TS ecosystem.

Open Source
Floci logo

Floci

Free open-source local AWS emulator as a drop-in LocalStack replacement

Floci is a free open-source AWS emulator designed as a lightweight drop-in replacement for LocalStack Community Edition. It runs on port 4566 with the same endpoint conventions, supporting S3, SQS, DynamoDB, RDS, ElastiCache, API Gateway, Cognito, IAM, and twenty-plus other services. The Docker image is ninety megabytes versus LocalStack's one gigabyte and starts in twenty-four milliseconds.

Open Source
SWE-bench logo

SWE-bench

Benchmark for evaluating AI coding agents on real GitHub issues

SWE-bench is a benchmark from Princeton NLP that evaluates AI coding agents by testing their ability to resolve real GitHub issues from popular open-source projects. Each task provides an issue description and repository state, and the agent must produce a working patch that passes the project's test suite. With 4,600+ GitHub stars, it has become the standard yardstick for comparing autonomous coding tools like Devin, Claude Code, and OpenHands.

Open Source

Related Tools

computed discovery: shared active categories · kept separate from editor-verified Alternatives

MCPJam logo

MCPJam Inspector

Test and debug MCP servers before they ship

Open-source platform for inspecting, debugging and regression-testing MCP servers, MCP Apps and ChatGPT apps, with OAuth and protocol conformance for local and CI workflows.

freemiumOpen SourceTelemetry
MCP for Unity logo

MCP for Unity

Open-source MCP bridge between AI assistants and the Unity Editor

MCP for Unity is CoplayDev’s MIT-licensed bridge between MCP-compatible AI assistants and the Unity Editor. It exposes tools for assets, scenes, GameObjects, scripts, tests, profiling, and build-oriented workflows. The community project supports Unity 2021.3 LTS through 6.x and is explicitly not affiliated with Unity Technologies.

Open Source
XcodeBuildMCP logo

XcodeBuildMCP

Sentry-maintained MCP server and CLI for Xcode builds, simulators, and tests

XcodeBuildMCP is a Sentry-maintained, MIT-licensed MCP server and CLI for agent-assisted iOS and macOS development. It lets MCP-compatible coding agents run Xcode build and test workflows, manage simulators, inspect failures, and work through Homebrew, npm, or on-demand client configuration, with documented Sentry telemetry controls for teams that need an opt-out.

Open SourceTelemetry
iFixAi logo

iFixAi

Open-source diagnostic for AI operational misalignment

iFixAi is an Apache-2.0 diagnostic tool for scoring AI agents and models against operational-misalignment risks such as hallucination, manipulation, sabotage, sandbagging, and oversight evasion.

Open Source
Inspect AI parent UK AISI mark

Inspect AI

UK AI Security Institute framework for LLM safety evaluations

Inspect AI is an MIT-licensed framework from the UK AI Security Institute for running large language model evaluations, including tool use, multi-turn dialogue, model-graded scoring, and reusable evaluation tasks.

Open Source
Safari MCP Server parent Safari mark

Safari MCP Server

Apple's Safari-native MCP server for web debugging agents

Safari MCP Server is Apple's safaridriver-based MCP server in Safari Technology Preview, giving compatible coding agents local access to Safari page content, console logs, network requests, screenshots, JavaScript evaluation, interactions, viewport controls, and accessibility/performance checks.

freeTelemetry

FAQ

What is Mago?

Mago is a comprehensive PHP toolchain written in Rust that unifies linting, formatting, and static analysis into a single binary. It enforces PER-CS formatting standards, catches code smells with 100+ lint rules, and performs deep type inference for semantic analysis. Inspired by Clippy and OXC from the Rust ecosystem, it delivers performance orders of magnitude faster than PHPStan and Psalm while requiring no PHP runtime to execute.

Is Mago free?

Yes — Mago is open source and free to use. Free and open source under MIT License

Is Mago open source?

Yes — Mago is open source.

What are the best Mago alternatives?

The top editor-verified Mago alternatives are Knip, Floci, SWE-bench.