Docs

AI Tools and MCPNew

6 min readUpdated November 24, 2026

WP Smart Consent can be used by AI assistants. It registers its features with the WordPress Abilities API, the standard way WordPress tells AI tools what a plugin can do. An assistant connected to your site through the WordPress MCP Adapter, or any MCP plugin that reads abilities, can then check your setup, report on consent and, if you allow it, make changes.

Everything is off until you switch it on.

Before you start#

  • WP Smart Consent 1.5.4 on WordPress 7.1 or newer.
  • An MCP plugin on your site, such as the official WordPress MCP Adapter.
  • An administrator account for the assistant to sign in as, usually with an application password (Users → Profile → Application Passwords). A dedicated administrator account makes the activity log easier to read.

Turning it on#

  1. Go to WP Smart Consent → AI tools.
  2. Switch on the groups you want:
    • Allow AI tools
    • Allow changes
    • Allow personal data lookups
  3. Click Save.

The Available tools box shows exactly what a connected assistant can see.

AI tools tab with Allow AI tools and Allow changes switched on, the Available tools list and the AI activity table

Each switch decides whether its tools exist at all. A tool that’s switched off can’t be listed or called by any assistant. Allow changes and Allow personal data lookups only work while Allow AI tools is on.

What an assistant can do#

Allow AI tools (read-only)#

Tool What it returns
get-status Version, logging and IP-storage settings, geo provider, which checkouts, forms, CRMs and webhooks are on, the last audit-trail check and the number of recent CRM failures
list-integrations Every integration with its on/off state. For CRMs, whether they’re connected and their selected and available lists. Webhooks show only their host
get-settings Checkbox label, pre-check and colour, logging and retention, geo provider and geo rule lists, data fields
get-consent-stats Entries, consented, declined and opt-in rate for a period, optionally by day, month, source or country. Totals only
list-crm-failures Recent contacts a cloud CRM rejected, with the CRM, time and error. Emails are masked
verify-audit-trail Whether the consent log’s hash chain is intact, the same as Verify now

API keys and other secrets are never returned.

Things you can ask: – “Which CRMs is WP Smart Consent sending to?” – “What was our opt-in rate by source over the last 90 days?” – “Why didn’t yesterday’s customers reach Klaviyo?”

Allow changes#

Tool What it does
set-integration-enabled Turns a checkout, form plugin, CRM or email platform on or off
set-crm-lists Replaces the lists a CRM sends consenting contacts to (list IDs or exact names)
update-checkbox Changes the label (simple HTML such as a privacy-policy link is allowed), colour, text size or pre-check
update-geo-rules Adds or removes countries on the pre-checked and force-unchecked lists, and US states on the force-unchecked list
send-test-webhook Sends a sample payload to a saved webhook and returns the response status

Some limits apply: – Connection details such as API keys are still entered on the dashboard. – Countries whose law requires opt-in consent, such as the EU, UK, Canada and Australia, can never be pre-checked or taken off the force-unchecked list through AI tools. If you have legal advice saying otherwise, change it on the Geo rules tab yourself. – A test webhook can only go to a webhook you’ve already saved.

Allow personal data lookups#

Tool What it returns
lookup-consent For one exact email address: each consent entry’s date, source, country and whether they agreed, plus their current status

IP addresses and browser details are not returned, and there’s no way to list or search people. Use it to answer a person’s request about their own consent.

Never available#

  • Deleting log entries.
  • Exports.
  • Reading or entering API keys.
  • Log retention.

GDPR and privacy#

  • Personal data goes to your AI provider. When you allow lookups, the email address and the result are sent to the AI service your assistant uses. That provider processes personal data on your behalf, so you need a data processing agreement with it, and possibly safeguards for transfers outside the EU. Leave the switch off if you don’t need it.
  • Read-only tools contain no personal data. Statistics are totals, and CRM failures and the activity log mask email addresses (j***@example.com).
  • Changes are recorded. A consent record is only as good as the label the person saw. Every label change made by an assistant is logged with its old and new text.
  • Privacy policy. WP Smart Consent adds suggested text under Settings → Privacy → Policy Guide. It includes a paragraph about AI lookups when that switch is on.

The AI activity log#

The AI activity box lists the last 50 tool calls. Each row shows: – the time (UTC); – the WordPress user; – the tool and the result; – for changes, a Changes link with the before and after values.

Failed calls are shown in red, for example a refused geo change. The log keeps the last 200 calls and is removed when you uninstall the plugin.

Connecting an assistant#

Steps differ by MCP plugin. With the WordPress MCP Adapter:

  1. Install and activate the MCP Adapter.
  2. Create an application password for the administrator account the assistant should use.
  3. Add the site to your AI app as an MCP server, following the MCP Adapter’s instructions. The adapter exposes three tools:
    • discover abilities: lists what’s available;
    • get ability info: describes one ability;
    • execute ability: runs it.
  4. Ask the assistant to list the abilities. The wpsmartconsent/ ones are WP Smart Consent’s.

For developers#

REST#

Abilities run through the core Abilities API REST routes:

# List WP Smart Consent abilities
curl -u admin:APP_PASSWORD "https://example.com/wp-json/wp-abilities/v1/abilities?category=wpsmartconsent"

# Read-only abilities use GET; input goes in the query string
curl -u admin:APP_PASSWORD "https://example.com/wp-json/wp-abilities/v1/abilities/wpsmartconsent/get-consent-stats/run?input[days]=90&input[group_by]=source"

# Abilities that change something use POST with a JSON body
curl -u admin:APP_PASSWORD -X POST -H "Content-Type: application/json" \
  -d '{"input":{"slug":"mailchimp","enabled":true}}' \
  "https://example.com/wp-json/wp-abilities/v1/abilities/wpsmartconsent/set-integration-enabled/run"

lookup-consent is deliberately not marked read-only, so it uses POST. The email address then travels in the request body rather than the URL, where it would end up in server logs.

PHP#

$ability = wp_get_ability( 'wpsmartconsent/get-consent-stats' );
if ( $ability ) {
    $stats = $ability->execute( [ 'days' => 30, 'group_by' => 'country' ] );
}

Adding your own tools#

add_filter( 'wpsc_abilities', function ( $abilities ) {
    $abilities['vip-count'] = [
        'tier'        => 'read', // read, change or personal
        'label'       => 'Count VIP opt-ins',
        'description' => 'Number of consenting entries from the VIP form this month.',
        'annotations' => [ 'readonly' => true, 'destructive' => false, 'idempotent' => true ],
        'execute'     => function ( array $input ) {
            return [ 'count' => my_vip_count(), '_summary' => 'Counted VIP opt-ins' ];
        },
    ];
    return $abilities;
} );

Your tool is registered as wpsmartconsent/vip-count. It follows its tier’s switch, requires administrator rights and is written to the activity log. Return a WP_Error to fail.

The optional _summary (one line) and _changes ([ field => [ 'before' => …, 'after' => … ] ]) keys go to the activity log and are removed from the response. Add input and output with JSON Schema arrays to describe parameters.

Hooks#

  • wpsc_abilities (filter): the tool registry.
  • wpsc_ai_activity_logged (action): fires after each call is logged, with ( $ability, $ok, $summary, $changes ). Use it to forward AI activity to your own audit system.

Troubleshooting#

The assistant doesn’t see any WP Smart Consent tools. – Check that Allow AI tools is on and saved. – Check that the assistant signs in as an administrator. – Ask the assistant to discover abilities again; some apps cache the list.

“Ability does not have necessary permission.” The account isn’t an administrator, or the tool’s switch was turned off. WordPress doesn’t tell the assistant which, on purpose.

A geo change was refused. The country requires opt-in consent. See Geo Rules: Default Country List.

This website uses cookies to enhance your browsing experience and ensure the site functions properly. By continuing to use this site, you acknowledge and accept our use of cookies.

Accept All Accept Required Only