PHPackages                             automattic/wp-feature-api - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. automattic/wp-feature-api

AbandonedArchivedLibrary[API Development](/categories/api)

automattic/wp-feature-api
=========================

A system for exposing WordPress functionality in a standardized, discoverable way for both server and client-side use

0.1.8(9mo ago)180100.4k—8.5%27[16 issues](https://github.com/Automattic/wp-feature-api/issues)[1 PRs](https://github.com/Automattic/wp-feature-api/pulls)1GPL-2.0-or-laterPHPPHP &gt;=7.2.24

Since Mar 20Pushed 8mo ago15 watchersCompare

[ Source](https://github.com/Automattic/wp-feature-api)[ Packagist](https://packagist.org/packages/automattic/wp-feature-api)[ RSS](/packages/automattic-wp-feature-api/feed)WikiDiscussions trunk Synced 1mo ago

READMEChangelog (8)Dependencies (5)Versions (33)Used By (1)

This repository will be deprecated as the [Abilities API](https://github.com/WordPress/abilities-api) AI Building Block for WordPress continues releasing stable versions, and becomes a core API in WordPress 6.9.

We encourage all users to migrate to Abilities API. Future work, including new features and fixes, will happen there. This repository will remain available in archived form for historical reference.

WordPress Feature API
=====================

[](#wordpress-feature-api)

The WordPress Feature API is a system for exposing WordPress functionality in a standardized, discoverable way for both server and client-side use. It's designed to make WordPress functionality accessible to AI systems (particularly LLMs) and developers through a unified registry of resources and tools.

Key Features
------------

[](#key-features)

- **Unified Registry**: Central registry of features accessible from both client and server
- **Standardized Format**: uses the MCP specification for the registry
- **Reuses existing functionality**: existing WordPress functionality like REST endpoints are reused as features, making them more discoverable and easier to use by LLMs
- **Filterable**: Features can be filtered, categorized, and searched for more accurate feature matching
- **Extensible**: Easy to register new features from plugins and themes

Project Structure
-----------------

[](#project-structure)

This project is structured as a monorepo using npm workspaces:

- **`packages/client`**: The core client-side SDK (`@automattic/wp-feature-api`). Provides the API (`registerFeature`, `executeFeature`, `Feature` type) for interacting with the feature registry on the frontend and manages the underlying data store. Third-party plugins can use this to register their own client-side features.
- **`packages/client-features`**: A library containing implementations of standard client-side features (e.g., block insertion, navigation). It depends on the client SDK and is used by the main plugin to register the core features for WordPress.
- **`demo/wp-feature-api-agent`**: A demo WordPress plugin showcasing how to use the Feature API, including registering features, and implementing WP Features as tools in a Typescript based AI Agent.
- **`src/`**: Contains the main JavaScript entry point (`src/index.js`) for the core WordPress plugin. This script initializes the client SDK and registers the core client features when the plugin is active.
- **`wp-feature-api.php`** &amp; **`includes/`**: Contains the core PHP logic for the Feature API, including the registry, REST API endpoints, and server-side feature definitions. This is exported as a Composer package for use in other plugins.

MCP
---

[](#mcp)

It relies heavily on the [MCP Specification](https://spec.modelcontextprotocol.io/specification/2025-03-26/), however it's tailored to the needs of WordPress. Since WordPress is by nature both the server and the client, the Feature API is designed to be used in both contexts, and leverage existing WordPress functionality.

Features may surface in an actual WP MCP server consumed by an external MCP client. The main difference is that the features are compatible across the server and client, allowing for WordPress to execute features itself on both the backend and frontend.

Note, this does not implement the MCP server and transport layer. However, the feature registry may be used by an MCP server like Automattic's [wordpress-mcp](https://github.com/Automattic/wordpress-mcp) plugin.

Features are not limited to LLM consumption and can be used throughout WordPress directly as a primitive API for generic functionality. Hence the more generic name of "Feature API" instead of "MCP API".

Filtering
---------

[](#filtering)

An important aspect of the Feature API is its ability to filter features manually and automatically. Since the success of an LLM agent will depend on the quality of tools that match the user's intent or current context within WordPress, the Feature API provides several mechanisms to ensure that the right tools are available at the right time.

Filtering can be done by:

- Querying feature properties
- Keyword search across name, description, and ID.
- Categories
- `is_eligible` boolean callback
- Context matching for when we already have some context and want Features that can be fulfilled using that context.

Getting Started
---------------

[](#getting-started)

### Development

[](#development)

#### Installation

[](#installation)

1. Clone the repository.
2. Run `npm run setup` to install all dependencies (both PHP and JavaScript).

#### Building

[](#building)

Run `npm run build` from the root directory. This command will build all the JavaScript packages (`client`, `client-features`, `demo`) and the main plugin script (`src/index.js`).

### Using WordPress Feature API in Your Plugin via Composer

[](#using-wordpress-feature-api-in-your-plugin-via-composer)

Plugin developers should include the WordPress Feature API in their plugins using Composer. The Feature API will automatically handle version conflicts when multiple plugins include it.

#### 1. Add as a Composer dependency

[](#1-add-as-a-composer-dependency)

Manually adding to your `composer.json` file:

```
{
  "require": {
    "automattic/wp-feature-api": "^0.1.8" // Make sure to use the latest version
  }
}
```

If using the `composer` command in the terminal:

```
composer require automattic/wp-feature-api:"^0.1.8"
```

#### 2. Load the Feature API in your plugin

[](#2-load-the-feature-api-in-your-plugin)

To safely load the Feature API:

```
// Plugin bootstrap code
function my_plugin_init() {
    // Just include the main plugin file - it automatically registers itself with the version manager
    require_once __DIR__ . '/vendor/automattic/wp-feature-api/wp-feature-api.php';

    // Register our features once we know API is initialized
    add_action( 'wp_feature_api_init', 'my_plugin_register_features' );
}

// hook into plugins_loaded - the Feature API will resolve which version to use
add_action( 'plugins_loaded', 'my_plugin_init' );

/**
 * Register features provided by this plugin
 */
function my_plugin_register_features() {
    // Register your features here
    wp_register_feature( array(
        'id' = 'my-plugin/example-feature',
        'name' => 'Example Feature',
        'description' => 'An example feature from my plugin',
        'callback' => 'my_plugin_example_feature_callback',
        'type' => 'tool',
        'input_schema' => array(
            'type' => 'object',
            'properties' => array(
                'example_param' => array(
                    'type' => 'string',
                    'description' => 'An example parameter',
                ),
            ),
        ),
    ) );
}
```

### Running the Demo

[](#running-the-demo)

1. Ensure dependencies are installed and code is built (see above).
2. Use `@wordpress/env` (or your preferred local WordPress environment such as Studio) to start WordPress. You can use `npm run wp-env start` from the root directory.
3. Activate the "WordPress Feature API" plugin.
4. The demo plugin (`wp-feature-api-agent`) should load automatically (controlled by the `WP_FEATURE_API_LOAD_DEMO` constant in `wp-feature-api.php`). You should see an admin notice confirming this.
5. Navigate to the "WP Feature Agent Demo" page added under the Settings menu in the WordPress admin to configure your OpenAI API key.
6. Refresh and see the AI Agent chat interface.
7. Ask the AI Agent questions about your WordPress site and features. It has access to both server-side and client-side features.

Contributing
------------

[](#contributing)

We welcome contributions! Please see our [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to this project.

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance56

Moderate activity, may be stable

Popularity52

Moderate usage in the ecosystem

Community29

Small or concentrated contributor base

Maturity34

Early-stage or recently created project

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~12 days

Recently: every ~20 days

Total

8

Last Release

287d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7c5869ecbb8e0eac7e8b8e0f3cf7bdd8d5fcdc4abc10a72281872c53f8639d44?d=identicon)[automattic](/maintainers/automattic)

---

Top Contributors

[![greghunt](https://avatars.githubusercontent.com/u/1238407?v=4)](https://github.com/greghunt "greghunt (65 commits)")[![jorgefilipecosta](https://avatars.githubusercontent.com/u/11271197?v=4)](https://github.com/jorgefilipecosta "jorgefilipecosta (31 commits)")[![peterfabian](https://avatars.githubusercontent.com/u/2207451?v=4)](https://github.com/peterfabian "peterfabian (16 commits)")[![Jameswlepage](https://avatars.githubusercontent.com/u/36246732?v=4)](https://github.com/Jameswlepage "Jameswlepage (11 commits)")[![ryanwelcher](https://avatars.githubusercontent.com/u/1259027?v=4)](https://github.com/ryanwelcher "ryanwelcher (4 commits)")[![priethor](https://avatars.githubusercontent.com/u/27339341?v=4)](https://github.com/priethor "priethor (4 commits)")[![jonathanbossenger](https://avatars.githubusercontent.com/u/180629?v=4)](https://github.com/jonathanbossenger "jonathanbossenger (2 commits)")[![jeffpaul](https://avatars.githubusercontent.com/u/2818133?v=4)](https://github.com/jeffpaul "jeffpaul (1 commits)")[![galatanovidiu](https://avatars.githubusercontent.com/u/2674748?v=4)](https://github.com/galatanovidiu "galatanovidiu (1 commits)")[![glendaviesnz](https://avatars.githubusercontent.com/u/3629020?v=4)](https://github.com/glendaviesnz "glendaviesnz (1 commits)")[![emdashcodes](https://avatars.githubusercontent.com/u/689165?v=4)](https://github.com/emdashcodes "emdashcodes (1 commits)")

---

Tags

apiwordpressaillmfeatures

###  Code Quality

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/automattic-wp-feature-api/health.svg)

```
[![Health](https://phpackages.com/badges/automattic-wp-feature-api/health.svg)](https://phpackages.com/packages/automattic-wp-feature-api)
```

###  Alternatives

[wordpress/mcp-adapter

Adapter for Abilities API, letting WordPress abilities to be used as MCP tools, resources or prompts

74855.8k1](/packages/wordpress-mcp-adapter)[deepseek-php/deepseek-php-client

deepseek PHP client is a robust and community-driven PHP client library for seamless integration with the Deepseek API, offering efficient access to advanced AI and data processing capabilities.

47073.9k5](/packages/deepseek-php-deepseek-php-client)[wordpress/wp-ai-client

An AI client and API for WordPress to communicate with any generative AI models of various capabilities using a uniform API.

11117.5k1](/packages/wordpress-wp-ai-client)[wordpress/php-ai-client

A provider agnostic PHP AI client SDK to communicate with any generative AI models of various capabilities using a uniform API.

26236.6k14](/packages/wordpress-php-ai-client)[wp-graphql/wp-graphql-woocommerce

WooCommerce bindings for WPGraphQL

69146.8k](/packages/wp-graphql-wp-graphql-woocommerce)[claude-php/claude-php-sdk-laravel

Laravel integration for the Claude PHP SDK - Anthropic Claude API

5010.8k](/packages/claude-php-claude-php-sdk-laravel)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
