AI Content Strategist
Exposes Jetpack Stats data and content audit capabilities via the WordPress Abilities API for AI assistants through MCP.
by Anna McPhee · github.com/annacmc/ai-content-strategist · website
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/annacmc/ai-content-strategist/archive/refs/heads/main.zipA WordPress plugin that exposes Jetpack Stats data and content audit capabilities via the WordPress Abilities API, making them discoverable and callable by AI assistants through the Model Context Protocol (MCP).
Overview
This plugin bridges the gap between site analytics and content databases, enabling AI to synthesize both data sources to provide strategic content recommendations:
- What content to write next
- What existing content to revive or update
- What underperforming content to consider removing
Requirements
- WordPress 6.5+ (or WordPress with Abilities API installed)
- PHP 8.0+
- Jetpack (with active WordPress.com connection for Stats features)
- WordPress Abilities API
- WordPress MCP Adapter
Installation
Via Composer (Recommended)
cd wp-content/plugins/ai-content-strategist
composer install
Manual Installation
- Clone or download this plugin to
wp-content/plugins/ai-content-strategist - Install the required dependencies via Composer
- Activate the plugin in WordPress admin
Dependencies
This plugin requires the following Composer packages:
wordpress/abilities-api- Provides the ability registration systemwordpress/mcp-adapter- Bridges abilities to the MCP protocol
Registered Abilities
1. content-strategist/get-top-posts
Returns the site's top performing posts by views.
Input:
| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| days | integer | 30 | Period to analyze (7, 30, or 90) |
| limit | integer | 10 | Maximum results (1-50) |
Output: Array of objects with:
post_id- WordPress post IDtitle- Post titleurl- Permalinkviews- Total views in perioddate_published- ISO 8601 datecategories- Array of category names
Requires: Jetpack connection
2. content-strategist/get-search-terms
Returns search terms people used to find the site.
Input:
| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| days | integer | 30 | Period to analyze |
| limit | integer | 20 | Maximum results (1-100) |
Output: Array of objects with:
term- The search termcount- Number of searches
Requires: Jetpack connection
3. content-strategist/get-stale-drafts
Finds draft posts that have been sitting unfinished.
Input:
| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| days_old | integer | 180 | Find drafts older than this |
| limit | integer | 20 | Maximum results (1-50) |
Output: Array of objects with:
post_id- WordPress post IDtitle- Draft title (or "Untitled")excerpt- First 150 charactersdate_created- ISO 8601 datedate_modified- ISO 8601 datedays_since_modified- Days since last editcategories- Array of category namesword_count- Approximate word count
Requires: WordPress only (no Jetpack needed)
4. content-strategist/get-underperforming-posts
Finds published posts with low traffic.
Input:
| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| days_published | integer | 90 | Only posts older than this |
| max_views | integer | 100 | Views threshold |
| limit | integer | 20 | Maximum results (1-50) |
Output: Array of objects with:
post_id- WordPress post IDtitle- Post titleurl- Permalinkdate_published- ISO 8601 dateviews- Total viewscategories- Array of category namesword_count- Approximate word count
Requires: Jetpack connection
Testing
REST API
The REST API uses WordPress Application Passwords for authentication. Create one in WordPress admin under Users → Your Profile → Application Passwords.
List all registered abilities:
curl -X GET "https://your-site.com/wp-json/wp-abilities/v1/abilities" \
-u "username:xxxx xxxx xxxx xxxx xxxx xxxx"
Execute a read-only ability (uses GET with PHP array syntax for parameters):
curl -X GET "https://your-site.com/wp-json/wp-abilities/v1/abilities/content-strategist/get-stale-drafts/run?input[days_old]=90&input[limit]=5" \
-u "username:xxxx xxxx xxxx xxxx xxxx xxxx"
Execute a write ability (uses POST with JSON body):
curl -X POST "https://your-site.com/wp-json/wp-abilities/v1/abilities/example/write-ability/run" \
-u "username:xxxx xxxx xxxx xxxx xxxx xxxx" \
-H "Content-Type: application/json" \
-d '{"input": {"param": "value"}}'
Note: Read-only abilities (marked with readonly: true annotation) require GET requests with parameters passed as query string arrays. Write abilities require POST requests with JSON body.
MCP Inspector
Use Anthropic's MCP Inspector to verify abilities are exposed correctly via MCP.
Claude Desktop
Configure Claude Desktop with mcp-wordpress-remote pointing to your site to test AI interactions.
Example AI Workflow
Here's how an AI assistant might use these abilities:
-
Discovery: "What can this WordPress site do?"
- AI discovers the content-strategist abilities
-
Analysis: "Show me top performing content"
- Calls
get-top-postswithdays: 30, limit: 10
- Calls
-
Opportunity Finding: "What are people searching for?"
- Calls
get-search-termswithdays: 30, limit: 20
- Calls
-
Content Audit: "What drafts have I forgotten about?"
- Calls
get-stale-draftswithdays_old: 180
- Calls
-
Performance Review: "What published posts aren't getting traffic?"
- Calls
get-underperforming-postswithmax_views: 100
- Calls
-
Strategy Synthesis: "Based on all this, give me a content strategy"
- AI combines all data to provide strategic recommendations
Caching
Stats-related abilities implement 15-minute transient caching to reduce API calls to WordPress.com. Cache keys are based on the ability parameters.
Permissions
All abilities require the edit_posts capability. This ensures only authenticated users with content editing permissions can access the data.
Error Handling
When Jetpack is not connected, stats abilities return a WP_Error with:
- Code:
jetpack_not_connected - Status: 503 (Service Unavailable)
- Message: Instructions to connect Jetpack
Hooks
The plugin hooks into:
wp_abilities_api_init- Register abilitiesplugins_loaded- Initialize pluginadmin_notices- Show Jetpack connection warnings
File Structure
ai-content-strategist/
├── ai-content-strategist.php # Main plugin file
├── composer.json # Dependencies
├── includes/
│ ├── class-plugin.php # Main plugin class
│ ├── class-stats-abilities.php # Jetpack Stats abilities
│ └── class-content-abilities.php # Content audit abilities
└── README.md # This file
License
GPL-2.0-or-later
Contributing
Contributions are welcome! Please ensure code follows WordPress coding standards and includes appropriate documentation.