DOCS / INTEGRATIONS

Screenshot Worker Setup

Enable high-quality headless Chromium screenshots for your WordPress site using Cloudflare Browser Rendering. Without this, screenshots fall back to WordPress mshots (lower quality, delayed).

What You Need

  • 1. A Cloudflare account (free tier works)
  • 2. Browser Rendering enabled on your Cloudflare account
  • 3. mumcp v1.1.18 or later

Deploy the Worker

Step 1: Clone the Worker

git clone https://github.com/Mumega-com/mcp-for-wpspai-screenshot-worker.git
cd spai-screenshot-worker
npm install

Step 2: Configure

Edit wrangler.toml with your Cloudflare account ID:

name = "spai-screenshot"
account_id = "your-account-id"
main = "src/index.js"
compatibility_date = "2024-09-23"
compatibility_flags = ["nodejs_compat"]

[browser]
binding = "BROWSER"

Step 3: Set Auth Token

# Generate a random token
openssl rand -hex 32

# Store it as a secret
wrangler secret put AUTH_TOKEN

Step 4: Deploy

wrangler deploy

Note the deployed URL (e.g., https://spai-screenshot.your-subdomain.workers.dev).

Connect to mumcp

Option A: Via AI Assistant (Recommended)

Your AI assistant can configure it directly using MCP:

Use the wp_configure_integration tool:
  provider: "screenshot"
  config:
    url: "https://spai-screenshot.your-subdomain.workers.dev"
    token: "your-auth-token"

Then test it:

Use the wp_test_integration tool:
  provider: "screenshot"

Option B: Via WordPress Admin

Go to mumcp → Integrations in your WordPress admin panel. Find the Screenshot Worker card and enter:

  • Worker URL — The Cloudflare Worker URL from Step 4
  • Auth Token — The token you set in Step 3

Click Save, then Test Connection to verify.

Using Screenshots

Once configured, the wp_screenshot_url MCP tool automatically uses your Cloudflare worker for high-quality screenshots:

Use the wp_screenshot_url tool:
  url: "https://example.com"
  width: 1280
  height: 720
  save_to_media: true   # optional: save to Media Library

What You Get

FeatureWith WorkerWithout (mshots)
QualityReal Chromium renderThumbnail quality
Speed5-10 seconds10-30 seconds
OutputBase64 PNG (inline)URL only
Auth sitesYes (public URLs)Public only
Save to MediaYesYes (delayed)

Troubleshooting

Test shows “Connection failed”

Check that your Worker URL is correct and the auth token matches what you set via wrangler secret put AUTH_TOKEN.

Rate limit errors (429)

Cloudflare Browser Rendering has rate limits on the free tier. Space out requests or upgrade your Cloudflare plan.

Screenshots fall back to mshots

If the worker fails for any reason, mumcp automatically falls back to WordPress mshots. Check the cf_fallback_reason field in the response.

Worker can’t screenshot localhost/internal URLs

The worker runs on Cloudflare’s network and can only access publicly reachable URLs. For local development, use mshots or test with a public URL.