What You’ll Learn
- How the Abilities API enables discovery of MainWP capabilities
- Available ability categories and endpoints
- How to execute abilities and handle responses
- Error handling for AI agent integrations
Introduction
WordPress Developer Blog
Handbook
Full framework documentation
GitHub
Source and issues
How It Works
The Abilities API adds a discovery layer to WordPress. AI agents and automation tools query/wp-abilities/v1/abilities to see all available actions, their input schemas, output schemas, and behavioral annotations. This enables dynamic discovery of what operations are possible and automated parameter validation.
MainWP MCP Server
Connect Claude, VS Code Copilot, and Cursor to your MainWP Dashboard through the Model Context Protocol. The MCP Server exposes MainWP abilities as tools that AI assistants can call directly.
Prerequisites
- WordPress 6.9 or later
- MainWP Dashboard 6.0 or later
- WordPress user with
manage_optionscapability - API key with appropriate permissions
Base URL
All Abilities API endpoints use the WordPress Abilities namespace:Authentication
The Abilities API accepts any WordPress REST API authentication method.Bearer Token
Use the same API keys generated in Dashboard > API Access > API Keys > Add API Keys:Application Passwords
Create an Application Password in Dashboard > API Access > Application Passwords:Discovery Endpoints
These endpoints let you explore what abilities are available.List All Abilities
Get Single Ability
List Categories
Sites Abilities
30 abilities for site management
Updates Abilities
13 abilities for update management
Clients Abilities
11 abilities for client management
Tags Abilities
7 abilities for tag management
Executing Abilities
Endpoint
HTTP Methods
Choose the method from the ability’smeta.annotations:
- GET - Read-only abilities (
readonly: true), including those that require input. - DELETE - Non-read-only abilities with both
destructive: trueandidempotent: true. - POST - All other write abilities, including destructive abilities marked
idempotent: false.
mainwp/delete-tag-v1 uses DELETE, while mainwp/delete-site-v1 and mainwp/delete-client-v1 use POST. These methods follow WordPress Abilities method validation; using the wrong method returns rest_ability_invalid_method with HTTP 405.
Input Handling
MainWP Dashboard 6.2 supports the following input formats formainwp/* ability run routes.
GET requests: Omit input only when the ability’s schema supplies suitable defaults. To provide filters or required values, send the input object as JSON in the input_json query parameter. Use --data-urlencode with curl -G to encode it correctly:
input_json preserves JSON types such as booleans, arrays, and null for schema validation. The JSON value must be an object and must not exceed 8 KiB (8,192 bytes). Do not send both input and input_json. Legacy bracket-style query parameters remain supported, but a JSON string in the plain input parameter is not decoded by this adapter. Keep credentials out of query strings.
POST requests: Pass an input object in the JSON body:
application/json body containing only an input object. This keeps operation inputs out of the URL. For example, preview a tag deletion:
confirm: true and dry_run: false. The DELETE body must not exceed 1 MiB (1,048,576 bytes). Do not combine a body with input or input_json query parameters. Existing bracket-style input query parameters remain supported when no body is sent, but the JSON body is preferred. input_json is a GET-only parameter.
Malformed JSON, conflicting input sources, unsupported DELETE body formats, and input exceeding the transport limits return mainwp_abilities_invalid_input_transport with HTTP 400. Valid transport still has to pass the individual ability’s input schema and permission checks.
Response Format
Success
Abilities return their defined output schema directly:Errors
Error responses follow WordPress REST API conventions:Ability Annotations
Each ability includes metadata describing its behavior:
These annotations help AI agents make informed decisions about which abilities to call and in what order.
Error Reference
Abilities API Errors
MainWP-Specific Errors
Feature-Gated Abilities
Some abilities require optional MainWP modules:
If the required module is inactive, these abilities return a
mainwp_module_not_available error.
Related Resources
- MCP Server - Connect AI assistants to MainWP
- Sites Abilities - Site management abilities
- REST API Overview - Alternative REST API
- Batch Operations - Monitor batch jobs
