Publish Theme Draft


Makes the pending theme changes live. First it refuses if anything they touch changed on the live site since the draft started; then, when theme code changed, it proves the site loads with the draft before touching anything; then it backs up the live versions, applies the changes, and checks the live site (wp-admin, the home page and the newest post and page, signed in and as a visitor) — rolling every change back automatically if a page fails. The draft is shared by everyone who edits this site's theme, including other AI conversations, so check mosmcp/theme-draft-status and tell the person every pending change before publishing. Needs confirm set to true once the person has agreed.

Property Value
Ability slug mosmcp/theme-draft-publish
Wire tool name mosmcp__theme-draft-publish
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: true · idempotent: false · openWorld: false

 

Input schema

Field Type Required Default Description
confirm boolean — Must be true, set only after the person has agreed to publish.

 

Output schema

Field Type Required Description
published boolean Yes
change_count integer
templates string[]
template_parts string[]
global_styles string
patterns string[]
files string[]
site_identity string[]
custom_css string[]
theme_settings string[]
backup_id string Yes Pass to mosmcp/theme-restore-backup to undo this publish.
checked_before string
checked_after string
notes string[]

 

Example

Sample prompt
Yes, publish the pending theme changes to the live site.

Example request (json)

{
  "jsonrpc": "2.0",
  "id": 311,
  "method": "tools/call",
  "params": {
    "name": "mosmcp__theme-draft-publish",
    "arguments": {
      "input": {
        "confirm": true
      }
    }
  }
}

Example response (json)

{
  "jsonrpc": "2.0",
  "id": 311,
  "result": {
    "isError": false,
    "structuredContent": {
      "published": true,
      "change_count": 2,
      "templates": [
        "single (update)"
      ],
      "template_parts": [],
      "global_styles": "",
      "patterns": [],
      "files": [
        "style.css (write)"
      ],
      "backup_id": "20260929-104512-d4e5f6",
      "checked_before": "The site loads normally with the draft applied: wp-admin, home page, newest post and newest page all render without a fatal error.",
      "checked_after": "The live site loads normally: wp-admin, home page, newest post and newest page all render without a fatal error, signed in and for visitors.",
      "notes": []
    }
  }
}

 

Edge cases / errors

  • confirm not true → refused with mosmcp_confirmation_required, listing every pending change so it can be shown to the person.
  • Something the draft touches changed on the live site since the draft started → refused with mosmcp_theme_draft_conflict; nothing is published.
  • Draft code causes a fatal error in the pre-check → mosmcp_theme_draft_breaks_site; if PHP changed and the check can't complete → mosmcp_theme_draft_unverifiable. The live site is untouched either way.
  • Live site fails after applying → every change is rolled back automatically (mosmcp_theme_publish_rolled_back) and the draft is kept; on success the draft is cleared and backup_id can undo it.

 


<< Previous Next >>
Preview Theme Draft Restore Theme Backup

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.