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
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 for the MainWP REST API:Application Passwords
Create an Application Password in WordPress under Users > Profile:Discovery Endpoints
These endpoints let you explore what abilities are available.List All Abilities
| Parameter | Type | Default | Description |
|---|---|---|---|
page | integer | 1 | Page number |
per_page | integer | 50 | Items per page (max 100) |
category | string | — | Filter by category slug |
Get Single Ability
List Categories
| Category | Abilities | Description |
|---|---|---|
mainwp-sites | 30 | Site management and monitoring |
mainwp-updates | 13 | Update detection and execution |
mainwp-clients | 11 | Client management |
mainwp-tags | 7 | Tag/group management |
mainwp-batch | 1 | Batch operation monitoring |
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
Each ability specifies whether it reads or modifies data:- GET — Read-only abilities (marked
readonly: true) - POST — Abilities that create, update, or delete data
Input Handling
GET requests: Omit theinput parameter to use schema defaults. URL-encoded JSON in query strings does not work reliably.
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:| Annotation | Type | Description |
|---|---|---|
readonly | boolean | True if ability only reads data |
destructive | boolean | True if ability deletes data |
idempotent | boolean | True if repeated calls have no additional effect |
instructions | string | Custom usage guidance |
Error Reference
Abilities API Errors
| Code | HTTP | Description |
|---|---|---|
ability_invalid_input | 400 | Input fails JSON Schema validation |
ability_missing_input_schema | 400 | Required input not provided |
ability_invalid_permissions | 403 | Permission callback returned false |
ability_invalid_output | 500 | Output fails validation |
rest_ability_not_found | 404 | Ability not registered |
rest_ability_invalid_method | 405 | Wrong HTTP method for ability type |
MainWP-Specific Errors
| Code | HTTP | Description |
|---|---|---|
mainwp_site_not_found | 404 | Site ID or domain not found |
mainwp_client_not_found | 404 | Client ID or email not found |
mainwp_tag_not_found | 404 | Tag ID not found |
mainwp_job_not_found | 404 | Batch job expired or not found |
mainwp_confirmation_required | 400 | Destructive operation missing confirm: true |
mainwp_site_offline | 503 | Site unreachable |
mainwp_module_not_available | 501 | Required module not active |
Feature-Gated Abilities
Some abilities require optional MainWP modules:| Module | Required For |
|---|---|
| Cost Tracker | get-site-costs-v1, get-client-costs-v1 |
| Logs | get-site-changes-v1 |
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