WordPress Plugins
Free Tools
Claude Skills
Pricing Blog Switch to Royal Plugin Graveyard Support My Account Cart
Home Support Royal MCP OAuth Connector Deep Dive

Royal MCP OAuth Connector — Deep Dive

What makes Royal MCP different from every other WordPress MCP plugin: it ships a complete OAuth 2.0 authorization server as the primary way to connect. Most WordPress MCP plugins hand out a static API key and hope for the best. Royal MCP lets Claude, ChatGPT, Perplexity, and any other OAuth-capable AI agent add your site as a native connector, the same way they add Google Drive or GitHub. The user clicks “Add Connector,” signs in through WordPress, approves a consent screen, and the connection is live. No copy-pasted secrets, no static tokens sitting in a config file, per-user consent that other admins can revoke, and dynamic client registration so no manual app setup is required. This page covers how that flow works end to end, the security properties, setup steps, and every known failure mode with its fix.

How the OAuth flow works

When Claude Desktop (or another OAuth-capable MCP client) adds Royal MCP as a connector, six things happen in sequence:

  1. The client fetches Royal MCP’s OAuth metadata endpoint at /.well-known/oauth-authorization-server to discover the auth flow.
  2. The client registers itself dynamically via RFC 7591 Dynamic Client Registration. No manual app creation required.
  3. The client redirects you to your WordPress login using the PKCE-secured authorization code flow (per MCP spec 2025-06-18).
  4. You approve a consent screen showing the permissions the client is requesting.
  5. Royal MCP issues an access token (SHA-256 hashed at rest) and a refresh token.
  6. The client uses the access token in the Authorization: Bearer … header for every subsequent MCP request.

Steps 1 and 2 are the “host layer” concerns. When those succeed, the flow completes reliably. Most OAuth troubleshooting is about getting /.well-known/* and /register reachable through a WAF, edge cache, or membership plugin that’s intercepting them.

Setup in Claude Desktop

Open Claude Desktop settings

Click your profile icon, then Settings → Connectors.

Click “Add Custom Connector”

Enter your MCP server URL: https://yoursite.com/wp-json/royal-mcp/v1/mcp

Authorize in your browser

Claude opens your browser to your WordPress login. Sign in with an admin account.

Approve the consent screen

Royal MCP shows what Claude is requesting. Click Allow to grant access.

Done

The browser closes and Claude Desktop confirms the connector is active. Royal MCP tools now appear in Claude.

OAuth consent screen for Claude Desktop connector

The consent screen Royal MCP presents during the OAuth flow

Security properties

For the full auth model, per-transport boundary rules, threat scenarios, and a production-readiness checklist for security and agency teams, see the Direct-Connect Threat Model.

When OAuth beats an API key (and when it doesn’t)

OAuth is the right choice when your client supports it and the OAuth discovery flow reaches your site cleanly. It gives you per-session tokens, automatic refresh, no static secret in a config file, and per-user consent that other admins can revoke. Prefer it for Claude Desktop, Claude.ai Web, and ChatGPT’s Custom GPT MCP connector.

The API-key path (see API Keys) beats OAuth when:

If OAuth setup fails

OAuth depends on the client reaching three URLs on your site: /.well-known/oauth-authorization-server, /.well-known/oauth-protected-resource, and /wp-json/royal-mcp/v1/mcp. On most hosts this just works. On a few managed hosts, nginx rules and edge caches can short-circuit those URLs before WordPress sees them, and the client shows a generic “Couldn’t connect” or “Authorization failed” error. Every known failure mode has a dedicated fix: