Skip to content

Comments

WordPress.org Abilities: Add MCP server infrastructure#552

Closed
obenland wants to merge 3 commits intoWordPress:trunkfrom
obenland:add/wporg-abilities
Closed

WordPress.org Abilities: Add MCP server infrastructure#552
obenland wants to merge 3 commits intoWordPress:trunkfrom
obenland:add/wporg-abilities

Conversation

@obenland
Copy link
Member

@obenland obenland commented Feb 12, 2026

Summary

  • Introduce the wporg-abilities plugin with MCP server infrastructure.
  • Bundles wordpress/mcp-adapter and creates a custom MCP server that auto-discovers any wporg/* ability.
  • Includes autoloader, MCP server, and registrar skeleton for future ability registration.
  • Add api.wordpress.org/mcp/1.0/ proxy endpoint that boots WordPress and internally dispatches MCP requests via the REST API, following the patterns endpoint precedent.

Test plan

  • Activate the plugin on a site with the MCP adapter.
  • Verify the MCP server registers at /wp-json/mcp/wporg.
  • Verify unauthenticated requests are rejected.
  • Verify no tools are listed when no abilities are registered.
  • POST a JSON-RPC initialize request to api.wordpress.org/mcp/1.0/ with application password auth and verify the MCP server responds.
  • Verify response headers reference api.wordpress.org/mcp/1.0 not wordpress.org/wp-json.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Introduces a new wporg-abilities WordPress plugin that bundles the wordpress/mcp-adapter library and registers a custom MCP server intended to expose wporg/* abilities via a REST endpoint.

Changes:

  • Adds the wporg-abilities plugin bootstrap, autoloader, registrar skeleton, and a WordPress.org MCP server registration.
  • Vendors wordpress/mcp-adapter (v0.4.1) and its supporting transport/session/observability infrastructure.
  • Adds Composer metadata/lockfiles and Composer-generated autoload artifacts for the bundled dependency.

Reviewed changes

Copilot reviewed 5 out of 78 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
wordpress.org/public_html/wp-content/plugins/wporg-abilities/wporg-abilities.php Plugin bootstrap: loads Composer + registers hooks to init abilities and MCP server.
wordpress.org/public_html/wp-content/plugins/wporg-abilities/class-autoloader.php Local WP-style autoloader for the plugin’s own classes.
wordpress.org/public_html/wp-content/plugins/wporg-abilities/class-registrar.php Skeleton registrar for ability categories/abilities.
wordpress.org/public_html/wp-content/plugins/wporg-abilities/class-mcp-server.php Registers the custom WordPress.org MCP server and discovers wporg/* abilities.
wordpress.org/public_html/wp-content/plugins/wporg-abilities/composer.json Declares dependency on wordpress/mcp-adapter.
wordpress.org/public_html/wp-content/plugins/wporg-abilities/composer.lock Locks wordpress/mcp-adapter to v0.4.1.
wordpress.org/public_html/wp-content/plugins/wporg-abilities/vendor/autoload.php Composer autoloader entrypoint.
wordpress.org/public_html/wp-content/plugins/wporg-abilities/vendor/composer/platform_check.php Composer-generated PHP version/platform check.
wordpress.org/public_html/wp-content/plugins/wporg-abilities/vendor/composer/installed.php Composer-installed package metadata (PHP array).
wordpress.org/public_html/wp-content/plugins/wporg-abilities/vendor/composer/installed.json Composer-installed package metadata (JSON).
wordpress.org/public_html/wp-content/plugins/wporg-abilities/vendor/composer/autoload_static.php Composer autoload static map.
wordpress.org/public_html/wp-content/plugins/wporg-abilities/vendor/composer/autoload_real.php Composer autoloader bootstrap.
wordpress.org/public_html/wp-content/plugins/wporg-abilities/vendor/composer/autoload_psr4.php Composer PSR-4 map.
wordpress.org/public_html/wp-content/plugins/wporg-abilities/vendor/composer/autoload_namespaces.php Composer namespaces map.
wordpress.org/public_html/wp-content/plugins/wporg-abilities/vendor/composer/autoload_classmap.php Composer classmap.
wordpress.org/public_html/wp-content/plugins/wporg-abilities/vendor/composer/LICENSE Composer license file.
wordpress.org/public_html/wp-content/plugins/wporg-abilities/vendor/wordpress/mcp-adapter/package.json Bundled adapter’s JS tooling metadata.
wordpress.org/public_html/wp-content/plugins/wporg-abilities/vendor/wordpress/mcp-adapter/composer.json Bundled adapter’s Composer metadata + autoload config.
wordpress.org/public_html/wp-content/plugins/wporg-abilities/vendor/wordpress/mcp-adapter/mcp-adapter.php Bundled adapter bootstrap file (defines constants + autoload).
wordpress.org/public_html/wp-content/plugins/wporg-abilities/vendor/wordpress/mcp-adapter/includes/Autoloader.php Adapter autoloader helper.
wordpress.org/public_html/wp-content/plugins/wporg-abilities/vendor/wordpress/mcp-adapter/includes/Plugin.php Adapter plugin wrapper class.
wordpress.org/public_html/wp-content/plugins/wporg-abilities/vendor/wordpress/mcp-adapter/includes/Core/McpAdapter.php Core registry for creating/registering MCP servers.
wordpress.org/public_html/wp-content/plugins/wporg-abilities/vendor/wordpress/mcp-adapter/includes/Core/McpTransportFactory.php Transport DI/context builder and transport initialization.
wordpress.org/public_html/wp-content/plugins/wporg-abilities/vendor/wordpress/mcp-adapter/includes/Servers/DefaultServerFactory.php Default server factory (can be disabled by filter).
wordpress.org/public_html/wp-content/plugins/wporg-abilities/vendor/wordpress/mcp-adapter/includes/Transport/HttpTransport.php HTTP REST transport registering REST routes and permission checks.
wordpress.org/public_html/wp-content/plugins/wporg-abilities/vendor/wordpress/mcp-adapter/includes/Transport/Contracts/McpTransportInterface.php Base transport interface.
wordpress.org/public_html/wp-content/plugins/wporg-abilities/vendor/wordpress/mcp-adapter/includes/Transport/Contracts/McpRestTransportInterface.php REST-specific transport interface.
wordpress.org/public_html/wp-content/plugins/wporg-abilities/vendor/wordpress/mcp-adapter/includes/Transport/Infrastructure/HttpRequestContext.php HTTP request context container (headers/body/method).
wordpress.org/public_html/wp-content/plugins/wporg-abilities/vendor/wordpress/mcp-adapter/includes/Transport/Infrastructure/HttpRequestHandler.php HTTP request routing + JSON-RPC formatting + session header handling.
wordpress.org/public_html/wp-content/plugins/wporg-abilities/vendor/wordpress/mcp-adapter/includes/Transport/Infrastructure/HttpSessionValidator.php HTTP session validation and session lifecycle helpers.
wordpress.org/public_html/wp-content/plugins/wporg-abilities/vendor/wordpress/mcp-adapter/includes/Transport/Infrastructure/JsonRpcResponseBuilder.php JSON-RPC response builder + batch handling helpers.
wordpress.org/public_html/wp-content/plugins/wporg-abilities/vendor/wordpress/mcp-adapter/includes/Transport/Infrastructure/McpTransportContext.php DI context object wiring handlers/observability/router.
wordpress.org/public_html/wp-content/plugins/wporg-abilities/vendor/wordpress/mcp-adapter/includes/Transport/Infrastructure/McpTransportHelperTrait.php Helper trait for transport name normalization.
wordpress.org/public_html/wp-content/plugins/wporg-abilities/vendor/wordpress/mcp-adapter/includes/Transport/Infrastructure/RequestRouter.php Central method router + observability tagging and session-aware initialize.
wordpress.org/public_html/wp-content/plugins/wporg-abilities/vendor/wordpress/mcp-adapter/includes/Transport/Infrastructure/SessionManager.php User-meta based session management for MCP HTTP transport.
wordpress.org/public_html/wp-content/plugins/wporg-abilities/vendor/wordpress/mcp-adapter/includes/Infrastructure/ErrorHandling/Contracts/McpErrorHandlerInterface.php Error handler interface.
wordpress.org/public_html/wp-content/plugins/wporg-abilities/vendor/wordpress/mcp-adapter/includes/Infrastructure/ErrorHandling/ErrorLogMcpErrorHandler.php Error handler implementation using PHP error log.
wordpress.org/public_html/wp-content/plugins/wporg-abilities/vendor/wordpress/mcp-adapter/includes/Infrastructure/ErrorHandling/NullMcpErrorHandler.php No-op error handler.
wordpress.org/public_html/wp-content/plugins/wporg-abilities/vendor/wordpress/mcp-adapter/includes/Infrastructure/Observability/Contracts/McpObservabilityHandlerInterface.php Observability handler interface.
wordpress.org/public_html/wp-content/plugins/wporg-abilities/vendor/wordpress/mcp-adapter/includes/Infrastructure/Observability/ConsoleObservabilityHandler.php Debug observability logger to error log/console.
wordpress.org/public_html/wp-content/plugins/wporg-abilities/vendor/wordpress/mcp-adapter/includes/Infrastructure/Observability/ErrorLogMcpObservabilityHandler.php Observability handler that logs to PHP error log.
wordpress.org/public_html/wp-content/plugins/wporg-abilities/vendor/wordpress/mcp-adapter/includes/Infrastructure/Observability/McpObservabilityHelperTrait.php Shared observability sanitization/tag helpers.
wordpress.org/public_html/wp-content/plugins/wporg-abilities/vendor/wordpress/mcp-adapter/includes/Infrastructure/Observability/NullMcpObservabilityHandler.php No-op observability handler.
wordpress.org/public_html/wp-content/plugins/wporg-abilities/vendor/wordpress/mcp-adapter/includes/Handlers/HandlerHelperTrait.php Shared handler parameter extraction + error helpers.
wordpress.org/public_html/wp-content/plugins/wporg-abilities/vendor/wordpress/mcp-adapter/includes/Handlers/Initialize/InitializeHandler.php Implements initialize response (capabilities + server info).
wordpress.org/public_html/wp-content/plugins/wporg-abilities/vendor/wordpress/mcp-adapter/includes/Handlers/Prompts/PromptsHandler.php Prompt list/get execution routing and permission checks.
wordpress.org/public_html/wp-content/plugins/wporg-abilities/vendor/wordpress/mcp-adapter/includes/Handlers/Resources/ResourcesHandler.php Resource list/read routing and permission checks.
wordpress.org/public_html/wp-content/plugins/wporg-abilities/vendor/wordpress/mcp-adapter/includes/Handlers/System/SystemHandler.php Basic system method handling (ping, roots/list, etc.).
wordpress.org/public_html/wp-content/plugins/wporg-abilities/vendor/wordpress/mcp-adapter/includes/Domain/Utils/McpAnnotationMapper.php Maps WP ability annotations to MCP annotation fields.
wordpress.org/public_html/wp-content/plugins/wporg-abilities/vendor/wordpress/mcp-adapter/includes/Domain/Utils/SchemaTransformer.php Wraps flattened schemas into MCP-required object schemas.
wordpress.org/public_html/wp-content/plugins/wporg-abilities/vendor/wordpress/mcp-adapter/includes/Domain/Tools/McpTool.php MCP tool model + validation hook.
wordpress.org/public_html/wp-content/plugins/wporg-abilities/vendor/wordpress/mcp-adapter/includes/Domain/Tools/McpToolValidator.php Tool schema validation + uniqueness checks.
wordpress.org/public_html/wp-content/plugins/wporg-abilities/vendor/wordpress/mcp-adapter/includes/Domain/Tools/RegisterAbilityAsMcpTool.php Converts WP abilities into MCP tool definitions.
wordpress.org/public_html/wp-content/plugins/wporg-abilities/vendor/wordpress/mcp-adapter/includes/Domain/Resources/McpResourceValidator.php Resource schema validation + uniqueness checks.
wordpress.org/public_html/wp-content/plugins/wporg-abilities/vendor/wordpress/mcp-adapter/includes/Domain/Resources/RegisterAbilityAsMcpResource.php Converts WP abilities into MCP resources.
wordpress.org/public_html/wp-content/plugins/wporg-abilities/vendor/wordpress/mcp-adapter/includes/Domain/Prompts/Contracts/McpPromptBuilderInterface.php Interface for builder-based prompts.
wordpress.org/public_html/wp-content/plugins/wporg-abilities/vendor/wordpress/mcp-adapter/includes/Domain/Prompts/McpPromptBuilder.php Base class for builder-based prompts (bypassing abilities).
wordpress.org/public_html/wp-content/plugins/wporg-abilities/vendor/wordpress/mcp-adapter/includes/Domain/Prompts/RegisterAbilityAsMcpPrompt.php Converts WP abilities into MCP prompts.
wordpress.org/public_html/wp-content/plugins/wporg-abilities/vendor/wordpress/mcp-adapter/includes/Abilities/McpAbilityHelperTrait.php Shared helper logic for MCP abilities (public exposure/type).
wordpress.org/public_html/wp-content/plugins/wporg-abilities/vendor/wordpress/mcp-adapter/includes/Abilities/DiscoverAbilitiesAbility.php Default “discover abilities” tool ability.
wordpress.org/public_html/wp-content/plugins/wporg-abilities/vendor/wordpress/mcp-adapter/includes/Abilities/ExecuteAbilityAbility.php Default “execute ability” tool ability.
wordpress.org/public_html/wp-content/plugins/wporg-abilities/vendor/wordpress/mcp-adapter/includes/Abilities/GetAbilityInfoAbility.php Default “get ability info” tool ability.
wordpress.org/public_html/wp-content/plugins/wporg-abilities/vendor/wordpress/mcp-adapter/includes/Cli/McpCommand.php WP-CLI commands for serving/listing MCP servers.
wordpress.org/public_html/wp-content/plugins/wporg-abilities/vendor/wordpress/mcp-adapter/includes/Cli/StdioServerBridge.php STDIO bridge to expose servers over JSON-RPC on stdin/stdout.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Introduce the wporg-abilities plugin, which provides the MCP server
infrastructure for exposing WordPress.org abilities as MCP tools.

The plugin bundles the wordpress/mcp-adapter package and creates a
custom MCP server that auto-discovers any ability registered with the
wporg/ prefix. It includes:

- Autoloader with WordPress file naming conventions.
- MCP_Server that wires up transport, error handling, and auth.
- Registrar skeleton for ability and category registration.

Individual ability implementations will follow in subsequent branches.
@obenland obenland force-pushed the add/wporg-abilities branch from bcf456f to b330ade Compare February 12, 2026 17:21
@obenland obenland self-assigned this Feb 12, 2026
@obenland obenland marked this pull request as ready for review February 12, 2026 17:22
@github-actions
Copy link

github-actions bot commented Feb 12, 2026

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props obenland, dd32.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Adds an endpoint at api.wordpress.org/mcp/1.0/ that proxies MCP
requests to the WordPress.org REST API, following the patterns
endpoint precedent.
@obenland
Copy link
Member Author

@dd32 I took inspiration from photo-directory's use of composer and the followed mcp-adapter's installation instructions to include the plugin. Please let me know if there's a better or preferred way to make mcp-adapter available.

Following the patterns example, I added an api proxy endpoint so it's available from api.wordpress.org/mcp/1.0. I added the version for consistency, not sure if that's desired.

Again, any feedback you have would be much appreciated. None of this is set in stone, I just went with what felt the most "right", looking at what's already there.

@dd32
Copy link
Member

dd32 commented Feb 13, 2026

I added an api proxy endpoint so it's available from api.wordpress.org/mcp/1.0. I added the version for consistency, not sure if that's desired.

The api.w.org/ endpoints are only really for WordPress Core consumption, gives some flexibility in caching and bypassing WordPress in future.. there's no real need to force MCP to use that, but no reason not to. So up to you.

The version is mostly just standardisation, again, to make it easier to change the format in future.

If using that endpoint makes it easier to load things without having to specify a site (ie. "Search plugins" => load plugin directory & search, "search themes" => load theme directory & search) that's also a good use-case.

There are some things where you need to determine what site you're going to load first, as switch_to_blog() doesn't always work at loading conflicting plugins, unloading plugins, or at cross-network things (ie. various multisite settings in wp-config.php)

composer and the followed mcp-adapter's installation instructions to include the plugin.

Works for me. We also have a composer.json loaded at https://wordpress.org/composer.json (not open-sourced, and not with any sensitive data) which could be used, but I don't see any need to complicate it.

It might be worthwhile committing some of the plugins basics to meta.svn, such as the plugin directory and the composer deps, to make this PR readable.

bazza pushed a commit that referenced this pull request Feb 13, 2026
Introduce the wporg-abilities plugin with MCP server infrastructure for
WordPress.org. Bundles the wordpress/mcp-adapter package and creates a
custom MCP server that auto-discovers wporg/* abilities.

See #552



git-svn-id: https://meta.svn.wordpress.org/sites/trunk@14660 74240141-8908-4e6f-9713-ba540dce6ec7
@obenland
Copy link
Member Author

Committed in r14660-meta.

@obenland obenland closed this Feb 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants