wp-playground-mcp
Boots ephemeral WordPress instances from a Blueprint (plugins, options, WP-CLI setup steps), runs WP-CLI commands against them (posts, options, plugins, users, menus, db queries, eval PHP), inspects logs and errors, and tears instances down.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@wp-playground-mcp Spin up WordPress with WooCommerce and create 3 test products."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Give your AI coding assistant ephemeral WordPress instances for testing instead of hoping the code works.
Why This Exists
AI coding assistants can write WordPress plugins and generate Gutenberg content. But they can't verify any of it works. They iterate blindly — writing code, guessing it's correct, moving on:
Writes a WooCommerce extension → can't check if products actually render
Generates block markup → can't verify it doesn't trigger "Attempt Block Recovery"
Hooks into
woocommerce_product_tabs→ can't confirm the tab appearsCreates 100 test products → can't see if import actually succeeded
The agent has no runtime. No WordPress instance to test against. No way to close the loop.
Related MCP server: WP Pinch
The Solution
What is WordPress Playground? WordPress Playground is an official WordPress project that runs a full WordPress instance entirely in WebAssembly — in the browser or on the command line. No Docker, no MySQL, no Apache. It boots in seconds, runs completely in-process, and leaves nothing behind when stopped. Think of it as a disposable WordPress that spins up instantly. (Learn more)
wp-playground-mcp wraps @wp-playground/cli as an MCP server, giving any AI assistant the ability to:
Generate a Blueprint — the agent writes a JSON blueprint describing the desired WordPress setup
Boot an instance — ephemeral WordPress via WebAssembly, no Docker, no MySQL, no server config
Run WP-CLI commands — query posts, create content, activate plugins, check options
Inspect logs and errors — catch PHP errors, verify everything loaded correctly
Tear it down — clean shutdown, no artifacts left behind
This is the third MCP in the PluginsLab ecosystem:
MCP | Purpose |
Verified hooks/filters/APIs for writing plugin code | |
Verified block schemas for generating content | |
wp-playground-mcp (this) | Ephemeral WordPress instances for testing |
Together: author → validate → test.
Quick Start
Install
npm install -g wp-playground-mcpOr run directly with npx (no install needed):
npx wp-playground-mcpConnect to Your AI Assistant
Add to your Claude Code MCP configuration (.mcp.json in your project root or ~/.claude/.mcp.json globally):
{
"mcpServers": {
"wp-playground": {
"command": "npx",
"args": ["wp-playground-mcp"]
}
}
}First test — ask your assistant:
"Spin up a WordPress Playground with WooCommerce and create 3 test products."
The agent will use get_blueprint_schema to learn the blueprint format, start_playground to boot the instance, and wp_cli to create products and verify they exist.
MCP Tools
get_blueprint_schema
Returns the complete Blueprint format reference — all step types, resource types, properties, and examples. The agent uses this to generate valid blueprints without hallucinating step names.
→ get_blueprint_schema()
← Full reference with 25 step types, 8 resource types, and 4 example blueprintsstart_playground
Boots an ephemeral WordPress instance from a Blueprint JSON.
→ start_playground({
blueprint: {
plugins: ["woocommerce"],
login: true,
steps: [
{ step: "setSiteOptions", options: { blogname: "My Store" } }
]
},
options: { port: 9400 }
})
← Playground running at http://localhost:9400 (instance: a1b2c3d4)The MCP auto-injects extraLibraries: ["wp-cli"], login: true, and features.networking: true if not present. Validates the blueprint before booting — catches typos like installPlugins instead of installPlugin.
wp_cli
Runs WP-CLI commands against the active instance. Supports: option, post, plugin, theme, user, site, db, eval, transient, menu, search-replace.
→ wp_cli({ command: "post list --format=json" })
← [{"ID":1,"post_title":"Hello world!","post_status":"publish",...}]
→ wp_cli({ command: "option get blogname" })
← My Store
→ wp_cli({ command: "plugin list --format=json" })
← [{"name":"WooCommerce","status":"active","version":"9.5.1",...}]get_playground_info
Returns the status of the active instance — URL, port, uptime, blueprint used.
→ get_playground_info()
← Running: yes | URL: http://localhost:9400 | Uptime: 5m 23s | Plugins: woocommercestop_playground
Stops the active instance and cleans up resources.
→ stop_playground()
← Stopped instance a1b2c3d4 (uptime: 12m 45s)get_playground_logs
Returns recent logs from the Playground process. Filter by type for targeted debugging.
→ get_playground_logs({ lines: 20, type: "error" })
← PHP errors and warnings from the instanceCLI Reference
The CLI mirrors the MCP tools for manual use:
# Start from a blueprint file
wp-playground start --blueprint=./blueprint.json
# Start with inline options
wp-playground start --wp=6.7 --php=8.3 --plugin woocommerce jetpack
# Run WP-CLI commands
wp-playground wp "post list --format=json"
wp-playground wp "option get blogname"
# Check status
wp-playground status
# View logs
wp-playground logs
wp-playground logs --lines=100 --type=error
# Stop
wp-playground stop
# Print blueprint schema reference
wp-playground schemaHow It Works
Process Management
When start_playground is called, the MCP:
Validates the blueprint against known step types and required parameters
Enhances the blueprint with wp-cli, login, networking, and the MCP bridge mu-plugin
Spawns
npx @wp-playground/cli serveras a child process with the blueprintPolls the server URL until WordPress is ready (timeout: 120s)
Writes a state file to
~/.wp-playground-mcp/instances/active.json
On MCP restart, it checks the state file — if the PID is still alive, it reconnects. If the PID is dead, it cleans up the stale file.
WP-CLI Execution
WP-CLI commands are executed via a PHP bridge. During blueprint setup, the MCP injects an mu-plugin (mcp-bridge.php) that registers a REST endpoint at /wp-json/mcp/v1/eval. The MCP server translates WP-CLI commands into equivalent PHP code and sends it to this endpoint.
Supported WP-CLI subcommands:
option— get, update, add, delete, listpost— list, create, get, update, deleteplugin— list, activate, deactivatetheme— list, activateuser— list, create, getsite— infodb— queryeval— arbitrary PHPtransient— get, set, deletemenu— list, createsearch-replace— database-wide find and replace
For commands not supported via the bridge (like WooCommerce CLI), include them as wp-cli steps in the blueprint — they'll execute during startup.
Blueprint Validation
Before booting, the MCP validates:
Step types — checks against the 25 known types, suggests corrections for typos
Required parameters — each step's mandatory fields are verified
Resource types — validates resource references (
wordpress.org/plugins,url,literal, etc.)PHP versions — validates against supported versions (7.4 – 8.5)
Data Storage
~/.wp-playground-mcp/
instances/
active.json # State file for the running instance
blueprints/
last-used.json # Cache of the last blueprint
logs/
playground.log # Stdout/stderr from the Playground processCompanion Tools
Full PluginsLab Stack
For the complete AI-assisted WordPress development workflow, use all three MCPs together:
wp-devdocs-mcp — verified hooks, filters, and APIs for writing plugin code
wp-blockmarkup-mcp — verified block schemas for generating Gutenberg content
wp-playground-mcp (this project) — ephemeral WordPress instances for testing
{
"mcpServers": {
"wp-devdocs": {
"command": "npx",
"args": ["--prefix", "/path/to/wp-devdocs-mcp", "wp-devdocs-mcp"]
},
"wp-blockmarkup": {
"command": "npx",
"args": ["--prefix", "/path/to/wp-blockmarkup-mcp", "wp-blockmarkup-mcp"]
},
"wp-playground": {
"command": "npx",
"args": ["--prefix", "/path/to/wp-playground-mcp", "wp-playground-mcp"]
}
}
}Example: "Build me a WooCommerce product FAQ tab plugin and test it"
One prompt. The agent uses all three MCPs to go from nothing to a tested, working plugin:
Phase 1 — Write the plugin with verified hooks (wp-devdocs-mcp)
search_hooks("woocommerce product tab")→ findswoocommerce_product_tabsandwoocommerce_product_tab_panelsvalidate_hook("woocommerce_product_tabs")→ confirmed: filter, 1 param, returns array of tabsget_hook_context("woocommerce_product_tabs")→ sees how other plugins register tabs, learns the expected array structure (title,priority,callback)Agent writes a plugin that adds a "FAQ" tab using the verified hook signature — no guessing
Phase 2 — Generate the FAQ content with verified markup (wp-blockmarkup-mcp)
search_blocks("accordion")→ findscore/detailsblock for collapsible FAQ itemsget_block_schema("core/details")→ gets the exact attributes, inner block structure, and valid markupvalidate_markup(generated)→ confirms the FAQ content passes structural validationAgent generates 5 FAQ entries as valid Gutenberg block markup — no "Attempt Block Recovery"
Phase 3 — Boot, deploy, and verify everything works (wp-playground-mcp)
start_playground→ boots WooCommerce with the plugin injected viawriteFile+ the FAQ content loaded viawp-clistepswp_cli("plugin list --format=json")→ confirms the FAQ plugin is active alongside WooCommercewp_cli("post list --post_type=product --format=json")→ verifies test products existwp_cli("option get blogname")→ sanity check, site is aliveget_playground_logs(type: "error")→ zero PHP errors, no warningsAgent reports: "Plugin works. 3 products with FAQ tabs, no errors. Instance running at http://localhost:9400 if you want to check."
stop_playground→ clean shutdown
The result: a tested WooCommerce plugin built entirely from verified APIs, with validated content, running against a real WordPress instance — from a single prompt.
Requirements
Node.js 20+
npx access (for downloading
@wp-playground/clion demand)No Docker, no MySQL, no Apache — WordPress runs in WebAssembly
License
MIT
Available Tools
6 toolsget_blueprint_schemaA
Returns the WordPress Playground Blueprint JSON schema reference. Use this to understand the blueprint format before generating one for start_playground. Includes all step types, resource types, top-level properties, and example blueprints.
Inputs: no named parameters.
get_playground_infoA
Returns the status and details of the current Playground instance, including URL, port, uptime, and the blueprint used.
Inputs: no named parameters.
get_playground_logsA
Returns recent logs from the Playground instance. Useful for checking PHP errors, startup messages, and debugging.
Inputs: type, lines.
start_playgroundA
Boot an ephemeral WordPress Playground instance from a Blueprint JSON. The agent generates the blueprint based on user intent, using get_blueprint_schema as reference. Only one instance can run at a time.
Inputs: blueprint (required), options.
stop_playgroundA
Stop the active Playground instance and clean up resources.
Inputs: no named parameters.
wp_cliA
Run a WP-CLI command against the active Playground instance. The command is executed via a PHP bridge that translates common WP-CLI commands into WordPress function calls. Supports: option, post, plugin, theme, user, site, db, eval, transient, menu, search-replace. For unsupported commands, include them as wp-cli steps in the blueprint.
Inputs: command (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool targets a distinct operation: lifecycle control (start/stop), inspection (info/logs), reference lookup (blueprint schema), and command execution (wp_cli). The only near-neighbors, get_playground_info and get_playground_logs, are clearly separated by their descriptions (status/metadata vs. runtime logs).
Five of six tools follow a clean verb_noun pattern (get_playground_info, get_playground_logs, get_blueprint_schema, start_playground, stop_playground). The lone exception, wp_cli, is a noun-only name, but its purpose is unambiguous.
Six tools is well-scoped for a single-instance playground lifecycle manager, covering boot, teardown, inspection, and command execution without redundancy. Every tool earns its place.
The surface covers the full lifecycle (start/stop), observability (info/logs), and operational depth (wp_cli, blueprint schema). Minor gaps exist around restarting an instance or modifying/regenerating a running blueprint, but these are workable around via stop+start.
Maintenance
Related MCP Connectors
Your AI Agent's Infrastructure Layer. Connect Claude, Copilot, Codex, or ChatGPT to 200+ managed open source services. Start databases, pipelines, and applications through natural language.
Persistent cloud workspaces for AI agents: run commands, edit files, use git and a browser.
Backend platform for AI agents: one agentstack.execute tool runs batched steps over +700 actions (hosting, storage, auth, payments, CRM, app builder).
Build, test and publish agentic workflows from your AI client: approve steps, read tables, see runs.
Related MCP Servers
- AlicenseCqualityDmaintenanceEnables AI agents to manage WordPress sites with 190+ tools for content management, theme/plugin customization, file system operations, WooCommerce, and complete site control through natural language.10028 npm55MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to manage and interact with WordPress sites through MCP, providing tools for content creation, moderation, WooCommerce operations, and governance.47GPL 2.0
- FlicenseNot gradedqualityDmaintenanceEnables AI agents to manage WordPress sites via ~74 capabilities including content, media, plugins, themes, and more.-
- AlicenseNot gradedqualityBmaintenanceEnables AI assistants and agents to communicate directly with a WordPress environment, executing PHP code and WP-CLI commands, inspecting and editing theme and plugin files in a sandbox, and managing posts, content, and Gutenberg blocks in real time.MIT