Skip to content
  1. Blog

Announcing Acorn AI

Ben Word Ben Word

WordPress 6.9 introduced the Abilities API — a standardized way to define capabilities that AI agents can invoke via REST and the WordPress MCP Adapter. Around the same time, Laravel shipped laravel/ai, bringing first-class AI provider support to the framework.

We built roots/acorn-ai to bring both of these together in a way that feels natural for Acorn developers.

The problem

Registering a WordPress ability today means wiring up plain PHP callables and manually bootstrapping any dependencies they need. There’s no dependency injection, no container resolution, and nothing connecting your WordPress abilities to the AI providers you’re already configuring in your Laravel app.

The solution

Acorn AI lets you define abilities as Laravel-style classes, resolved through Acorn’s service container. Your abilities get full constructor injection, and laravel/ai is wired up automatically — so you can call OpenAI, Anthropic, Gemini, or any other supported provider from the same config you’re already familiar with.

Installation

$ composer require roots/acorn-ai

Publish the WordPress-specific config:

$ wp acorn vendor:publish --provider="Roots\AcornAi\AcornAiServiceProvider" --tag=ai-wordpress-config

Publish the AI provider config:

$ wp acorn vendor:publish --provider="Laravel\Ai\AiServiceProvider" --tag=ai-config

Defining abilities

Generate a new ability with:

$ wp acorn make:ability SummarizePost

This creates app/Ai/Abilities/SummarizePostAbility.php. Because abilities are resolved through the container, constructor injection works as expected:

class SummarizePostAbility extends Ability
{
    public function __construct(private PostRepository $posts) {}

    public function execute(array $input): mixed
    {
        return AnonymousAgent::make(
            instructions: 'Summarize this post in 2-3 sentences.',
            messages: [],
            tools: [],
        )->prompt($this->posts->getContent($input['post_id']))->text;
    }
}

Register the ability in config/ai-wordpress.php:

'abilities' => [
    \App\Ai\Abilities\SummarizePostAbility::class,
],

MCP Adapter support

Abilities can be exposed as MCP tools for AI agents like Claude or Cursor by setting mcp.public in the meta() method:

public function meta(): array
{
    return [
        'mcp' => ['public' => true],
    ];
}

When the WordPress MCP Adapter plugin is active, any ability with this flag is automatically surfaced — no additional configuration needed.

How it works

Acorn AI hooks into wp_abilities_api_init and iterates your configured ability classes, resolving each one through the Laravel service container before passing the callbacks to wp_register_ability(). This means your execute and permission callbacks have access to any service bound in the container, while WordPress core handles the REST routing, input validation, and schema enforcement.

laravel/ai is included as a dependency and auto-registers via Acorn’s package discovery — so make:agent, make:tool, and the full provider configuration are available out of the box.

Acorn AI v0.1.0 is available now. Check out the repository to get started.

Discuss this post on Roots Discourse

About the author

Ben Word

Ben Word has been creating WordPress sites since 2004. He loves dogs, climbing, and yoga, and is passionate about helping people build awesome things on the web.

Subscribe for updates

Join over 8,000 subscribers on our newsletter to get the latest Roots updates and tips on building better WordPress sites

Looking for WordPress plugin recommendations, the newest modern WordPress projects, and general web development tips and articles?

One last step! Check your email for a verification link.