WordPress Plugins
Free Tools
Pricing Blog Case Studies Switch to Royal Plugin Graveyard Support My Account Cart
Support / Royal MCP / OAuth Tables Missing

OAuth Tables Missing — “Couldn’t Register with Sign-In Service” or “Session Not Found”

If Claude.ai shows “Couldn’t register with sign-in service,” no tools appear in the connector after you click Connect, or you see 404 “Session not found or expired” on the next request after a successful initialize, your Royal MCP install’s database tables may be physically missing. Royal MCP 1.4.29+ auto-heals this on the next pageload — update first, and the symptom usually clears without any manual action. This guide covers the diagnostic, what the auto-heal does, and the manual recovery path for installs still stuck on 1.4.27 or 1.4.28.

90-second fix for most people

Update Royal MCP to 1.4.29 or newer from WP Admin → Plugins. Load any wp-admin page once. The new runtime healer detects missing tables and recreates them automatically — no deactivate / reactivate required. Then in Claude, delete the existing connector, wait 30 seconds, and re-add fresh. The rest of this guide is for cases where the update isn’t available yet, or where you want to confirm the diagnosis before updating.

Who this guide is for

Sites that updated from Royal MCP 1.4.27 or 1.4.28 (a small subset hit a runtime-migration race fixed in 1.4.29), sites that uninstalled then reinstalled Royal MCP without first updating to 1.4.29 (pre-1.4.29 uninstall left a state option behind that could trap a later reinstall), and sites where the database tables were manually dropped or lost in a partial restore. LiteSpeed-fronted hosts with opcache, and any setup with an unreliable autoloader during file-swap auto-updates, are the most common contexts.

Symptoms

The signs vary by MCP client, but they all trace back to the same root cause: at least one of Royal MCP’s OAuth or sessions tables is physically missing from the WordPress database, so any code path that tries to read or write to those tables fails.

Method 1 — Claude.ai native connector (OAuth)

“Couldn’t register with your site’s sign-in service. You can try again, or add an OAuth Client ID in the connector settings.”

Or the connector appears to add successfully but no tools show up in the connector list. The Claude.ai authorization step itself often never completes — the broker POSTs to /register first, gets back a 500, and surfaces the error to the user immediately.

Method 2 — API key with mcp-remote (Claude Desktop)

“Session not found or expired. Please re-initialize.” (HTTP 404)

The connection initializes successfully, then the very next request fails with a 404. Some clients then fall back to SSE-only transport, which itself fails with SseError: Non-200 status code (405). API-key auth doesn’t touch the OAuth tables, but the moment initialize tries to persist your session, the missing wp_royal_mcp_sessions table causes the same class of failure.

Server-side error message (any client)

If you can capture the raw response body from a failed POST /register, you’ll see:

{
  "error": "server_error",
  "error_description": "Failed to persist client registration. The OAuth tables may be missing — deactivate and reactivate Royal MCP to recreate them."
}

That message is the unmistakable confirmation. If you can’t capture the body, the diagnostic in the next section confirms it from the database side.

How to Verify the Tables Are Actually Missing

Two 30-second checks. Either one confirms the diagnosis.

Option A: phpMyAdmin (or any database tool)

Open phpMyAdmin from your hosting control panel

Most managed hosts expose phpMyAdmin under cPanel, hPanel, Site Tools, or a similar dashboard. Select your WordPress database (it usually has the prefix you set during install).

Run a SHOW TABLES query

Click the SQL tab and paste:

SHOW TABLES LIKE 'wp_royal_mcp_%';

Substitute your actual table prefix if it’s not wp_ — check wp-config.php for the $table_prefix value.

Read the result

A healthy install returns five rows:

  • wp_royal_mcp_logs
  • wp_royal_mcp_oauth_clients
  • wp_royal_mcp_oauth_tokens
  • wp_royal_mcp_oauth_auth_codes
  • wp_royal_mcp_sessions

If the result is empty, OR you’re missing the OAuth tables (oauth_clients / oauth_tokens / oauth_auth_codes) or the sessions table, you’ve confirmed the diagnosis. Proceed to the fix.

Option B: WP-CLI (if you have SSH access)

SSH into your site and run

wp db query "SHOW TABLES LIKE '$(wp db prefix)royal_mcp_%';"

The $(wp db prefix) sub-shell expands to your install’s actual table prefix (usually wp_) so this works on any install. If your shell doesn’t support sub-shells, replace it with the prefix from wp-config.php directly: wp db query "SHOW TABLES LIKE 'wp_royal_mcp_%';".

Check the version option at the same time

While you’re in the shell, also check what version the runtime healer thinks the schema is at:

wp option get royal_mcp_db_version

If this returns the current plugin version but the tables are missing, you’re in the exact “stuck state” the 1.4.29 healer was built to recover from.

Don’t use the Activity Log for this diagnostic

An empty WP Admin → Royal MCP → Activity Log is expected when OAuth is failing — the Activity Log captures the legacy REST endpoints only, not OAuth or MCP JSON-RPC events. The database query above is the reliable signal.

The Fix — Update to Royal MCP 1.4.29 or Newer

Royal MCP 1.4.29 introduced two changes that close every stuck-state path simultaneously:

1. Runtime healer now verifies tables exist before short-circuiting

Pre-1.4.29, the maybe_upgrade_db() function trusted the royal_mcp_db_version option as a proxy for “tables are current.” If anything caused the tables to disappear while the option stayed at the current version (uninstall that left the option behind, a manual table drop, a partial restore), the healer kept short-circuiting and never tried to recreate them. 1.4.29 adds an explicit SHOW TABLES LIKE probe to the short-circuit condition — if either canary table (oauth_clients, sessions) is missing, the function falls through and recreates everything on the next pageload. No deactivate / reactivate required.

2. uninstall.php now clears the version option too

Pre-1.4.29, deleting Royal MCP dropped the tables and cleared royal_mcp_settings but left royal_mcp_db_version behind. If you then reinstalled Royal MCP on the same WP install, the option still matched the new plugin version and the old healer (which trusted the version string) skipped table re-creation — latching the install into a permanently stuck state. 1.4.29’s uninstall clears royal_mcp_db_version so any future reinstall starts from a fully clean slate.

Update Royal MCP

WP Admin → Plugins. Find Royal MCP, click Update Now. If wp.org auto-updates are enabled, this may already have happened — check the version reads 1.4.29 or higher.

Load any wp-admin page

The healer runs on plugins_loaded, which fires on every WordPress request. One pageload is enough to trigger the table-existence probe and recreate any missing tables.

Verify recovery

Re-run the SHOW TABLES LIKE 'wp_royal_mcp_%' query. You should now see all five rows. The royal_mcp_db_version option should still match the plugin version.

Reconnect the MCP client

In Claude (or whichever client you’re using), delete the existing Royal MCP connector, wait 30 seconds, then re-add it fresh. The fresh handshake should now complete cleanly — both the native OAuth path and the API-key / mcp-remote path are healed by the same fix.

Manual Recovery if You Can’t Update to 1.4.29 Yet

If your hosting environment delays plugin updates, or you need to recover an install right now before 1.4.29 propagates, both fixes can be applied by hand. The end state is identical to what 1.4.29 produces automatically.

Strongly prefer the auto-heal if you can

The manual workaround below is safe but error-prone if you’re editing the database directly. Updating to 1.4.29 takes 30 seconds and is the recommended path for everyone. Use the manual steps only when the update genuinely isn’t available.

Option A: WP-CLI (preferred)

Delete the latching option

wp option delete royal_mcp_db_version

This is the single change that breaks the stuck state — the runtime healer will now see the version mismatch and try to recreate the tables on the next request.

Trigger the healer

Load any wp-admin page (the plugins page is fine). The healer fires on plugins_loaded and will call create_tables() on both Token_Store and Session_Store.

Restore the logs table and default settings (if also missing)

The healer only recreates the OAuth and sessions tables. To restore the logs table and the default settings option, deactivate Royal MCP then reactivate it:

wp plugin deactivate royal-mcp
wp plugin activate royal-mcp

This fires the activation hook, which creates the logs table and seeds royal_mcp_settings with a fresh API key.

Verify

wp db query "SHOW TABLES LIKE '$(wp db prefix)royal_mcp_%';"
wp option get royal_mcp_db_version

Five tables, version option matches the plugin version. You’re recovered.

Option B: phpMyAdmin (no SSH access)

Delete the option row

In phpMyAdmin → wp_options table → filter by option_name = royal_mcp_db_version, then delete the row.

Load any wp-admin page to trigger the healer

Same as Option A — plugins_loaded fires on every request, and the version mismatch will cause the healer to recreate the OAuth and sessions tables.

Deactivate + reactivate Royal MCP

WP Admin → Plugins → Royal MCP → Deactivate, then Activate. This restores the logs table and default settings option.

Verify in phpMyAdmin

Re-run SHOW TABLES LIKE 'wp_royal_mcp_%'. All five rows should be present.

Don’t skip the deactivate / reactivate step on a stuck install

Just deleting the option and loading a page recreates the OAuth and sessions tables, but not the logs table or the settings option. If your install lost all five tables (e.g., from an uninstall + reinstall cycle), Royal MCP will appear to work but the Settings page will show empty defaults and the Activity Log will throw errors. The deactivate / reactivate cycle is what fires the activation hook and seeds the rest of the state.

Why This Happens (Background)

There are three known ways a Royal MCP install can end up with its tables missing while the plugin still appears active in WP Admin:

1. The 1.4.27 migration race (fixed in 1.4.29)

1.4.27 introduced a new wp_royal_mcp_sessions table to move MCP session state off the object cache. The runtime migration that creates that table relies on the WordPress autoloader to find the Session_Store class. On LiteSpeed-fronted installs with opcache, plus any environment where the autoloader transiently failed during the wp.org file-swap, the autoloader could miss the class and the migration would silently mark the schema as “up to date” without actually creating the new table. 1.4.29 added success-tracking to the migration — royal_mcp_db_version only advances when every required create_tables() call actually ran — plus a file-existence force-load fallback so a transient autoloader miss can’t latch the install.

2. The uninstall → reinstall cycle (fixed in 1.4.29)

Pre-1.4.29 uninstall.php dropped all five tables and cleared royal_mcp_settings — but left royal_mcp_db_version in place. If you reinstalled Royal MCP on the same WP install (same DB), the activation hook ran but the runtime healer immediately saw the option still matching the new plugin version and skipped table re-creation. Result: plugin active, no tables, every OAuth call fails. 1.4.29’s uninstall now clears the version option, AND the new healer verifies tables exist regardless of what the option says.

3. External table loss (always — 1.4.29 makes it recoverable)

Tables can also disappear from causes outside Royal MCP’s control: a partial database restore that skipped the royal_mcp_* tables, a hosting-side database swap, a manual DROP TABLE, or a backup-plugin restore that missed the plugin’s custom tables. Pre-1.4.29, these scenarios produced the same stuck state because the healer trusted the option. 1.4.29’s table-existence probe makes any external table-loss self-recoverable on the next pageload, without any user action.

Credit for the analysis

The two stuck-state recovery gaps (paths 2 and 3 above) were diagnosed and reported by @rula99 on the wp.org support forum. Both proposed fixes shipped in 1.4.29 verbatim.

Still Stuck? Two Support Paths

If you’ve worked through the steps above and your connection still fails:

Community Support (free) — wp.org Plugin Forum

Post a new thread at wordpress.org/support/plugin/royal-mcp/. The Royal Plugins team monitors the forum regularly and community members often help disambiguate issues faster than email could. Include the diagnostic info listed below in your post.

Premium Support (paid) — direct one-on-one help

For priority response (24-hour SLA) and hands-on diagnostic help, our Premium Support tier is $149/year. Includes a 30-day “if it breaks again” follow-up window on every resolved ticket.

Information to include in your post or ticket

  • Your hosting provider (SiteGround, o2switch, Hostinger, etc.) so we can check whether we’ve seen this on that host before
  • Royal MCP version from WP Admin → Plugins (must be 1.4.13 or newer for the bypass headers)
  • Output of the curl headers test from the Verify section above — full response headers, not just the body
  • Active caching plugins — output of wp plugin list --status=active if you have WP-CLI access, or a screenshot of the Plugins admin page filtered by “cache”
  • WAF / security plugins that might filter REST requests (Wordfence, iThemes Security, GuardPress, etc.)
  • Whether you have Cloudflare in front of the domain, and if so whether APO is enabled
If your tables exist but OAuth still fails

If the SHOW TABLES LIKE 'wp_royal_mcp_%' query returns all five rows but you’re still seeing OAuth or connection errors, the issue is somewhere other than missing tables. Three common host-side failure modes have dedicated articles:

Or start at the troubleshooting entry point to walk the full symptom-to-doc decision tree.