Skip to main content
Glama

FatalGuard — PHP error log viewer, fatal error alerts and MCP server for WordPress

FatalGuard is a WordPress plugin. It shows your debug.log and PHP error log in wp-admin, catches the fatal error behind the "critical error" white screen, sends Telegram alerts with a one-tap recovery link, and runs its own read-only MCP server, so Claude, Cursor or VS Code can read your site's errors.

This repository is a read-only mirror of the free plugin, version 1.3.2. Development happens elsewhere; issues and questions go to the support forum.

Install

Install it from wordpress.org, so your site gets automatic updates:

A zip from this repository works too (Plugins → Add New → Upload Plugin). It uses the same slug and has no Update URI header, so WordPress updates it from wordpress.org.

Related MCP server: LogMCP

Connect an AI client (MCP)

  1. In wp-admin, open FatalGuard → AI (MCP) and press Generate API key. Copy the key: it is shown only once. The same page shows these snippets with your URL and key filled in.

  2. Add the server to your client. Replace example.com with your site and paste your key.

Endpoint: POST https://<your-site>/wp-json/fatalguard/v1/mcp (streamable HTTP). The key goes in the X-FatalGuard-Key header. Some Apache hosts strip Authorization: Bearer, so use this header.

Claude Code (run in your terminal)

claude mcp add --transport http fatalguard "https://example.com/wp-json/fatalguard/v1/mcp" --header "X-FatalGuard-Key: PASTE-YOUR-API-KEY-HERE"

Cursor — mcp.json

{
  "mcpServers": {
    "fatalguard": {
      "type": "http",
      "url": "https://example.com/wp-json/fatalguard/v1/mcp",
      "headers": {
        "X-FatalGuard-Key": "PASTE-YOUR-API-KEY-HERE"
      }
    }
  }
}

VS Code — .vscode/mcp.json

{
  "servers": {
    "fatalguard": {
      "type": "http",
      "url": "https://example.com/wp-json/fatalguard/v1/mcp",
      "headers": {
        "X-FatalGuard-Key": "PASTE-YOUR-API-KEY-HERE"
      }
    }
  }
}

Claude Desktop — claude_desktop_config.json (via mcp-remote)

{
  "mcpServers": {
    "fatalguard": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "https://example.com/wp-json/fatalguard/v1/mcp",
        "--header",
        "X-FatalGuard-Key: PASTE-YOUR-API-KEY-HERE"
      ]
    }
  }
}

Then ask: "What's crashing my site?" or "Which warnings keep coming back?"

Tools

All six are read-only. The AI cannot change anything on your site.

Tool

What it returns

status

Logging status and FatalGuard settings

list_log_sources

The logs FatalGuard can read, with size

tail_log

The newest lines of one log, secrets redacted

list_errors

Errors grouped with counts and last seen

list_recent_fatals

Recently captured fatal errors

get_fatal

One fatal error in detail

The server works while WordPress can still load. For a site that is fully down, use the recovery link from the fatal alert. Revoke the key at any time on the same page.

Try it without a site (Docker)

The repository builds a sandbox: a throwaway WordPress (SQLite, no web server) with FatalGuard active and some demo errors, speaking MCP over stdio.

docker build -t fatalguard-mcp . && docker run -i --rm fatalguard-mcp

It is a demo to see the tools and their answers. Real use is the plugin on your own site, connected as shown above.

License

GPLv2 or later. See LICENSE.txt.

Available Tools

6 tools
get_fatalA

The latest record of one fatal-error group (signature from list_recent_fatals): full message incl. stack trace, file, line, origin, URL, PHP version, and its last occurrences.

Inputs: signature (required).

list_errorsA

Errors of a log grouped by signature, newest first: level, message, file and line, count, first and last seen. Use for "what keeps failing" questions.

Inputs: limit, source.

list_log_sourcesA

List the log sources FatalGuard can read on this site (PHP error log, wp-content/debug.log, PHP ini error_log, etc.) with size and whether they are readable. Use the returned id with tail_log or list_errors.

Inputs: no named parameters.

list_recent_fatalsA

Captured fatal errors (white screens) grouped, newest first: signature, message, file and line, the plugin or theme that caused it, count, first and last seen. Use this to see what is currently crashing the site; pass a signature to get_fatal for details.

Inputs: max.

statusA

Whether PHP error logging and fatal-error capture are on, the WP_DEBUG flags, log sizes, whether alerts are set up, and when the last fatal error happened. Start here.

Inputs: no named parameters.

tail_logA

Return the newest lines of a log source (by id from list_log_sources), oldest first, secrets redacted, optionally only lines containing a text. Use to read raw log context around an error.

Inputs: source (required), q, max.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4/5.0

    Scored across 6 tools

    Disambiguation4/5

    Most tools have clearly distinct purposes: status is an overview, list_log_sources discovers sources, tail_log reads raw lines, and get_fatal drills into one fatal group. The only potential confusion is between list_errors (grouped errors from a log source) and list_recent_fatals (grouped captured fatals), but their descriptions and required inputs make the boundary reasonably clear.

    Naming Consistency4/5

    Five of six tools follow a clear verb_noun or list_* pattern (list_log_sources, list_errors, list_recent_fatals, tail_log, get_fatal). The bare noun 'status' is a minor deviation, though it reads naturally as an overview entry point.

    Tool Count5/5

    Six tools is well-scoped for a read-only fatal-error and log diagnostics server. Each tool serves a distinct step in the workflow (overview, source discovery, raw tail, grouped errors, grouped fatals, fatal detail) with no obvious padding.

    Completeness4/5

    The surface covers the core diagnostic lifecycle: status, source discovery, raw log reading, grouped error listing, grouped fatal listing, and fatal detail. Minor gaps exist—there is no detail tool for an individual non-fatal error group and no explicit way to acknowledge or clear errors—but agents can work around these with the existing tools.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      F
      maintenance
      A WordPress plugin that implements the Model Context Protocol to enable AI models and applications to interact with WordPress sites in a structured and secure way.
      5
      52 npm
      946
      ISC
    • A
      license
      A
      quality
      C
      maintenance
      MCP server — read-only log access for AI assistants. Debug your Linux server with AI, without giving the AI shell access.
      7
      6
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      MCP server for collecting and analyzing CLI/web server error logs. Enables watching log files/directories, parsing common error patterns, and querying/analyzing logs through natural language.
      19 npm
      MIT