AI Services
This WordPress plugin introduces central infrastructure which allows other plugins to make use of AI capabilities. It exposes APIs that can be used in various contexts, whether you need to use AI capabilities in server-side or client-side code. Furthermore, the APIs are agnostic of the AI service – whether that’s Anthropic, Google, or OpenAI, to only name a few, you can use any of them in the same way. You can also register your own implementation of another service, if it is not supported out of the box. The plugin does intentionally not come with specific AI driven features built-in, except for an AI Playground screen to explore AI capabilities as well as a settings screen to configure AI service credentials. The purpose of this plugin is to facilitate use of AI by other plugins. As such, it is a perfect use-case for plugin dependencies. Here’s a (non-comprehensive) feature list: Abstraction layer and APIs to communicate with any AI service in a uniform way APIs are available in both PHP and in JavaScript, as well as via the WordPress REST API and WP-CLI commands Currently supports the following AI capabilities (with more on the way!): text generation (including text streaming for more immediate feedback to users) text chats with history multimodal input function calling image generation AI Playground administration screen (in the Tools menu) allows exploring the different AI capabilities Explore all AI capabilities supported by the plugin via user interface Select which AI service and model to use and set a few advanced configuration parameters Define your own function declarations used for AI function calling Generate images and save them to the WordPress media library Exchange the AI service or model on the fly to continue a chat started with one model with another one AI Services settings screen to configure services with API credentials Built-in AI service implementations Anthropic (Claude) Google (Gemini, Imagen) Mistral OpenAI (GPT, Dall-E) Perplexity (Sonar) xAI (Grok) Browser (client-side only; experimental support for Chrome’s built-in AI APIs and Edge’s built-in AI APIs) Additional AI service integrations can be registered and will then be available in the same way as built-in ones Disclaimer: The AI Services plugin is still in its early stages, with a limited feature set and more being added. A crucial part of refining the plugin is shaping the APIs to make them easy to use and cover the different generative AI capabilities that the AI services offer in a uniform way. That’s why your feedback is much appreciated! Why? A centralized AI infrastructure facilitates user choice. Users may prefer certain AI services over other ones, and for many common tasks, either of the popular AI services is suitable. Having a common API regardless of the AI service allows leaving the choice to the user, rather than the plugin author. Since the centralized AI infrastructure comes with a common API that works the same for every AI service, it means plugin developers don’t have to spend as much time familiarizing themselves with different services, at least when it comes to simple tasks. For tasks where certain services may have advantages over others, there is still flexibility to focus on a specific AI service. It also means no more reinventing the wheel: Since most AI services do not provide PHP SDKs for their APIs, many times this means WordPress plugins that want to leverage AI have to implement their own layer around the service’s API. Not only is that time consuming, it also distracts from working on the actual (AI driven) features that the plugin should offer to its users. In fact this directly facilitates the user choice aspect mentioned, as having APIs for various AI services already provided means you can simply make those available to your plugin users. Having central AI infrastructure available unlocks AI capabilities for smaller plugins or features: It may not be worth the investment to implement a whole AI API layer for a simple AI driven feature, but when you already have it available, it can lead to more plugins (and thus more users) benefitting from AI capabilities. Last but not least, a central AI infrastructure means users will only have to configure the AI API once, e.g. paste their API keys only in a single WordPress administration screen. Without central AI infrastructure, every plugin has to provide its own UI for pasting API keys, making the process more tedious for site owners the more AI capabilities their site uses. Integration with third party services While the plugin APIs allow registering custom AI services, the plugin comes with a few popular AI services built-in. These AI services rely on the respective third party API. Their use is optional and it is up to you to choose which third party service you would like to use or whether you would like to use multiple. The use of the third party AI services is subject to the respective terms of service. The following third party services are supported out of the box: Anthropic (Claude) Anthropic Consumer Terms of Service Anthropic Commercial Terms of Service Anthropic Privacy Policy Google (Gemini, Imagen) Google Terms of Service Google AI Terms of Service Google Privacy Policy Mistral Mistral Terms of Service Mistral Privacy Policy OpenAI (GPT, Dall-E) OpenAI Terms of Use OpenAI Privacy Policy Perplexity (Sonar) Perplexity Terms of Service Perplexity Privacy Policy xAI (Grok) xAI Terms of Service – Consumer xAI Terms of Service – Enterprise xAI Privacy Policy Code examples for using the API Generate the answer to a prompt in PHP code: use Felix_Arntz\AI_Services\Services\API\Enums\AI_Capability; use Felix_Arntz\AI_Services\Services\API\Helpers; if ( ai_services()->has_available_services() ) { $service = ai_services()->get_available_service(); try { $candidates = $service ->get_model( array( 'feature' => 'my-test-feature', 'capabilities' => array( AI_Capability::TEXT_GENERATION ), ) ) ->generate_text( 'What can I do with WordPress?' ); $text = Helpers::get_text_from_contents( Helpers::get_candidate_contents( $candidates ) ); echo $text; } catch ( Exception $e ) { // Handle the exception. } } Generate the answer to a prompt in JavaScript code: const helpers = aiServices.ai.helpers; const { hasAvailableServices, getAvailableService } = wp.data.select( 'ai-services/ai' ); if ( hasAvailableServices() ) { const service = getAvailableService(); try { const candidates = await service.generateText( 'What can I do with WordPress?', { feature: 'my-test-feature' } ); const text = helpers.getTextFromContents( helpers.getCandidateContents( candidates ) ); console.log( text ); } catch ( error ) { // Handle the error. } } Generate the answer to a prompt using WP-CLI: wp ai-services generate-text "What can I do with WordPress?" --feature=my-test-feature You can also use a specific AI service, if you have a preference, for example the google service. Generate the answer to a prompt using a specific AI service, in PHP code: use Felix_Arntz\AI_Services\Services\API\Enums\AI_Capability; use Felix_Arntz\AI_Services\Services\API\Helpers; if ( ai_services()->is_service_available( 'google' ) ) { $service = ai_services()->get_available_service( 'google' ); try { $candidates = $service ->get_model( array( 'feature' => 'my-test-feature', 'capabilities' => array( AI_Capability::TEXT_GENERATION ), ) ) ->generate_text( 'What can I do with WordPress?' ); $text = Helpers::get_text_from_contents( Helpers::get_candidate_contents( $candidates ) ); echo $text; } catch ( Exception $e ) { // Handle the exception. } } Refer to the plugin documentation for granular examples including explainers. For complete examples such as entire plugins built on top of the AI Services infrastructure, please see the examples directory on GitHub.
Enable Abilities for MCP
Enable Abilities for MCP gives you full control over which WordPress Abilities are available to AI assistants through the MCP (Model Context Protocol) Adapter. WordPress 6.9 introduced the Abilities API, allowing external tools to discover and execute actions on your site. This plugin extends that functionality by registering a comprehensive set of content management abilities and providing a simple admin interface to toggle each one on or off. Connect from claude.ai with just a URL Since version 2.1 the plugin ships an embedded OAuth 2.1 server built for claude.ai custom connectors. Add your site in claude.ai → Settings → Connectors, log in with your WordPress user, approve the consent screen — connected. No Client ID, no Application Password, no local configuration. Works from the claude.ai web app, mobile apps, and Claude Desktop Each team member authenticates with their own WordPress account and role — a subscriber can never do what only an editor should Every ability execution lands in the activity log under the real user’s name Works on single sites, subdirectory installs, and multisite networks (network-activate so the main site serves the OAuth discovery documents for every subsite) Prefer tokens? Application Passwords (per-user) and a single-admin Bearer token connect Claude Desktop / Claude Code, OpenAI Codex CLI, and Google Antigravity — the Connection tab generates ready-to-paste configuration for each client, and fills in your credentials automatically. Features 102 abilities organized in 21 categories: Core, Read, Write, SEO (Rank Math), SEO (SEOPress), SEO (Yoast), Navigation Menus, Utility, Multilanguage, Custom Post Types, WooCommerce, The Events Calendar, Code Snippets, JetEngine Options Pages, JetEngine Query Builder, Elementor, LearnDash, Tutor LMS, AI Agent Readiness (llms.txt), FSE Block Templates, and Accessibility (WCAG) WooCommerce integration — dedicated abilities to manage products, orders, and customers using the native WooCommerce API (HPOS-compatible, formally declared) The Events Calendar integration — list, get, create, and update events with venue, organizer, and date filters claude.ai OAuth custom connector — connect from claude.ai (web, mobile, or desktop) with zero local setup: an embedded OAuth 2.1 server with Client ID Metadata Document (CIMD) support lets each user log in with their own WordPress account and role Admin dashboard with toggle switches for each ability Per-ability control — expose only what you need Third-party ability control — abilities registered by other MCP-ready plugins (e.g. Fluent Forms) appear in the same dashboard, grouped by plugin, with the same per-ability toggles; disabling one removes it from every MCP server on the site Secure by design — proper capability checks, input sanitization, and per-post permission validation WPCS compliant — fully passes WordPress Coding Standards (phpcs) MCP-ready — all abilities include show_in_rest and mcp.public metadata Available Abilities Read (safe, query-only): Get posts with filters (status, category, tag, search) Get single post details (content, SEO meta, featured image) Get categories, tags, pages, comments, media, and users Write (create & modify): Create, update, and delete posts Create categories and tags Create pages Moderate comments Reply to comments as the authenticated user Upload images from external URLs to the media library (with optional auto-assign as featured image) Duplicate any post, page, or custom post type item — including all post meta (ACF, SEO, featured image) and taxonomy terms; saved as a draft by default Assign a custom taxonomy’s terms to a post or page (e.g. a taxonomy registered by a companion plugin) SEO — Rank Math: Get full Rank Math metadata for any post/page (title, description, keywords, robots, Open Graph, SEO score) Update Rank Math metadata: SEO title, description, focus keyword, canonical URL, robots, Open Graph, primary category, pillar content SEO — SEOPress: Get full SEOPress metadata for any post/page (title, description, focus keyword, robots, canonical, Open Graph, Twitter Card) Update SEOPress metadata: SEO title, description, focus keyword, canonical URL, robots directives, Open Graph, Twitter Card SEO — Yoast SEO: Get full Yoast SEO metadata for any post/page (title, description, focus keyphrase, canonical, robots, Open Graph, Twitter Card) Update Yoast SEO metadata: SEO title, description, focus keyphrase, canonical URL, robots (noindex, nofollow, advanced), Open Graph, Twitter Card Get Yoast sitemap index — fetch and parse the sitemap index, returning all registered sitemap URLs with last modification date Custom Post Types: List all registered custom post types with configuration and taxonomies Get items from any CPT with filtering, search, and taxonomy queries Get full details of a CPT item including all meta fields (WooCommerce, ACF, JetEngine, etc.) Create, update, and delete CPT items with taxonomy and meta field support Get CPT taxonomies with their terms Assign taxonomy terms to CPT items Read term meta by exact key, or all meta for a term Write a term meta field by exact key Update a term’s core fields: name, slug, description, or parent WooCommerce: List products with price, SKU, stock status, categories, and type Get full product detail including gallery, attributes, and variations Update product price, sale price, stock quantity, and status List orders with customer, total, status, and date (HPOS-compatible) Get full order detail: line items, billing/shipping, totals, and notes Update order status with optional note List customers with email, name, total spent, and order count The Events Calendar: List events with start/end date, venue, organizer, and date range filter Get full event detail with resolved venue address and organizer contact Create new events with title, description, dates, venue, and organizer Update existing events Navigation Menus: List menus with item counts and theme locations, and get one menu’s full item hierarchy Create a new menu, and add pages, posts, categories, tags, or custom URLs as items (with parent and position) Update an item’s title, URL, parent, or position Remove an item, assign a menu to a theme location, or delete a menu entirely (opt-in — destructive) Tutor LMS: Read a lesson’s video source configuration (type, value, and runtime) Set a lesson’s video source (external URL, YouTube, Vimeo, HTML5, or a third-party source such as Bunny.net) using Tutor’s own storage function — avoids the string-only limitation of the generic Update Post Meta ability, which Tutor cannot read back List courses, and get a single course’s full detail with its topics/lessons hierarchy Get a user’s enrollment status and completion progress for a course Get a user’s quiz attempt results, optionally filtered to a single quiz Enroll a user in a course, and unenroll them (both opt-in, manage_options only) Multilanguage: Assign a language to an existing post via Polylang or WPML Link two posts as translations of each other in the same translation group Get the full translation map for a post: language, post ID, title, permalink, and status for each translation LearnDash: List courses with enrollment count, and get a single course’s full detail (lessons, topics, quizzes) Get a user’s enrollment status/progress and quiz results for a course Enroll or unenroll a user in a course (opt-in — write, manage_options) JetEngine Options Pages: List all registered Options Pages with their field schema Get all fields and current values for an Options Page by slug Update a single Options Page field, including repeater rows (opt-in — write) JetEngine Query Builder: List all Query Builder queries with id, name, and query type Get the full settings of one query by id Update an existing query’s name, type, or arguments — the missing counterpart to JetEngine’s own native “Add Query” MCP tool, which has no edit/get/list equivalent (opt-in — write) Elementor: Get a compact, read-only tree of an Elementor page/template (element ids, types, text preview) Update an Elementor element’s settings by id — single or batch edits (opt-in — write) Bind a widget setting to a dynamic tag: post title, or a JetEngine/meta field (opt-in — write) Code Snippets: Create a PHP code snippet via the Code Snippets plugin — always saved as inactive, activate manually from wp-admin. Validates PHP syntax and blocks dangerous functions (eval, exec, shell_exec, and more) AI Agent Readiness (llms.txt): Fetch and validate the site’s llms.txt against the llmstxt.org spec, with actionable issues Write llms.txt content — routes automatically to SEOPress Pro’s option when active, or serves it directly (opt-in — write) FSE Block Templates: List all wp_template and wp_template_part entries for the active theme, merging theme-file defaults with database overrides Get the full block markup for one template or template part by slug Write new block markup to a template or template part — creates a database override automatically when the target is still a theme default; rejects content with unbalanced block-comment delimiters (opt-in — write, edit_theme_options) Accessibility (WCAG): Scan the media library for images missing alt text (WCAG 1.1.1 Non-text Content), paginated Utility: Search and replace text in post content Site statistics overview (includes custom post type counts) Update any post meta field by exact key (with protected internal key blocklist) Requirements WordPress 6.9 or later (Abilities API) MCP Adapter plugin installed and configured PHP 8.0 or later