Preview Theme Draft


Returns a link that shows the whole site with the pending theme changes applied — templates, styles, theme files, logo and site icon together — to a signed-in administrator, while visitors keep seeing the live site. The preview includes the site's existing Site Editor customisations, so it shows exactly what publishing will produce.

Also known as: staging link, see changes before publishing, draft preview.

Property Value
Ability slug mosmcp/theme-draft-preview
Wire tool name mosmcp__theme-draft-preview
Category Theme: Draft and Publish (mosmcp-theme-draft)
Plan Free

 

Required access

Requirement Value
Capability edit_theme_options
Minimum default role Administrator (Shop manager too when WooCommerce is active)
Annotations readOnly: false · destructive: false · idempotent: true · openWorld: false

 

Input schema

Field Type Required Default Description
path string — Optional page to open, for example "/about/" or "/?p=12". Defaults to the home page.

 

Output schema

Field Type Required Description
url string Yes
expires string
change_count integer
draft object
draft.exists boolean
draft.change_count integer
draft.templates string[]
draft.template_parts string[]
draft.global_styles string
draft.patterns string[]
draft.files string[]
draft.site_identity string[] Pending logo and site icon changes.
draft.custom_css string[] Pending change to the Customizer's Additional CSS. A block theme's Additional CSS is part of global styles.
draft.theme_settings string[] Pending theme (Customizer) settings.
draft.created string
draft.updated string
draft.preview_ready boolean
notes string[]

 

Example

Sample prompt
Give me a link to preview my pending theme changes on the About page.

Example request (json)

{
  "jsonrpc": "2.0",
  "id": 310,
  "method": "tools/call",
  "params": {
    "name": "mosmcp__theme-draft-preview",
    "arguments": {
      "input": {
        "path": "/about/"
      }
    }
  }
}

Example response (json)

{
  "jsonrpc": "2.0",
  "id": 310,
  "result": {
    "isError": false,
    "structuredContent": {
      "url": "https://example.com/about/?mosmcp_theme_preview=Xy12abc",
      "expires": "2026-09-30 10:45:00 UTC",
      "change_count": 2,
      "notes": [
        "Open the link in a browser where you are signed in to this site as an administrator. The preview follows you as you click around, including into wp-admin, until you choose \"Exit preview\" in the toolbar.",
        "The link only works for signed-in administrators, and visitors keep seeing the live site throughout."
      ]
    }
  }
}

 

Edge cases / errors

  • No pending changes → refused with mosmcp_theme_draft_empty.
  • Draft belongs to a theme that is no longer active → refused with mosmcp_theme_draft_stale; discard it first.
  • The preview link is valid for 24 hours and only works for signed-in administrators; any query string in path is dropped.

 


<< Previous Next >>
Discard Theme Draft Publish Theme Draft

For more information about the Secure MCP Server for WordPress plugin, explore the following resources:

Product Overview | Pricing | Try for Free | Documentation

If you have any questions regarding plugin configuration, pricing plans or licensing, please contact us or mail us at aisupport@xecurify.com.