Skip to content

Connectors: Add the WordPress MCP setup card - #84983

Open
Adi-ty wants to merge 4 commits into
WordPress:trunkfrom
Adi-ty:add/66323-connectors-mcp-card
Open

Adi-ty wants to merge 4 commits into
WordPress:trunkfrom
Adi-ty:add/66323-connectors-mcp-card

Conversation

@Adi-ty

@Adi-ty Adi-ty commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

What?

See https://core.trac.wordpress.org/ticket/66323

Adds a WordPress MCP card to the Connectors screen for the MCP Adapter, so site owners can discover and set up MCP access to their site.

Why?

The Connectors screen offers no way to find or set up the MCP Adapter, and no guidance for connecting an MCP client (endpoint URL, application passwords). This implements the acceptance criteria of https://core.trac.wordpress.org/ticket/66323: a discoverable card, install/activate through the existing plugin flow, an endpoint that works for subdirectory installs and plain permalinks, and an application password that is created only on request and shown once.

Core counterpart: WordPress/wordpress-develop#14348 (registers the mcp-adapter connector and adds the applicationPasswords script module data).

How?

  • Register a custom McpConnector card for the mcp-adapter connector. It follows the existing Install → Activate → Set up flow via useConnectorPlugin; nothing is installed on page view, and the card never claims a verified client connection.
  • Once the adapter is active, the default server URL is read from the REST API index (/mcp namespace), so it matches the site's permalinks and directory layout. A missing route and a failed request produce distinct explanations.
  • Application passwords are listed, created, and revoked through /wp/v2/users/me/application-passwords, tagging created passwords with a fixed app_id so the card lists only the ones created there. The secret and a ready-made Authorization: Basic header are shown once and never stored in connector settings.
  • Availability data (HTTPS, per-user, permissions) comes from the core applicationPasswords script module data, with a WP 7.1 compat shim that defers to core when present.
  • The card explains the "connected but no abilities" case and links to the MCP Adapter setup guide.

Testing Instructions

  1. Go to Settings → Connectors.
  2. Confirm the "WordPress MCP" card appears with the Install → Activate → Set up flow, and that nothing installs just by loading the page.
  3. Once set up, copy the MCP endpoint and create an application password; confirm the credentials are shown once, and can be revoked from the card.

Testing Instructions for Keyboard

  1. Tab to the card's action button and press Enter/Space to expand it.
  2. Tab to the copy buttons in the endpoint and credential fields; press Enter to copy.
  3. In the create form, type a name and submit with Enter; after creation, tab through the one-time credential fields and the Done button.
  4. Tab to Revoke, press Enter, and confirm focus lands in the confirmation dialog where Revoke can be activated with Enter and dismissed with Escape.

Screenshots or screencast

Before After
Before After

Use of AI Tools

Assisted by Claude Code, all changes tested & reviewed manually.

Show a discoverable card for the MCP Adapter on the Connectors screen with the default MCP endpoint, and let users create, list, and revoke the application passwords MCP clients sign in with. Includes the WordPress 7.1 compat shims for the core registration and script module data in wordpress-develop#14348.
@github-actions

github-actions Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

🤖 PR meta 🤖

Preview in WordPress Playground

🎉 Props

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: Adi-ty <iamadisingh@git.wordpress.org>

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

Updated as activity occurs, without notifying anyone named here. Add the props-bot label to refresh.

🏷️ Labels

This pull request needs exactly one label indicating its type, and has 0.

  • Required: any label starting with [Type].
  • Found: none.

Read more about Type labels in Gutenberg. If you cannot add labels yourself, a reviewer can do it for you.

@Adi-ty
Adi-ty marked this pull request as ready for review October 16, 2026 18:41
@Adi-ty
Adi-ty requested a review from spacedmonkey as a code owner October 16, 2026 18:41

This branch has not been deployed

No deployments
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.

1 participant