FOR PHP DEVELOPERS

Your agent can read
your production traces.

PHPRay speaks the Model Context Protocol. Point Claude Code, Claude Desktop, Cursor or any other MCP client at one URL and it can answer "which page got slow after Tuesday's deploy" from real request data — not from guessing at your source code.

Add it in one line

claude mcp add --transport http phpray https://phpray.dev/mcp

Nothing to install and no account needed. Without a token you get the read-only demo account: a WooCommerce store with real recorded traffic, so you can see what the tools return before you decide anything. Rate-limited to 30 requests a minute per address.

Then ask in plain language

Your own sites

Pass a console token and the same tools see your sites instead of the demo, scoped exactly to what that token can read:

claude mcp add --transport http phpray https://phpray.dev/mcp \
  --header "Authorization: Bearer <console token>"

The token comes from the console under Settings. It travels on each request and is never stored by the MCP service — the service holds no database and no credentials of its own. A read-only token cannot start profiling; the server refuses it rather than pretending.

What the tools do

phpray_sitesList the PHP sites this token can see, with requests, p95 latency and error rate. Start here: every other tool needs a site_id from this list.
phpray_overviewHeadline numbers for one site over a time window: requests, errors, p50/p95/p99 latency, database share and N+1 count. Use this before digging into anything else.
phpray_slow_pagesThe slowest URLs on a site, with request counts and p95, from the request timeseries. Answers "which page is slow".
phpray_slow_queriesSQL fingerprints ordered by time spent, with call counts and the caller when known. Literals are already masked. Answers "which query is slow".
phpray_componentsTime attributed to each plugin, theme or vendor package on profiled requests. Answers "which plugin is slowing the site down". Empty when function profiling is off.
phpray_errorsRecent PHP errors and warnings for a site, with file, line and the request they happened in.
phpray_tracesRecent requests for a site. Filter with min_ms and status to find the bad ones, then pass an id to phpray_trace.
phpray_traceOne request in full: wall time split into PHP, database and outbound HTTP, every query, every external call, errors, and the component breakdown when the request was profiled.
phpray_compareTwo time ranges for one site side by side. Use it to check whether a deployment, a plugin update or a configuration change made things better or worse.
phpray_alertsAlerts currently firing across every site this token can see.

This table is generated from the live endpoint, so it cannot drift away from what the server actually offers. With your own token you also get phpray_profile_url, which turns per-function profiling on for one URL prefix for a few minutes — the only tool that changes anything, and it is hidden on the demo.

Prefer it local?

The same server runs as a binary next to your collector, over stdio, with no cloud at all:

claude mcp add phpray-local -- phpray-mcp

It reads the collector on 127.0.0.1:9191 and needs no account. Binaries for Linux and macOS are in every release; the source is in src/mcp, Apache-2.0, with no third-party dependencies.

What it is not

Get your own data in there

The demo shows the shape. Your own traffic takes one install: open source, Apache-2.0, no card. A free cloud account gives one site, 10,000 traces a day, 7 days of history.

Install PHPRay See the plans

Read next