Royal MCP 2.0.0 has 21 actions and 88 filters, read directly from its source code on Nov 17, 2026. The list updates automatically when a new version is released.
How to use these hooks
Actions let you run your own code at a specific moment. Filters let you change a value before the plugin uses it. Put your code in a child theme's functions.php or a code-snippets plugin, never in the plugin's own files, because updates overwrite them.
// Run your own code when Royal MCP fires an action
add_action( 'astra_ability_settings_updated', function( $arg1, $args ) {
// Your code runs here.
}, 10, 2 );
// Change a value Royal MCP is about to use
add_filter( 'royal_mcp_rate_limit_max', function( $tier_ceiling, $tier ) {
// Change $tier_ceiling here.
return $tier_ceiling;
}, 10, 2 );Parts of a name in {braces} are filled in at runtime (for example a post type or field ID). Choose Example on any hook for a ready-to-edit snippet.
All hooks
-
/** * Filter the rate-limit ceiling. Runs per request with tier context so * operators can raise/lower for anon and authed independently. */ apply_filters( 'royal_mcp_rate_limit_max', $tier_ceiling, $tier ); -
/** * Filters the detected SEO plugin. */ apply_filters( 'royal_mcp_seo_plugin_detected', $detected ); -
/** * Lets a site add fields to user rows (after the list_users check). A * non-array return leaves the row as built. */ apply_filters( 'royal_mcp_user_fields', $fields, $u, 'list' ); -
/** * Astra's hook for settings written outside the Customizer, so anything that * caches generated assets refreshes. */ do_action( 'astra_ability_settings_updated', 'royal-mcp/update-theme-design', $args ); -
/** * Filter the access-token TTL in seconds. */ apply_filters( 'royal_mcp_access_token_ttl', $ttl, (int) $user_id, (string) $client_id ); -
/** * Filter the agent-skills index before caching. */ apply_filters( 'royal_mcp_agent_skills_index', $doc ); -
/** * Fires immediately before a destructive Royal MCP tool executes. */ do_action( 'royal_mcp_before_destructive_write', $tool_name, $args ); -
/** * Filters the banners shown in the bar under the header. */ apply_filters( 'royal_mcp_chrome_banners', $slots ); -
/** * Filters the Royal plugins listed on the Dashboard. Each entry has name, * basename, pitch and learn_url, and may have: - also: other plugin files that * count as this plugin being installed - search_slug: the search used for * "Install free" - install_url: an address of its own for a plugin that is not * free */ apply_filters( 'royal_mcp_chrome_tools_family', [ 'royal-ai-firewall' => [ 'name' => __( 'Royal AI Firewall', 'royal-mcp' ), 'basename' => 'royal-ai-firewall/royal-ai-firewall.php', 'icon' => '🛡', 'search_slug' => 'royal-ai-firewall', 'learn_url' => 'https://royalplugins.com/royal-ai-firewall/', 'pitch' => __( 'See every AI agent hitting your site and decide who gets in. Blocks GPTBot, ClaudeBot, PerplexityBot and 60+ others at the W... ); -
/** * Filter the post types that hold code and stay out of the generic post tools. */ apply_filters( 'royal_mcp_code_post_types', [ 'wpcode', 'wbcr-snippets', 'custom-css-js', 'elementor_snippet', 'customize_changeset' ] ); -
/** * Narrow a connection's access level. A filtered value is used only when it is * a known level at least as strict as the connection's own. */ apply_filters( 'royal_mcp_connection_access_level', $level, (string) $this->request_auth_method, $this->request_client_id, (string) $this->request_route ); -
/** * Filter the list of block-attribute keys treated as compatibility-mode * markers on Divi 5 blocks. */ apply_filters( 'royal_mcp_divi_compat_mode_keys', [ 'compatibility_mode', 'compatibilityMode', '__compatibilityMode', 'compat_mode', ] ); -
/** * Filters whether a download by URL may use a reply that other code supplied * on pre_http_request instead of a pinned connection. Default false. */ apply_filters( 'royal_mcp_download_allow_short_circuit', false, $current ); -
/** * Filters whether downloads by URL can be pinned to the checked address. * Returning false makes every download by URL to a remote host refuse. */ apply_filters( 'royal_mcp_download_pin_available', $available ); -
/** * Filters whether a download by URL is treated as going through a proxy. A * download that goes through a proxy cannot be pinned and is refused. */ apply_filters( 'royal_mcp_download_proxy_configured', $through, (string) $url ); -
/** * Allow hosts to suppress the auto-fired save_post if their plugin stack does * heavy work in save_post subscribers that shouldn't run on a meta-only edit. */ apply_filters( 'royal_mcp_fire_save_post_after_write', true, $post_id, $post ); -
/** * Filters which personal fields of form entries the form tools return. */ apply_filters( 'royal_mcp_form_entry_fields', [], (string) $plugin, (int) $form_id, (string) $context ); -
/** * Filter how many days Activity Log entries are kept. Return 0 to keep them * all. Receives the period chosen on the Activity Log screen (90 days until * one is chosen). */ apply_filters( 'royal_mcp_log_retention_days', self::log_retention_choice() ); -
/** * Fires after a pending-approval OAuth client is persisted. Cross-plugin hook * for security-adjacent tools to log or react. */ do_action( 'royal_mcp_oauth_client_pending_registered', $client['client_id'], [ 'client_name' => $client['client_name'] ?? '', 'redirect_uris' => $client['redirect_uris'] ?? [], 'ip_address' => $ip, 'user_agent' => $ua_header, ] ); -
/** * Filter the options wp_get_plugin_settings leaves out, by exact name or a * prefix ending in * (e.g. 'myplugin_private_*'). */ apply_filters( 'royal_mcp_plugin_settings_excluded_options', [], $slug ); -
/** * Which resource identifier the ROOT protected-resource document names. */ apply_filters( 'royal_mcp_prm_root_resource', 'endpoint' ); -
/** * Name of another plugin that owns the site-root OAuth discovery documents, or * ''. */ apply_filters( 'royal_mcp_root_oauth_documents_owner', $owner ); -
/** * Plugin folders treated as security plugins by the plugin lifecycle tools. */ apply_filters( 'royal_mcp_security_plugin_folders', self::SECURITY_FOLDERS ); -
/** * Filter the assembled server card before caching. */ apply_filters( 'royal_mcp_server_card', $card ); -
/** * Filters the skills listed on the Skills screen. */ apply_filters( 'royal_mcp_skills_catalog', $skills ); -
/** * Filter the redirect URIs a static OAuth client may use when none are * registered. */ apply_filters( 'royal_mcp_static_client_default_redirects', [ 'https://claude.ai/api/mcp/auth_callback', 'https://claude.com/api/mcp/auth_callback', 'https://chatgpt.com/connector_platform_oauth_redirect', ] ); -
/** * Filter the tools whose replies get the strict credential checks on free * text. */ apply_filters( 'royal_mcp_strict_scrub_tool', in_array( (string) $name, $tools, true ), (string) $name ); -
/** * Fires after every MCP tool invocation. Surfaces inbound MCP traffic to * observability plugins (Royal AI Firewall, etc.) so they can record + * classify the calling agent in real-time. */ do_action( 'royal_mcp_tool_called', (string) $tool_name, (string) $status, (string) ($error_message ?? '') ); -
/** * Filter the profile → prefixes map. Pro adds custom profiles here. */ apply_filters( 'royal_mcp_tool_profile_prefixes', $profiles ); -
/** * Filters the tool => required plugin map used for the availability flag in * tools/list. */ apply_filters( 'royal_mcp_tool_requirements', $map ); -
/** * Filter the tools whose replies reach the AI client without credential * scrubbing. Only list tools whose purpose is to hand back a link or key the * caller asked for. */ apply_filters( 'royal_mcp_unscrubbed_tools', [ 'wp_create_preview_link', 'wp_create_login_link', 'wc_create_order', 'get_tool_info', 'discover_tools', 'royal_mcp_connection_health', 'mcp_get_skill', ] ); -
/** * WordPress core filter — respected here so third-party sites that have * customized the lock window get consistent behavior across the WP editor and * every builder's write guard. */ apply_filters( 'wp_check_post_lock_window', $default ); -
do_action( 'raif_policy_override_cleared', $bot_id ); -
apply_filters( 'royal_mcp_writable_theme_mods', [] ); -
do_action( 'litespeed_purge_all', 'Royal MCP' ); -
do_action( 'litespeed_purge_post', $post_id ); -
do_action( 'litespeed_purge_url', $path ); -
apply_filters( 'royal_mcp_chrome_wordmark', __( 'Royal MCP', 'royal-mcp' ) ); -
apply_filters( 'royal_mcp_cimd_enabled', true ); -
apply_filters( 'royal_mcp_rate_limit_window', $this->rate_limit_window ); -
apply_filters( 'royal_mcp_revoke_all_sessions_allowed', true, get_current_user_id() ); -
apply_filters( "{$dm_term?}add_term_metadata{:}add_post_metadata", null, $dm_id, $dm_key, maybe_unserialize( (string) reset( $dm_raw ) ), false ); -
apply_filters( 'acf/allow_unfiltered_html', current_user_can( 'unfiltered_html' ) ); -
do_action( 'blocksy:dynamic-css:refresh-caches' ); -
apply_filters( 'cmplz_capability', 'manage_privacy' ); -
do_action( 'code_snippets/update_snippet', $updated, $table ); -
do_action( 'elementor/atomic-widgets/styles/clear', [ 'local', $post_id ] ); -
apply_filters( 'https_local_ssl_verify', false ); -
apply_filters( 'litespeed_conf', $id ); -
apply_filters( 'ninja_forms_admin_all_forms_capabilities', 'manage_options' ); -
apply_filters( 'ninja_forms_admin_submissions_capabilities', 'manage_options' ); -
do_action( 'post_updated', $post_id, $post, $post ); -
apply_filters( 'query_vars', $wp->public_query_vars ); -
do_action( 'redirection_redirect_updated', $id, \Red_Item::get_by_id( $id ) ); -
apply_filters( 'relevanssi_options_capability', 'manage_options' ); -
apply_filters( 'relevanssi_user_searches_capability', 'edit_pages' ); -
apply_filters( 'rocket_mcp_oauth_server_enabled', true ); -
apply_filters( 'royal_mcp_acf_setup_active', $default ); -
apply_filters( 'royal_mcp_allowed_origins', $allowed_hosts ); -
apply_filters( 'royal_mcp_bump_modified_on_meta_write', true, $post_id ); -
apply_filters( 'royal_mcp_call_reads', false, $name, $args ); -
apply_filters( 'royal_mcp_change_view_order_contact', false, $gc_change ); -
apply_filters( 'royal_mcp_chrome_docs_url', 'https://royalplugins.com/support/royal-mcp/' ); -
do_action( 'royal_mcp_chrome_header_actions_pre' ); -
apply_filters( 'royal_mcp_chrome_newsletter_url', 'https://royalplugins.com/newsletter' ); -
apply_filters( 'royal_mcp_chrome_support_url', 'https://wordpress.org/support/plugin/royal-mcp/' ); -
apply_filters( 'royal_mcp_chrome_version', defined( 'ROYAL_MCP_VERSION' ) ? ROYAL_MCP_VERSION : '' ); -
apply_filters( 'royal_mcp_cimd_cache_ttl', HOUR_IN_SECONDS ); -
apply_filters( 'royal_mcp_cimd_fetches_per_ip', 20 ); -
apply_filters( 'royal_mcp_cimd_resolved_ips', $ips, $host ); -
apply_filters( 'royal_mcp_cloudflare_ranges', self::CLOUDFLARE_RANGES ); -
apply_filters( 'royal_mcp_disambiguate_tool_descriptions', true ); -
apply_filters( 'royal_mcp_elementor_native_mcp_active', null ); -
apply_filters( 'royal_mcp_execute_tool_external', null, (string) $name, is_array( $args ) ? $args : [] ); -
apply_filters( 'royal_mcp_maintenance_report_include_attachment', false ); -
apply_filters( 'royal_mcp_meta_value_sanitizer', $sanitized, $raw, (string) $meta_key, (int) $object_id, (string) $tool_name ); -
apply_filters( 'royal_mcp_oauth_gc_ttl_days', 14 ); -
apply_filters( 'royal_mcp_oauth_issuer_mode', 'namespace' ); -
apply_filters( 'royal_mcp_oauth_rewrite_paths', [ 'authorize' => 'authorize', 'token' => 'token', 'register' => 'register', 'revoke' => 'revoke', ] ); -
apply_filters( 'royal_mcp_pending_client_ttl_hours', 48 ); -
apply_filters( 'royal_mcp_protected_resource_metadata_url', $default ); -
apply_filters( 'royal_mcp_protocol_counter_enabled', true ); -
apply_filters( 'royal_mcp_readable_options', $default ); -
apply_filters( 'royal_mcp_record_php_errors', '0' !== (string) get_option( self::SETTING, '1' ) ); -
apply_filters( 'royal_mcp_refresh_grace_retries', self::REFRESH_GRACE_RETRIES ); -
apply_filters( 'royal_mcp_resource_paths', [ '/wp-json/royal-mcp/v1/mcp', '/wp-json/royal-mcp/v1', '/wp-json/royal-mcp/v1/messages', '/mcp', ] ); -
apply_filters( 'royal_mcp_scrub_tool_opts', $opts, (string) $name ); -
apply_filters( 'royal_mcp_settings_capability', 'manage_options' ); -
do_action( 'royal_mcp_tool_call_end', (string) $name ); -
apply_filters( 'royal_mcp_tool_call_exception', $e, (string) $name, is_array( $args ) ? $args : [] ); -
apply_filters( 'royal_mcp_tool_call_result', $result, (string) $name, is_array( $args ) ? $args : [] ); -
do_action( 'royal_mcp_tool_call_start', (string) $name, is_array( $args ) ? $args : [] ); -
do_action( 'royal_mcp_tool_context', (string) $tool_name, $context ); -
apply_filters( 'royal_mcp_tools', $builtin ); -
apply_filters( 'royal_mcp_tools_list_page_size', 0 ); -
apply_filters( 'royal_mcp_trust_cloudflare_ip', self::is_cloudflare_ip( $remote_addr ) ); -
apply_filters( 'royal_mcp_trusted_proxies', [] ); -
apply_filters( 'royal_mcp_undo_ttl_seconds', self::DEFAULT_TTL ); -
apply_filters( 'royal_mcp_writable_options', $default_writable ); -
apply_filters( 'royal_mcp_yoast_sync_rebuild', true, $post_id ); -
do_action( 'save_post', $post_id, $post, true ); -
do_action( "save_post_{$post->post_type}", $post_id, $post, true ); -
apply_filters( 'seopress_dyn_variables_fn', null, $post, true ); -
apply_filters( 'the_content', (string) $post->post_content ); -
apply_filters( 'updraft_backupnow_options', $options, [] ); -
do_action( 'wp_after_insert_post', $post_id, $post, true, $post ); -
do_action( 'wp_insert_post', $post_id, $post, true ); -
apply_filters( 'wpmedia_mcp_oauth_server_enabled', $default );
Generated from Royal MCP's GPL-licensed source code. Hooks inside bundled third-party libraries are not listed.
Done for you
Rather have it built for you?
Tell us what should change and we’ll write and test the code using these hooks.
Custom hook snippet
from $49
A small, update-safe change built on the plugin’s own hooks.
- Code written against the plugin’s actions and filters
- Tested on a staging copy of your site
- Install instructions included
Typical turnaround: 2–3 business days
Choose thisPlugin customisation
from $149
New features or changed behaviour, without editing the plugin’s files.
- Built as a companion plugin, so updates never wipe it
- Exact quote before we start
- Tested on staging, then deployed
Typical turnaround: 3–7 business days
Choose thisNot sure which fits? Describe what you need and we’ll suggest the simplest option.
Can't find the right hook?
We can build the customisation for you. Describe what you need: