Publish Post


Changes a draft or pending post to published, making it publicly visible immediately.

Property Value
Ability slug mosmcp/post-publish
Wire tool name mosmcp__post-publish
Category Posts (mosmcp-posts)
Plan Free

 

Required access

Requirement Value
Capability publish_posts
Minimum default role Author
Annotations readOnly: false · destructive: false · idempotent: false · openWorld: true

 

Input schema

Field Type Required Default Description
id integer (min 1) Yes — The ID of the draft or pending post to publish.

 

Output schema

Field Type Required
id integer Yes
title string Yes
previous_status string Yes
new_status string Yes
link string
edit_url string

 

Example

Sample prompt
Publish my draft post 42 now.

Example request (json)

{
  "jsonrpc": "2.0",
  "id": 19,
  "method": "tools/call",
  "params": {
    "name": "mosmcp__post-publish",
    "arguments": {
      "input": {
        "id": 42
      }
    }
  }
}

Example response (json)

{
  "jsonrpc": "2.0",
  "id": 19,
  "result": {
    "isError": false,
    "structuredContent": {
      "id": 42,
      "title": "Autumn Sale",
      "previous_status": "draft",
      "new_status": "publish",
      "link": "https://example.com/autumn-sale/",
      "edit_url": "https://example.com/wp-admin/post.php?post=42&action=edit"
    }
  }
}

 

Edge cases / errors

  • Post already published → refused with already_published.
  • Post that is private, scheduled or trashed → refused with invalid_status; only draft or pending posts can be published.
  • id that is not a post → post_not_found. Requires the publish_posts capability (Author and above).

 


<< Previous Next >>
List Untagged Posts Remove Category from Post

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.