Get the plugin
WP MCP/Integrations/Operations

Operations integration

Smush MCP

WP MCP adds two ops on the theme dispatcher pair for Smush. get-image-optimizer-status reads Smush's own wp-smush-settings option through an allowlist: the compression level (basic, super or ultra), whether images are optimized on upload, whether backups are kept, and whether WebP and AVIF copies are made. It also counts the JPEG, PNG, GIF and WebP images in the media library and how many Smush has already optimized (from its own per-image records), so the agent sees what is still pending. Nothing calls an outside API. optimize-attachment runs one library image through Smush's own optimizer and answers status optimized when it is done. Before Smush touches anything, WP MCP backs up the attachment row, its meta and every file it owns, and records the WebP and AVIF paths that do not exist yet, including Smush's mirror under uploads/smush-webp, so rollback-operation puts the original bytes back and deletes only the copies this call created. If Smush fails, everything is restored at once and no undo point is left behind. The write is off until a site opts in with the wpmcp_enable_image_optimizer_write filter or its toggle on the WP MCP settings screen. Both ops run at manage_options.

theme-readtheme-write

What your AI can do

Real Smush operations, every write reversible.

  • Read Smush's compression level, auto-optimize on upload and backup settings
  • See whether Smush makes WebP and AVIF copies
  • Count library images Smush has optimized and how many are pending
  • Optimize one image through Smush itself (opt-in)
  • Roll the image back to its original files, removing new WebP and AVIF copies

Example prompts

Example Smush prompts.

What compression level is Smush on, and how many images still need optimizing?

Is Smush making WebP copies of new uploads?

Smush the hero image on the home page, media id 412.

Under the hood

The Smush calls, under the hood.

wpmcp, smush

theme-read({ operation: "get-image-optimizer-status", args: { plugin: "smush" } }), allowlisted settings and library counts

theme-write({ operation: "optimize-attachment", args: { media_id: 412, plugin: "smush" } }), opt-in; files and meta snapshotted first

In the free plugin

The Smush integration is in the free plugin.

The core Smush tools ship in the free, GPL plugin with the full snapshot and undo engine, and no trial clock. Pro adds 133 more tools, including Elementor deep editing, the other page builders, the forms adapter pack and, for some integrations, extra operations. The pricing page lists what each tier includes.

Frequently asked

Smush MCP: questions, answered.

Can I undo a Smush optimization?

Yes. The attachment, its meta and all its files are backed up before Smush runs, so rollback-operation restores the original files and deletes the WebP or AVIF copies the call added. Files that were already there before the call are never deleted.

What happens if two image optimizers are active?

optimize-attachment refuses with image_optimizer_ambiguous and lists the active ones, so the agent has to name plugin: "smush". The status read covers every active optimizer unless plugin narrows it.

Does this clash with WP MCP's own image optimization?

No. While Smush is active, the Pro optimize-media tool steps aside unless forced and points the agent at optimize-attachment, so two optimizers never recompress the same files.

Is there an AI agent for Smush?

Yes, through WP MCP rather than Smush itself. An agent you choose, such as Claude or Cursor, can read Smush's compression level, auto-optimize on upload and backup settings. WP MCP is a separate plugin, not a built-in AI feature of Smush.

Point your AI at Smush.