mcp
v3.1.67MCP server for WordPress Playground - enables AI agents to interact with the WordPress Playground website.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
playground_list_sites List Available Sites
List all WordPress Playground sites available. Call this before any other playground tool — it returns the siteId required by every other operation. If this returns no sites, the user may need to open Playground in their browser. Use playground_get_website_url to get the exact URL to send to the user. Returns site names and storage type. "temporary" sites are lost on page reload, "opfs" sites persist across reloads. Call playground_save_in_browser to persist a temporary site.
playground_open_site_in_new_tab Open Site in New Tab
Open a WordPress Playground site in a new browser tab. The site must appear in playground_list_sites. Check playground_get_current_url first — if the site is already open in a tab, calling this tool will open a second tab rather than switching to the existing one.
| Parameter | Type | Description |
|---|---|---|
siteId * | string | Target site ID. Call playground_list_sites first to discover available site IDs. |
playground_rename_site Rename Site
Rename a WordPress Playground site. Updates the display name shown in the browser UI.
| Parameter | Type | Description |
|---|---|---|
newName * | string | The new display name for the site |
siteId * | string | Target site ID. Call playground_list_sites first to discover available site IDs. |
playground_get_website_url Get Playground Website URL
Return the URL the user must open in their browser to use WordPress Playground with this MCP server. Use this tool whenever you need to send the user to Playground or open it autonomously — always obtain the URL from this tool rather than constructing it manually.
playground_save_in_browser Save in Browser
Save a temporary WordPress Playground site to browser storage so it survives page reloads. Safe to call even if the site is already saved (no-op). Sites start as temporary by default and are lost when the browser tab is closed or the page is reloaded. Call this early in any multi-step workflow where losing progress would be costly.
| Parameter | Type | Description |
|---|---|---|
siteId * | string | Target site ID. Call playground_list_sites first to discover available site IDs. |
playground_execute_php Execute PHP Code
Run arbitrary PHP code in WordPress Playground and return the output. WordPress is NOT bootstrapped automatically. To use WordPress functions, start your code with: require("/wordpress/wp-load.php"); Always include the opening <?php tag. The response JSON contains three fields: - "text": stdout output - "errors": PHP warnings, notices, and fatal error messages from stderr - "exitCode": 0 on success, non-zero on fatal error Check both "errors" and "exitCode" to determine whether the call succeeded. WARNING: output is returned in full with no trunca…
| Parameter | Type | Description |
|---|---|---|
code * | string | PHP code to execute. Example: "<?php echo get_bloginfo('name');" |
siteId * | string | Target site ID. Call playground_list_sites first to discover available site IDs. |
playground_request HTTP Request
Make an HTTP request to the WordPress site running in Playground. REST API requests (/wp-json/* or ?rest_route=) are automatically authenticated with a valid nonce — no manual auth needed. Tool selection guide: 1. Use this tool (playground_request) with the REST API for standard content CRUD — posts, pages, users, terms, comments, settings, etc. The REST API handles serialization, pagination, and field filtering for you. Prefer compact REST responses: use _fields to request only the fields needed and per_page/page for large colle…
| Parameter | Type | Description |
|---|---|---|
siteId * | string | Target site ID. Call playground_list_sites first to discover available site IDs. |
url * | string | Request URL path, e.g. "/wp-json/wp/v2/posts" or "/wp-admin/plugins.php" |
body | Request body (for POST/PUT requests). Accepts a JSON string or an object. | |
headers | object | Request headers as string key-value pairs, e.g. {"Content-Type": "application/json"} |
method | string | HTTP method (GET, POST, PUT, DELETE, etc.). Defaults to GET. |
playground_get_current_url Get Current URL
Get the current URL path of the WordPress site displayed in Playground. For additional metadata (WordPress version, PHP version, document root), use playground_get_site_info instead.
| Parameter | Type | Description |
|---|---|---|
siteId * | string | Target site ID. Call playground_list_sites first to discover available site IDs. |
playground_get_site_info Get Site Info
Get metadata about the running WordPress instance: current URL, document root, site URL, WordPress version, and PHP version. Use this when you need version information or the document root path. For just the current URL, prefer playground_get_current_url.
| Parameter | Type | Description |
|---|---|---|
siteId * | string | Target site ID. Call playground_list_sites first to discover available site IDs. |
playground_read_file Read File
Read a file from the WordPress virtual filesystem. Returns the file contents as text.
| Parameter | Type | Description |
|---|---|---|
path * | string | Absolute path to the file, e.g. "/wordpress/wp-config.php" |
siteId * | string | Target site ID. Call playground_list_sites first to discover available site IDs. |
playground_write_file Write File
Write content to a file in the WordPress virtual filesystem. WARNING: Overwrites the entire file — existing content is permanently lost. Read the file first with playground_read_file if you need to preserve any content. Creates the file if it does not exist. Parent directories are NOT created automatically — call playground_mkdir first if needed, otherwise the write will fail with a "no such file or directory" error.
| Parameter | Type | Description |
|---|---|---|
contents * | string | File contents to write |
path * | string | Absolute path to write to, e.g. "/wordpress/wp-content/test.txt" |
siteId * | string | Target site ID. Call playground_list_sites first to discover available site IDs. |
playground_list_files List Files
List files and directories at a given path in the WordPress virtual filesystem. Returns a flat, non-recursive listing of the immediate contents. To explore subdirectories, call this tool again with the subdirectory path.
| Parameter | Type | Description |
|---|---|---|
path * | string | Absolute path to list, e.g. "/wordpress/wp-content/plugins" |
siteId * | string | Target site ID. Call playground_list_sites first to discover available site IDs. |
playground_mkdir Create Directory
Create a directory (and all required parent directories) in the WordPress virtual filesystem. Call this before playground_write_file when writing to a path whose parent directories do not yet exist.
| Parameter | Type | Description |
|---|---|---|
path * | string | Absolute path of directory to create, e.g. "/wordpress/wp-content/my-plugin" |
siteId * | string | Target site ID. Call playground_list_sites first to discover available site IDs. |
playground_delete_file Delete File
Delete a file from the WordPress virtual filesystem. WARNING: Deletion is permanent and cannot be undone. Returns an error if the file does not exist — use playground_file_exists first if deletion is conditional.
| Parameter | Type | Description |
|---|---|---|
path * | string | Absolute path of file to delete |
siteId * | string | Target site ID. Call playground_list_sites first to discover available site IDs. |
playground_delete_directory Delete Directory
Delete a directory from the WordPress virtual filesystem. WARNING: Deletion is permanent and cannot be undone. By default (recursive=false), the directory must be empty or the call will fail. Set recursive=true to delete a directory and all its contents — use with care.
| Parameter | Type | Description |
|---|---|---|
path * | string | Absolute path of directory to delete |
siteId * | string | Target site ID. Call playground_list_sites first to discover available site IDs. |
recursive | boolean | If true, delete directory and all contents. If false (default), fails on non-empty directories. |
playground_file_exists File Exists
Check whether a file or directory exists in the WordPress virtual filesystem.
| Parameter | Type | Description |
|---|---|---|
path * | string | Absolute path to check |
siteId * | string | Target site ID. Call playground_list_sites first to discover available site IDs. |
playground_list_emails List Captured Emails
List every email the WordPress site has sent so far. Playground has no mail server. Each message WordPress attempts to send (password resets, comment notifications, wp_mail() calls…) is captured instead of being delivered. Use this tool to read those messages, e.g. to verify that a plugin sent an email or to retrieve a confirmation link. Returns the full inbox in send order. Each entry contains the from/to/CC addresses, subject, date, text and HTML bodies, and attachment metadata (file name, MIME type, size). Attachment contents are not included.
| Parameter | Type | Description |
|---|---|---|
siteId * | string | Target site ID. Call playground_list_sites first to discover available site IDs. |