PHPackages                             wpboilerplate/wpb-mcp-servers-list - 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. wpboilerplate/wpb-mcp-servers-list

ActiveLibrary[API Development](/categories/api)

wpboilerplate/wpb-mcp-servers-list
==================================

Composer library to retrieve all MCP servers registered in WordPress via the MCP Adapter plugin. Provides typed data objects and an optional REST endpoint. Styling and display are intentionally left to the consuming plugin.

v0.0.1(2w ago)049↑1002%GPL-2.0-or-laterPHPPHP &gt;=7.4

Since May 25Pushed 2w agoCompare

[ Source](https://github.com/WPBoilerplate/wpb-mcp-servers-list)[ Packagist](https://packagist.org/packages/wpboilerplate/wpb-mcp-servers-list)[ Docs](https://github.com/WPBoilerplate/wpb-mcp-servers-list)[ RSS](/packages/wpboilerplate-wpb-mcp-servers-list/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (2)Versions (2)Used By (0)

wpb-mcp-servers-list
====================

[](#wpb-mcp-servers-list)

> A Composer library that retrieves all MCP servers registered in WordPress via the [MCP Adapter](https://github.com/WordPress/mcp-adapter) plugin.

**This package is intentionally display-free.** It provides typed PHP data objects and an optional REST endpoint. How the data is styled and rendered is entirely up to the consuming plugin.

---

Requirements
------------

[](#requirements)

DependencyVersionPHP&gt;= 7.4WordPress&gt;= 6.8[Jetpack Autoloader](https://github.com/Automattic/jetpack-autoloader)^5.0 (≥ v5.0.18, Composer dependency)[MCP Adapter plugin](https://github.com/WordPress/mcp-adapter)&gt;= 0.5.0 (soft dependency)The package works gracefully when MCP Adapter is not active — `get_servers()` simply returns an empty array and `is_adapter_available()` returns `false`.

---

Installation
------------

[](#installation)

```
composer require wpboilerplate/wpb-mcp-servers-list
```

Make sure your plugin loads the **Jetpack Autoloader** (installed alongside this package):

```
require_once __DIR__ . '/vendor/autoload_packages.php';
```

> This package uses [Jetpack Autoloader](https://github.com/Automattic/jetpack-autoloader) instead of the standard Composer autoloader to prevent class-version conflicts when multiple plugins require the same package. Always load `vendor/autoload_packages.php`, **not** `vendor/autoload.php`.

---

Usage
-----

[](#usage)

### 1. Collect server data

[](#1-collect-server-data)

MCP Adapter registers servers during `rest_api_init` at priority 15. You must collect **after** that:

```
use WPBoilerplate\McpServersList\McpServersList;

// Option A – one-liner bootstrap (registers the hook automatically)
add_action( 'plugins_loaded', [ McpServersList::class, 'bootstrap' ] );

// Option B – manual hook (more control)
add_action( 'rest_api_init', function () {
    McpServersList::instance()->collect();
}, 20 );
```

### 2. Read the data

[](#2-read-the-data)

```
use WPBoilerplate\McpServersList\McpServersList;

$servers = McpServersList::instance()->get_servers();
// $servers → ServerData[]

foreach ( $servers as $server ) {
    echo $server->get_name();         // "WordPress MCP Server"
    echo $server->get_id();           // "default"
    echo $server->get_version();      // "0.5.0"
    echo $server->get_endpoint_url(); // "https://example.com/wp-json/wp/mcp/v1/mcp"

    foreach ( $server->get_tools() as $tool ) {
        echo $tool->get_name();        // "discover_abilities"
        echo $tool->get_description(); // "..."
    }

    foreach ( $server->get_resources() as $resource ) {
        echo $resource->get_name();
        echo $resource->get_uri();
        echo $resource->get_description();
    }

    foreach ( $server->get_prompts() as $prompt ) {
        echo $prompt->get_name();
        echo $prompt->get_description();
    }
}
```

### 3. Optional REST endpoint

[](#3-optional-rest-endpoint)

Register the built-in endpoint so your admin JS can fetch server data:

```
use WPBoilerplate\McpServersList\RestEndpoint;

add_action( 'rest_api_init', function () {
    // Default: GET /wp-json/wpb-mcp-servers-list/v1/servers  (requires manage_options)
    RestEndpoint::register();

    // Custom namespace / capability at registration time:
    // RestEndpoint::register( 'read', 'my-plugin/v1', '/mcp-servers' );
}, 20 );
```

The endpoint is **admin-only by default** (`manage_options`). Use the `wpb_mcp_servers_list_rest_capability` filter to change the required capability at runtime:

```
// Allow editors to access the endpoint:
add_filter( 'wpb_mcp_servers_list_rest_capability', function ( string $cap ): string {
    return 'edit_posts';
} );

// Allow any logged-in user:
add_filter( 'wpb_mcp_servers_list_rest_capability', function ( string $cap ): string {
    return 'read';
} );
```

> **Note:** The filter takes precedence over the `$capability` argument passed to `RestEndpoint::register()`. Non-admin users always receive a `401 Unauthorized` response if neither the argument nor the filter grants them access.

Response shape:

```
{
    "adapter_available": true,
    "servers": [
        {
            "id": "default",
            "name": "WordPress MCP Server",
            "description": "...",
            "version": "0.5.0",
            "endpoint_url": "https://example.com/wp-json/wp/mcp/v1/mcp",
            "route_namespace": "wp/mcp/v1",
            "route": "/mcp",
            "tools": [
                { "name": "discover_abilities", "description": "..." }
            ],
            "resources": [],
            "prompts": []
        }
    ]
}
```

### 4. Check adapter availability

[](#4-check-adapter-availability)

```
if ( McpServersList::is_adapter_available() ) {
    // MCP Adapter plugin is active
}
```

---

API Reference
-------------

[](#api-reference)

### `McpServersList`

[](#mcpserverslist)

MethodReturnsDescription`::instance()``McpServersList`Get singleton instance`::bootstrap()``void`Register `collect()` on `rest_api_init` at priority 20`::is_adapter_available()``bool`Check if MCP Adapter is active`->collect()``void`Collect all registered servers (idempotent)`->get_servers()``ServerData[]`All collected servers`->get_server( $id )``ServerData|null`Single server by ID`->has_servers()``bool`Whether any servers were collected`->is_collected()``bool`Whether `collect()` has run### `RestEndpoint`

[](#restendpoint)

MethodDescription`::register( $capability, $namespace, $route )`Register the REST endpoint (admin-only by default)`::get_schema()`Get the JSON schema for the responseConstants: `RestEndpoint::NAMESPACE`, `RestEndpoint::ROUTE`

**Filter:** `wpb_mcp_servers_list_rest_capability` — override the required WordPress capability at runtime.

```
// Default behaviour (administrators only):
// apply_filters( 'wpb_mcp_servers_list_rest_capability', 'manage_options' )
```

### `ServerData`

[](#serverdata)

MethodReturns`get_id()``string``get_name()``string``get_description()``string``get_version()``string``get_endpoint_url()``string``get_route_namespace()``string``get_route()``string``get_tools()``ToolData[]``get_resources()``ResourceData[]``get_prompts()``PromptData[]``to_array()``array`### `ToolData` / `PromptData`

[](#tooldata--promptdata)

`get_name()`, `get_description()`, `to_array()`

### `ResourceData`

[](#resourcedata)

`get_name()`, `get_uri()`, `get_description()`, `to_array()`

---

Changelog
---------

[](#changelog)

See [CHANGELOG.md](CHANGELOG.md).

---

License
-------

[](#license)

GPL-2.0-or-later — see [LICENSE](LICENSE).

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance97

Actively maintained with recent releases

Popularity12

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity23

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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

Unknown

Total

1

Last Release

15d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/22215595?v=4)[Deepak Gupta](/maintainers/raftaar1191)[@raftaar1191](https://github.com/raftaar1191)

---

Top Contributors

[![raftaar1191](https://avatars.githubusercontent.com/u/22215595?v=4)](https://github.com/raftaar1191 "raftaar1191 (4 commits)")

---

Tags

wordpressmcpModel Context Protocolmcp-adaptermcp-servers

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/wpboilerplate-wpb-mcp-servers-list/health.svg)

```
[![Health](https://phpackages.com/badges/wpboilerplate-wpb-mcp-servers-list/health.svg)](https://phpackages.com/packages/wpboilerplate-wpb-mcp-servers-list)
```

###  Alternatives

[wordpress/mcp-adapter

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

887124.0k3](/packages/wordpress-mcp-adapter)[humanmade/mercator

WordPress multisite domain mapping for the modern era.

529186.8k5](/packages/humanmade-mercator)[wp-graphql/wp-graphql-woocommerce

WooCommerce bindings for WPGraphQL

69655.0k](/packages/wp-graphql-wp-graphql-woocommerce)[sybrew/the-seo-framework

An automated, advanced, accessible, unbranded and extremely fast SEO solution for any WordPress website.

47582.8k](/packages/sybrew-the-seo-framework)[hieu-le/wordpress-xmlrpc-client

A PHP client for Wordpress websites that closely implement the XML-RPC WordPress API with full test suite built in

116161.2k2](/packages/hieu-le-wordpress-xmlrpc-client)[alle-ai/anthropic-api-php

The go-to PHP library for the Anthropic API — Messages, streaming, tool use, vision, prompt caching, extended thinking, MCP, Files, Batches. Maintained by Alle-AI.

2625.3k](/packages/alle-ai-anthropic-api-php)

PHPackages © 2026

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