git clone https://github.com/Mumega-com/mcp-for-wpspai-screenshot-worker.git
cd spai-screenshot-worker
npm installEdit 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"# Generate a random token
openssl rand -hex 32
# Store it as a secret
wrangler secret put AUTH_TOKENwrangler deployNote the deployed URL (e.g., https://spai-screenshot.your-subdomain.workers.dev).
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"Go to mumcp → Integrations in your WordPress admin panel. Find the Screenshot Worker card and enter:
Click Save, then Test Connection to verify.
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| Feature | With Worker | Without (mshots) |
|---|---|---|
| Quality | Real Chromium render | Thumbnail quality |
| Speed | 5-10 seconds | 10-30 seconds |
| Output | Base64 PNG (inline) | URL only |
| Auth sites | Yes (public URLs) | Public only |
| Save to Media | Yes | Yes (delayed) |
Check that your Worker URL is correct and the auth token matches what you set via wrangler secret put AUTH_TOKEN.
Cloudflare Browser Rendering has rate limits on the free tier. Space out requests or upgrade your Cloudflare plan.
If the worker fails for any reason, mumcp automatically falls back to WordPress mshots. Check the cf_fallback_reason field in the response.
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.