Get the plugin
WP MCP/Integrations/WP Rocket MCP

WP Rocket MCP · Free and Pro

WP Rocket MCP: cache purges and WP Rocket settings from a prompt.

A WP Rocket MCP server lets an AI agent clear the cache after a change and adjust how WP Rocket optimises the site, without a trip to its settings tabs. WP MCP purges through WP Rocket's own API and, on Pro, saves settings through WP Rocket's own save path.

Self-hosted · snapshot before every write · one-click undo

What it is

What a WP Rocket MCP server does.

Two jobs come up again and again on a WP Rocket site: clearing every cache layer after a deploy, and switching an optimisation on or off to test its effect. A WP Rocket MCP server lets an agent do both, and report what it found, so the question 'is the page cache even WP Rocket' gets an answer before anything is purged.

WP MCP calls into WP Rocket only when its signature, rocket_clean_domain() or the WP_ROCKET_VERSION constant, is present, so the tools cannot fatal without the plugin. On Pro, settings changes are written to the wp_rocket_settings option through WP Rocket's own save hooks, so its config file, rewrite rules and cache clear run as they do from its screen.

Read and change

What WP MCP can read and change in WP Rocket.

It can read

  • Whether WP Rocket is the active page cache, next to the object cache backend and OPcache state
  • Pro: every allowlisted WP Rocket setting, for media, CSS, JavaScript, fonts, preload, CDN and cache rules
  • Pro: whether the licence and the Cloudflare and Sucuri credentials are set, never their values

It can change

  • Flush the object cache, transients and OPcache, then purge WP Rocket, in one call
  • Pro: turn lazy load, minify, defer and delay JavaScript, font and preload options on or off (opt-in)
  • Pro: edit exclusion lists, CDN CNAMEs and cache rules (opt-in)
  • Pro: start WP Rocket's preload so it warms the cache (opt-in)
get-cache-statusclear-cacheget-wp-rocket-settingsset-wp-rocket-settingspreload-wp-rocket-cacherollback-operation

These are the real ability and operation names the agent calls. TheWP Rocket AI agent tool reference page lists the calls in detail.

Example prompts

Three things to ask first.

Which caching layers are active on this site, and is WP Rocket the page cache?

Clear every cache, then start the WP Rocket preload for the new pricing page.

Exclude the booking form script from delay JavaScript in WP Rocket.

Safety

Every WP Rocket write has a way back.

A settings write is snapshotted on the wp_rocket_settings option before it runs, and rollback-operation puts every setting back through the same WP Rocket save path, so its derived files are rebuilt too. A purge or a preload has nothing to restore, since the cache rebuilds itself, so neither is snapshotted and each reply says recoverable:false.

Snapshot before every write

No tool that writes can skip it. The before-state is saved first, the change is applied second.

One-click undo

Restore a single change with rollback-operation or a whole agent run with rollback-session, from the agent or from wp-admin.

Conflicts refused, secrets masked

A write that turns on both Remove Unused CSS and Load CSS Asynchronously, or that pairs CDN CNAMEs and zones unevenly, is refused before anything changes. Licence and CDN credentials are never returned or written.

Free or Pro

Free, with more on Pro.

Detecting and purging WP Rocket is in the free plugin: get-cache-status and clear-cache. WP MCP Pro adds reading and changing WP Rocket's settings and starting its preload, plus unlimited snapshot history with an active licence, where the free plugin keeps the last 20.

WP MCP Pro starts at $49 a year for one site. See pricing for what each tier includes.

How to connect

Connect WP Rocket MCP in four steps.

  1. 01
    Install WP MCP

    Upload the free wpmcp plugin and activate it. It needs WordPress 6.9 or newer and PHP 8.1 or newer, and it runs entirely on your own server.

  2. 02
    Check the requirement

    WP Rocket active. Settings writes and preload stay off until the site turns on the wpmcp_enable_cache_settings_write filter.

  3. 03
    Connect your client

    Add the site to Claude Code, Claude Desktop, Cursor or any MCP client with a WordPress application password, or the WP-CLI stdio bridge locally. OAuth 2.1 with full or read-only access is there too, once the site owner switches it on.

  4. 04
    Ask for the change

    Describe what you want done in WP Rocket. WP MCP snapshots the target, makes the change, and leaves a Restore button next to it in wp-admin.

Step-by-step guides: Claude,Claude Code andCursor. The docscover the safety model in full.

Frequently asked

WP Rocket MCP: questions, answered.

What is WP Rocket MCP?

It is WP Rocket made controllable by AI agents over the Model Context Protocol. WP MCP lets Claude, Cursor or any MCP client confirm WP Rocket is the page cache, purge it, and on Pro read and change its optimisation settings.

Is WP Rocket MCP free?

Partly. get-cache-status and clear-cache are free. The settings read and write and the preload op are part of WP MCP Pro.

Can a purge be undone?

No, and there is no need: a cleared cache refills on the next visits. clear-cache and preload-wp-rocket-cache are not snapshotted and say so in the reply. Settings writes are snapshotted and undoable.

Which WP Rocket settings stay out of reach?

Cloudflare, Sucuri, Varnish, heartbeat control, database cleanup and JavaScript file combining are read-only, and the licence and API keys are reported as set or not set. Writable keys are listed by get-wp-rocket-settings.

Why does the preload request get refused?

WP Rocket's preload is switched off on the site. Turn it on with set-wp-rocket-settings and manual_preload set to true, which starts a preload as well.

Does WP Rocket MCP work with Claude, Claude Code and Cursor?

Yes. Claude Code and Cursor connect to WP MCP over HTTP with a WordPress application password, and Claude Desktop uses the desktop bundle from the WP MCP Connection screen. Clients that can only sign in with OAuth, such as the claude.ai custom connector, need OAuth switched on first with one line in wp-config.php, because it ships off. Once connected, the WP Rocket tools are available in every client the same way.

Point your AI agent at WP Rocket.