WP SmartPay Pro includes built-in support for the Model Context Protocol (MCP) — an open standard that lets AI assistants like Claude read and act on your store data securely. Once connected, Claude can create coupons, query payments, manage invoices, and more — in plain English, directly from the chat.

Prerequisites

You need the following before connecting an AI assistant to your store:

  • WP SmartPay Pro with an active license
  • MCP Adapter plugin — a free WordPress plugin that exposes SmartPay abilities over HTTP. Install it from the WordPress plugin directory.
  • WordPress Application Password — used as the bearer token for authentication. No separate API key needed.
  • Claude Code or Claude Desktop — the AI client you connect to the endpoint

Note: SmartPay registers all 15 abilities but cannot expose them over HTTP on its own. You must install and activate the MCP Adapter plugin. The Settings page will show a "Find MCP Adapter" button if the plugin is not detected.

Settings Page

Navigate to WPSmartPay → Settings → AI / MCP to find the four configuration cards.

WP SmartPay AI / MCP settings page — all four cards

Connection Status

Shows whether the MCP Adapter plugin is active. A gray dot means the plugin is not installed; a green dot means it is connected and ready. Click Find MCP Adapter to search the WordPress plugin directory and install it in one step.

Connection Status card — gray dot, Find MCP Adapter button

Available Abilities

Lists all 15 registered abilities with their smartpay/-namespaced identifiers. The count badge confirms how many are active. This card is always visible — even before the MCP Adapter is installed.

Available Abilities card — coupon, payment, customer abilities Available Abilities card — invoice, subscription, form abilities

Connect Claude Code and Connect Claude Desktop

Both cards provide ready-to-paste commands pre-filled with your site's MCP endpoint URL. See the connection sections below for step-by-step instructions.

Connect Claude Code and Connect Claude Desktop cards

Available Abilities

All 15 abilities use the smartpay/ namespace. They are always registered — the MCP Adapter exposes them over HTTP once installed.

Coupons

AbilityWhat it doesRequiredOptional
smartpay/create-couponCreate a single discount coupon codecode, discount_type, discount_amountexpiry_date, description
smartpay/list-couponsList coupons with optional filters. Paginated.search, type, page, per_page
smartpay/bulk-generate-couponsGenerate 1–500 unique coupon codes at oncequantity, discount_type, discount_amountprefix, suffix, code_length, expiry_date, usage_limit

Payments

AbilityWhat it doesRequiredOptional
smartpay/list-paymentsList payments with status, gateway, and search filters. Paginated.status, gateway, search, page, per_page
smartpay/get-paymentRetrieve a single payment record with full detailsid

Customers

AbilityWhat it doesRequiredOptional
smartpay/list-customersList customers with optional search by email or name. Paginated.search, page, per_page
smartpay/get-customerRetrieve a customer profile plus their last 20 paymentsid

Invoices

AbilityWhat it doesRequiredOptional
smartpay/create-invoiceCreate a draft invoice. Returns ID, number, and shareable public URL.customer_id, amountdue_date, notes
smartpay/send-invoiceMark a draft invoice as sent and email it to the customerinvoice_id
smartpay/list-invoicesList invoices filtered by status. Paginated.status (draft|sent|paid|void), page, per_page

Subscriptions

AbilityWhat it doesRequiredOptional
smartpay/list-subscriptionsList subscriptions filtered by status (pending, active, cancelled, expired, trialling, failing, completed, suspended).status, page, per_page
smartpay/cancel-subscriptionCancel an active subscriptionsubscription_id

Forms

AbilityWhat it doesRequiredOptional
smartpay/create-formCreate a new payment form with one or more pricing amountstitle, amounts[]status (publish|draft), pay_label
smartpay/list-formsList payment forms with search and status filter. Paginated.search, status, page, per_page
smartpay/get-formRetrieve a form — returns title, status, shortcode, edit URL, and amountsid

Connect Claude Code

Claude Code is Anthropic's CLI tool. Run the command from the Connect Claude Code card in your terminal — Claude Code discovers all 15 abilities automatically.

  1. Install MCP Adapter. Go to Settings → AI / MCP and click Find MCP Adapter. Install and activate the plugin.
  2. Create a WordPress Application Password. Go to Users → Your Profile → Application Passwords. Name it "Claude Code" and copy the generated value.
  3. Run the command shown in the settings card:
    claude mcp add smartpay --transport http "https://your-site.com/wp-json/mcp/mcp-adapter-default-server"
  4. Provide your Application Password as a bearer token when prompted for authentication headers.

Connect Claude Desktop

  1. Open Claude Desktop → Settings → Developer → Edit Config.
  2. Paste the snippet from the Connect Claude Desktop card into claude_desktop_config.json:
    {
      "mcpServers": {
        "smartpay": {
          "url": "https://your-site.com/wp-json/mcp/mcp-adapter-default-server",
          "type": "streamable-http"
        }
      }
    }
  3. Add your WordPress Application Password as a bearer token, then restart Claude Desktop.

Example Prompts

What you say to ClaudeAbility used
"Create a 20% coupon called SUMMER20, valid until August 31"smartpay/create-coupon
"Generate 100 unique codes with a PROMO- prefix, 15% off, one use each"smartpay/bulk-generate-coupons
"Show all Stripe payments from last month"smartpay/list-payments
"Who is customer #42 and what have they bought?"smartpay/get-customer
"Create a $150 invoice for customer #12, due in 30 days, and send it"smartpay/create-invoice + smartpay/send-invoice
"List all failing subscriptions"smartpay/list-subscriptions
"Cancel subscription #88"smartpay/cancel-subscription
"Create a form called 'Conference Ticket' with $50 and $100 tiers"smartpay/create-form

Authentication

The MCP endpoint uses WordPress Application Passwords — available since WordPress 5.6, no extra setup required.

  1. Go to WordPress Admin → Users → Your Profile → Application Passwords.
  2. Enter a name (e.g. "Claude") and click Add New Application Password.
  3. Copy the generated password — it is shown only once.
  4. Use it as the bearer token or HTTP Basic Auth value in your AI client configuration.

Security note: Consider creating a dedicated WordPress user with the minimum required role (e.g. Editor) for AI connections, rather than using your main admin account.

Frequently Asked Questions

Do I need an Anthropic API key in SmartPay?

No. SmartPay acts as an MCP server. The AI client handles the Anthropic connection. No API key is stored in SmartPay settings.

Can I use AI clients other than Claude?

Yes — any MCP-compatible client can connect. The Model Context Protocol is open and not Claude-specific.

Where is the MCP endpoint URL?

It is pre-filled in both connection cards. Format: https://your-site.com/wp-json/mcp/mcp-adapter-default-server

Why can I see the 15 abilities without the MCP Adapter installed?

SmartPay always registers its abilities so you can preview them. The MCP Adapter plugin exposes them over HTTP — it is not bundled with SmartPay Pro.

Can the AI delete payments or customer records?

No. The built-in abilities cover create, list, read, cancel subscription, and send invoice only. There is no delete ability.

How do I disconnect the AI?

Delete or revoke the Application Password from your WordPress user profile. All connections using that credential are immediately invalidated.