MCP / AI Integration

Add ReBate Pay's MCP server to Claude, Cursor, VS Code or any AI coding tool so it can read the docs and API reference, work with your sandbox data and write the integration — high-risk actions always need your approval.

View as Markdown

ReBate Pay runs a standard MCP (Model Context Protocol) server at https://YOUR-REBATEPAY-HOST/mcp (Streamable HTTP, JSON-RPC 2.0). Once connected, an AI coding tool can read the developer docs and API reference, look at your sandbox account, create products and payment links, simulate payments, and write the integration code following the integration guides.

Sandbox:AvailableProduction:Planned / Not availableThe MCP server works on sandbox data only; nothing touches real money before production launch.

Connect in three steps

  1. 1Create a sandbox API key in the console under Developers → API keys (sk_test_…; it needs the mcp:invoke scope, included by default).
  2. 2Paste the config for your tool below and replace sk_test_YOUR_KEY (the console under Developers → MCP / AI shows versions with your URL filled in).
  3. 3Ask the AI to “integrate ReBate Pay payments”. It calls get_integration_guide and get_account first, then writes the code.
claude mcp add --transport http rebatepay https://YOUR-REBATEPAY-HOST/mcp \
  --header "Authorization: Bearer sk_test_YOUR_KEY"
Connecting without a key works too, with documentation tools only (docs, API reference, guides, error codes, sandbox testing). Keep the key on your own machine or server — never in a public place or a repository.

Tools

GroupToolsHow it runs
Docs (no key)search_docs, get_doc, list_api_operations, get_api_operation, get_integration_guide, lookup_error, get_sandbox_testing_guideRead-only
Accountget_account, customers_list/get, products_list, prices_list, subscriptions_list/get, payments_list/get, payment_links_list, checkouts_get, webhook_endpoints_list, webhook_events_list, usage_summary, entitlements_check, analytics_summary, onboarding_statusRead-only
Sandbox dataproducts_create, prices_create, customers_create, onboarding_draft_updateWrite (runs at once)
High-riskpayment_links_create, subscriptions_create, refunds_create, sandbox_simulate_payment, onboarding_submitPreview → you approve in the console → `confirm_action`

The server also offers resources (every docs page as rebatepay://docs/{slug}, plus rebatepay://openapi.json) and prompts (integrate_rebatepay, add_subscription_billing, verify_webhooks) for clients that support them.

High-risk actions need a person

  1. 1When the AI calls a high-risk tool (e.g. refunds_create) nothing runs: it gets a preview and a confirm_token.
  2. 2The request appears in the console under Developers → MCP / AI → AI actions waiting for approval. You review it and approve or reject (valid for 30 minutes).
  3. 3Only after approval does the AI's confirm_action call with the confirm_token run it. Before that it gets APPROVAL_REQUIRED; after a rejection, APPROVAL_REJECTED.
  4. 4Each confirm token works once, and the AI can never do more than the API key's scopes allow.
MCP never returns secrets: a webhook signing secret (whsec_…) is shown once when you create the endpoint in the console, so create webhook endpoints under Developers → Webhooks. The AI never handles real card numbers — customers always enter cards on ReBate Pay's hosted page.

Auditing

Every MCP call (previews, approvals and rejections included) is recorded in the audit trail with sensitive fields redacted. The console shows recent AI activity under Developers → MCP / AI.

Without MCP: the REST tools

The same tools are available over plain REST (scope mcp:invoke) for your own AI agents:

GET/api/Mcp/Tool— List tools with risk tier and required scope
POST/api/Mcp/Tool/Preview— Preview; high-risk tools return a one-time confirmToken
POST/api/Mcp/Tool/call— Run a read or write tool
POST/api/Mcp/Tool/confirm— Run a high-risk tool with its confirmToken
GET/api/Mcp/Execution— Tool execution history

Plain-text docs for AI tools: /llms.txt (an index of every page) and /llms-full.txt (all docs in one file).