Skip to main content

AI & MCP Integration

Experimental Feature

This feature is experimental and currently available only for site administrators. The WordPress Abilities API and MCP ecosystem are still evolving, and the API may change in future versions.

Better Messages registers WordPress Abilities that allow AI tools to interact with your messaging system. AI assistants can send messages, read conversations, search users, manage participants, and more.

Requirements

Available Abilities

Messages

AbilityDescriptionParameters
better-messages/send-messageSend a message to a conversationthread_id, message, sender_id (optional)
better-messages/get-messagesRead messages from a conversationthread_id, count (optional)
better-messages/search-messagesSearch messages by keyword (returns matching content)query
better-messages/edit-messageEdit an existing messagethread_id, message_id, message
better-messages/delete-messagesDelete messagesthread_id, message_ids

Conversations

AbilityDescriptionParameters
better-messages/list-conversationsList conversations for a useruser_id (optional), exclude (optional)
better-messages/get-conversationGet conversation with messagesthread_id, messages_count (optional)
better-messages/create-conversationStart a new conversationrecipients, message, subject (optional)
better-messages/get-private-conversationGet or create a 1-on-1 conversationuser_id, create (optional)
better-messages/delete-conversationDelete a conversationthread_id
better-messages/mark-readMark conversations as readthread_ids (optional, empty = mark all)
better-messages/change-subjectChange conversation subjectthread_id, subject
better-messages/get-statsGet messaging statistics

Participants

AbilityDescriptionParameters
better-messages/list-participantsList conversation participantsthread_id
better-messages/add-participantAdd users to a conversationthread_id, user_ids
better-messages/remove-participantRemove a user from a conversationthread_id, user_id
better-messages/make-moderatorGrant moderator rolethread_id, user_id
better-messages/unmake-moderatorRemove moderator rolethread_id, user_id

Users

AbilityDescriptionParameters
better-messages/search-usersSearch users by namequery, limit (optional)
better-messages/get-unread-countGet unread message countuser_id (optional)

Moderation

AbilityDescriptionParameters
better-messages/get-pending-messagesView moderation queuepage (optional), per_page (optional)
better-messages/approve-messageApprove a pending messagemessage_id
better-messages/reject-messageReject and delete a pending messagemessage_id
better-messages/blacklist-userAdd user to blacklistuser_id
better-messages/unblacklist-userRemove user from blacklistuser_id
better-messages/whitelist-userAdd user to whitelistuser_id
better-messages/unwhitelist-userRemove user from whitelistuser_id

Connecting AI Tools

Option 1: Local WordPress (Claude Desktop, Cursor, VS Code)

This method works when your AI tool runs on the same machine as WordPress (local development).

Step 1. Install and activate the WordPress MCP Adapter plugin.

Step 2. Add the following to your AI tool's MCP configuration:

Claude Desktop — Edit claude_desktop_config.json (Settings → Developer → Edit Config):

{
"mcpServers": {
"wordpress": {
"command": "wp",
"args": [
"--path=/path/to/your/wordpress",
"mcp-adapter", "serve",
"--server=mcp-adapter-default-server",
"--user=admin"
]
}
}
}

Cursor — Go to Settings → Tools and MCP → Add Custom MCP, use the same format.

VS Code — Create .vscode/mcp.json in your project:

{
"servers": {
"wordpress": {
"command": "wp",
"args": [
"--path=/path/to/your/wordpress",
"mcp-adapter", "serve",
"--server=mcp-adapter-default-server",
"--user=admin"
]
}
}
}

Replace /path/to/your/wordpress with the actual path to your WordPress installation and admin with your WordPress username.

Option 2: Remote WordPress (hosted sites)

This method works with any hosted WordPress site accessible over HTTPS. Requires Node.js installed on your computer.

Step 1. Install and activate the WordPress MCP Adapter plugin.

Step 2. Create an Application Password in WordPress: go to Users → Profile → Application Passwords, enter a name (e.g. "Claude Desktop"), and click Add New Application Password. Copy the generated password.

Step 3. Add the following to your AI tool's MCP configuration:

{
"mcpServers": {
"wordpress": {
"command": "npx",
"args": ["-y", "@automattic/mcp-wordpress-remote@latest"],
"env": {
"WP_API_URL": "https://yoursite.com/wp-json/mcp/mcp-adapter-default-server",
"WP_API_USERNAME": "your-username",
"WP_API_PASSWORD": "xxxx xxxx xxxx xxxx xxxx xxxx"
}
}
}
}

Replace yoursite.com with your domain, and fill in your username and application password.

Option 3: REST API (no MCP needed)

You can use Better Messages abilities directly through the WordPress REST API without any additional plugins.

List available abilities:

GET https://yoursite.com/wp-json/wp-abilities/v1/abilities?category=better-messages

Execute an ability:

POST https://yoursite.com/wp-json/wp-abilities/v1/abilities/better-messages/send-message/run
Content-Type: application/json
Authorization: Basic {base64(username:app_password)}

{
"input": {
"thread_id": 123,
"message": "Hello from the API!"
}
}

Usage Examples

Once connected, you can ask your AI assistant things like:

  • "Show me the messaging statistics"
  • "List conversations for user 42"
  • "Send a message to conversation 123 saying hello"
  • "Search for messages containing 'invoice'"
  • "Create a new conversation with user 5 saying welcome"
  • "Show me the moderation queue"
  • "Approve all safe pending messages"
  • "Blacklist user 7"
  • "Make user 10 a moderator in conversation 200"

Permissions

All abilities require WordPress administrator access (manage_options capability). The authenticated administrator has full access to all conversations and messages across the site.

Troubleshooting

Abilities not showing up in MCP? Make sure the WordPress MCP Adapter plugin is installed and activated. Better Messages abilities are registered with mcp.public = true and should appear automatically.

Authentication errors? For remote connections, make sure your site uses HTTPS (required for Application Passwords) and that the application password is entered correctly with spaces between each group.

"Ability not found" errors? Make sure Better Messages is activated and you are running WordPress 6.9 or higher. You can verify abilities are registered by visiting:

https://yoursite.com/wp-json/wp-abilities/v1/abilities

Feedback & Missing Features

This feature is under active development. If you need an ability that is not listed here or have suggestions for improvement, please contact us at support@better-messages.com — we would love to hear your feedback.