Home » Docs » Using Abilities via MCP

Using Abilities via MCP

The Model Context Protocol (MCP) is an open standard that lets AI assistants and agents — Claude, and any other MCP-capable client — discover and call tools on external systems. Because Members Only registers its operations as WordPress abilities, your site can expose them to AI agents as MCP tools. This doc explains what that gets you and how to set it up.

What You Gain

Once connected, an AI agent can operate your membership site through the same permission-checked operations the plugin’s admin screens use. In practice, that means you can ask an assistant to do things like:

  • “Is jane@example.com an active member? What is she subscribed to?”
  • “Create an account for our new partner and add them to the Acme group.”
  • “Cancel Bob’s subscription at the end of the billing period — show me a preview first.”
  • “How many user accounts signed up each week this quarter?”
  • “Which pages on the site are restricted to members?”

The abilities’ JSON Schemas tell the agent exactly what each operation accepts and returns, so it does not have to guess at REST endpoints or scrape admin pages. The readonly/destructive annotations tell it which operations deserve caution, and cancel-subscription‘s dry_run input lets it preview a cancellation before committing. Every call runs the same capability checks described in the Overview — connecting an agent never grants it more access than the WordPress user it authenticates as.

How It Works

The bridge between the Abilities API and MCP is the official WordPress MCP Adapter plugin, maintained by the WordPress AI Team. Once activated, it runs an MCP server at:

https://your-site.com/wp-json/mcp/mcp-adapter-default-server

Rather than exposing every ability as its own tool (which would overwhelm agents on sites with many plugins), the default server exposes three meta-tools: one to discover available abilities, one to fetch the full schema of a specific ability, and one to execute an ability with parameters. Agents use these to find and call whatever they need.

All Members Only abilities are marked as MCP-visible (mcp.public), so they appear in discovery automatically — there is nothing to configure on the Members Only side. Group abilities appear only when the Group Memberships extension is active, matching their registration behavior.

Setup

1. Install the MCP Adapter plugin

Download the latest release from the MCP Adapter releases page and install it like any plugin, or use WP-CLI:

wp plugin install https://github.com/WordPress/mcp-adapter/releases/latest/download/mcp-adapter.zip --activate

2. Create an application password

MCP requests authenticate as a real WordPress user. Create a user with the capabilities matching what you want the agent to do (see the permission table in the Overview), then generate an application password for it under Users → Profile → Application Passwords. The agent will hold this credential, so prefer a dedicated user over your own account — you can revoke its password at any time without touching anything else.

3. Connect your MCP client

Any MCP client that supports the Streamable HTTP transport with custom headers can connect using HTTP Basic authentication. For example, with Claude Code:

claude mcp add --transport http my-membership-site 
  https://your-site.com/wp-json/mcp/mcp-adapter-default-server 
  --header "Authorization: Basic $(echo -n 'agent-user:APPLICATION_PASSWORD' | base64)"

For other clients, supply the same URL and an Authorization: Basic header built from username:application-password.

4. Verify the connection

You can confirm the server responds with a single request:

curl -X POST "https://your-site.com/wp-json/mcp/mcp-adapter-default-server" 
  --user "agent-user:APPLICATION_PASSWORD" 
  -H "Content-Type: application/json" 
  -H "Accept: application/json, text/event-stream" 
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}'

Once connected, ask the agent to list available abilities — the members-only/ abilities should appear in its discovery results.

Security Notes

  • Nothing is anonymous. Every MCP request authenticates as a WordPress user, and every ability execution runs its permission callback. An agent connected as a user without manage_options cannot read member data, no matter what it asks for.
  • Use least privilege. Give the agent’s user only the capabilities it needs. An agent that only reports on membership stats does not need edit_users.
  • Use a client that confirms changes. Members Only annotates every ability with readonly and destructive hints, and marks anything that can remove or weaken existing state — cancelling or reactivating a subscription, replacing an access pass, changing whether content is restricted — as destructive. Choose an MCP client that shows you these operations and asks for your approval before running them, and do not grant blanket auto-approval for non-read-only tools. Annotations are advisory: the confirmation prompt in your client is the safety boundary.
  • Member-provided text is data, not instructions. Ability results can include values your site’s users typed themselves — display names, group names, invitee email addresses. A malicious user could set a display name that reads like a command to an AI agent (a “prompt injection”). Members Only returns these values only as clearly labeled structured fields, but an agent reading them ultimately decides how to treat them — which is why the human confirmation step above matters most on sites with open registration. If your assistant ever proposes an action you did not ask for after reading member data, decline it.
  • Use HTTPS. Application passwords travel in the request headers; never connect over plain HTTP.
  • Revoke when done. Application passwords can be revoked individually from the user’s profile without changing the account password.