The MCP Access experiment wires a site up to the MCP Adapter companion plugin and gives site owners control over which abilities are exposed to AI agents over the Model Context Protocol. Enabling the experiment installs and activates the MCP Adapter plugin from WordPress.org if it is not already active.
- Type: Experiment (may change or be removed in any release; try it on a staging site first)
- Runs without a user action: Doesn't call your AI provider itself
- When it runs: When an authorized MCP client lists or runs an exposed ability
- Sent to your AI provider: Nothing itself, but MCP clients can run exposed abilities that call your AI provider, such as Title Generation
- Requests and data: Exposes this plugin's enabled abilities over MCP by default, and installs and activates the MCP Adapter plugin from WordPress.org
- Good to know: The MCP Adapter plugin is installed and activated on the first admin page load by a user who can install plugins. On Multisite it is never installed automatically; a network administrator installs it. Hide abilities you don't want AI agents to use under
Tools > MCP Access.
When enabled, a new admin page appears under Tools > MCP Access. The page provides:
- The MCP server endpoint URL, read from the adapter's registered servers
- The adapter's install state, with a manual install/activate button when it is missing or inactive
- A table of registered abilities with per-ability expose/hide controls; a Status column shows which abilities are overridden, and toggling a checkbox back restores the default
This plugin's own abilities (ai/*) are exposed by default, since they only register while the feature or experiment providing them is enabled. Other abilities keep their developer-declared visibility unless the site owner changes them. Two groups are not listed: the adapter's own default-server abilities (mcp-adapter/*), which are the server's machinery and are active whenever the server runs, and deprecated aliases, which stay hidden because their replacement is listed instead.
While the experiment is enabled, the MCP Adapter plugin is installed and activated automatically on the first admin page load by a user who can install plugins. The attempt runs once per experiment activation: deactivating the adapter afterwards is respected, and toggling the experiment off and on runs the install again. On Multisite, where site administrators cannot install or activate plugins, nothing is installed automatically: the MCP Access screen says so, and a network administrator can use its install/activate button or Network Admin. Exposure overrides are only enforced while the experiment is enabled.
The experiment consists of:
- Experiment class (
WordPress\AI\Experiments\MCP_Adapter\MCP_Adapter): Boots the exposure filter, REST route, admin page, and installer - Auto-installer (
WordPress\AI\Experiments\MCP_Adapter\Plugin_Installer): Installs and activates the adapter from WordPress.org once per experiment enable, viaplugins_api()andPlugin_Upgrader - Exposure overrides (
WordPress\AI\Experiments\MCP_Adapter\Exposure_Overrides): Injects saved overrides into ability registration meta so the adapter's default server honors them - REST controller (
WordPress\AI\Experiments\MCP_Adapter\Settings_Controller): Powers the admin page overai/v1/mcp/settings - React admin app (
src/experiments/mcp-adapter/): Renders the install state and the ability exposure table
WordPress\AI\Experiments\MCP_Adapter\MCP_Adapter::register() wires:
wp_register_ability_args(viaExposure_Overrides) to apply exposure defaults and saved overrides asmeta.mcp.publicrest_api_initto register theai/v1/mcp/settingsrouteadmin_menuandadmin_enqueue_scriptsfor the Tools pageadmin_init(viaPlugin_Installer) for the once-per-enable install attempt
- The MCP Adapter resolves an ability's exposure from
meta.mcp.public, falling back tometa.public. - Overrides saved on the MCP Access screen are stored as an ability-name map and injected into that meta key at registration time, so the adapter picks them up with no hard dependency between the plugins. Class-based abilities extending
Abstract_Abilitymerge the filtered meta over the meta their class declares. - Without an override,
ai/*abilities are injected as exposed, and abilities whose meta has adeprecatedkey are injected as hidden. Everything else is left untouched. - The default is captured before injection, so the screen can always report and restore it.
- Overrides for the reserved
mcp-adapter/*namespace and for deprecated aliases are never listed, accepted, or applied.
- On
admin_init, if the current enable cycle has not been handled, the site is not Multisite (Multisite records a "not available" marker instead) and the visitor can activate plugins, the installer resolves the adapter's install state. - An active copy (including one installed under a non-standard directory, detected via the adapter's classes) marks the cycle handled with no action.
- Otherwise the installer claims the cycle atomically, downloads the plugin from WordPress.org if missing, and activates it. Success or failure is recorded; a failure is surfaced on the MCP Access screen with the manual button as the retry path.
- Disabling the experiment clears the marker, so re-enabling runs a fresh attempt.
The experiment uses two options:
wpai_mcp_exposed_abilities: exposure override map (ability_name -> bool); abilities not present keep their defaultwpai_mcp_adapter_autoinstall_handled: once-per-enable marker ('1'on success, the error message on failure)
wpai_mcp_adapter_plugin_slug: Filters the WordPress.org slug of the companion plugin (useful for testing the install flow against a stand-in plugin)wpai_pre_mcp_adapter_autoinstall: Short-circuits the automatic install; returntrueto report success or aWP_Errorto report failure without touching the filesystem