Cripay Docs

Integrate with your AI agent

Connect Cripay's MCP server to Claude Code, Cursor, Codex or OpenCode and let the agent do the whole integration, create test payments and check the webhooks itself.

Cripay ships an MCP server (Model Context Protocol) inside the API. Connect it to your coding agent and the agent can read the integration guide, create test payments and payment links, register your webhook endpoint, simulate outcomes and inspect every delivery, all with your API key and nothing else. No package to install.

1. Create a test API key

In the app, Developers → API keys → New. Copy the cpr_test_… key once. The agent only ever sees this key through its configuration, never through your code.

2. Connect the server

The server lives at https://<your api>/mcp (the URL is shown under Developers → Let your AI do the integration). It speaks Streamable HTTP and authenticates with the same Authorization: Bearer header as the REST API.

Claude Code

claude mcp add --transport http cryptopay https://<your api>/mcp --header "Authorization: Bearer cpr_test_…"

Cursor (.cursor/mcp.json in the project, or ~/.cursor/mcp.json)

{
  "mcpServers": {
    "cryptopay": { "url": "https://<your api>/mcp", "headers": { "Authorization": "Bearer cpr_test_…" } }
  }
}

Codex (~/.codex/config.toml)

[mcp_servers.cryptopay]
url = "https://<your api>/mcp"
http_headers = { "Authorization" = "Bearer cpr_test_…" }

OpenCode (opencode.json)

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "cryptopay": { "type": "remote", "url": "https://<your api>/mcp", "headers": { "Authorization": "Bearer cpr_test_…" } }
  }
}

Any other agent: the same guide is plain text at https://<your api>/llms.txt; paste the prompt below.

3. Paste the prompt

Integrate Cripay crypto payments into this project in test mode. First read the MCP resource
cryptopay://guide (or https://<your api>/llms.txt) and follow its checklist: create payments
server-side with an Idempotency-Key and send the customer to checkout_url; add a webhook route
that verifies X-CryptoPay-Signature over the raw body, answers 200 first, de-duplicates by
event.id and fulfils the order on payment.confirmed or payment.overpaid; read CRYPTOPAY_API_KEY,
CRYPTOPAY_API_URL and CRYPTOPAY_WEBHOOK_SECRET from environment variables (never commit keys).
Then prove it works: create the webhook endpoint, create a payment, simulate it with outcome
success and check the delivery in the webhook log. Finish with the files you changed and how to
switch to a live key.

The Developers page copies this prompt with your real URLs filled in.

What the agent gets

KindNameWhat it does
resourcecryptopay://guideThe complete integration guide: auth, payment flow, statuses, webhook verification in Node, Python and PHP, embed, SDK, go-live checklist
resourcecryptopay://openapiThe OpenAPI 3.1 document of the whole API
promptintegrateThe prompt above, with an optional stack argument
toollist_currencies, estimate_paymentWhat can be paid where, and the exact amount and fee for a price
toolcreate_payment, get_payment, list_payments, cancel_paymentPayments, with idempotency_key
toolsimulate_test_paymentTest mode only: success, underpaid, overpaid, expired, failed
toolcreate_payment_link, list_payment_linksReusable links
toolcreate_webhook_endpoint, list_webhook_endpoints, send_test_webhook, list_webhook_deliveries, retry_webhook_deliveryThe webhook side, including every delivery with your server's response
toolget_merchant, list_balances, list_request_logsSettings, balances and your recent API calls for debugging a 4xx
toolget_integration_guideThe guide as a tool result, for clients without resource support

Every tool call goes through the public API with your key, so scopes, test/live mode, idempotency and request logs apply exactly as they do to your own code. A test key cannot touch real money.

Going live

When the agent is done and you have seen a simulated payment confirm and its webhook arrive, create a live key, a live webhook endpoint and swap the two values in your environment. The MCP configuration can stay on the test key.

On this page