Resources

Using Deripay with AI agents

Connect Claude Code, Codex or Cursor to the Deripay MCP server and machine-readable docs.

Deripay runs an MCP server so your AI coding agent can read these docs, look up error codes, manage your Deriv apps, keys and webhooks, and check your integration, without you pasting secrets into a chat.

The MCP server

text
https://deriapi.site/mcp
  • Transport: Streamable HTTP.
  • Sign-in: OAuth with your Deripay account. The first time your agent connects, a browser window opens and you sign in. You never paste an API key into the agent.
  • The server never moves money. It has no tool to start a deposit, a withdrawal, an OTP or a confirm. Those only happen through the REST API with your secret key, from your server.

Setup

Claude Code

bash
claude mcp add --transport http deripay https://deriapi.site/mcp

Codex

Add to ~/.codex/config.toml:

toml
[mcp_servers.deripay]
url = "https://deriapi.site/mcp"

Cursor

Add to .cursor/mcp.json in your project:

json
{
  "mcpServers": {
    "deripay": {
      "url": "https://deriapi.site/mcp"
    }
  }
}

Tools

Docs

Tool What it does
search_docs Keyword search across these docs.
get_doc One docs page as Markdown, by slug (for example deposits). Without a slug, lists the pages.
get_integration_guide The integration pages in order, plus examples for your framework (nextjs, node, php, python).
get_code_example Code samples from these docs for a topic and language.
get_error_code Meaning and fix for one error code.
get_openapi The OpenAPI document for /api/v2.

Account

Tool What it does
get_account Your Deripay developer account.
list_deriv_apps, add_deriv_app, remove_deriv_app Manage the Deriv OAuth client IDs on your account.
list_api_keys, create_api_key, revoke_api_key Manage API keys. A new key's secret is shown once.
list_webhooks, create_webhook, update_webhook, delete_webhook Manage webhook endpoints.
send_test_webhook Send a signed ping event to an endpoint.

Data (read only)

Tool What it does
list_transactions, get_transaction Your transactions.
list_connections Your customer connections.
get_earnings Your earnings from completed transactions.
get_markets, get_rates Open markets, live rates and limits.

Checks

Tool What it does
check_integration Checks your setup (Deriv app with an https redirect, an active key that has been used, a working webhook endpoint, connected customers, recent transactions) and says what is missing. Can send a test webhook.

The implement_cashier prompt

The server also offers a prompt named implement_cashier. It gives your agent the full brief for adding a Deripay cashier to your project: Deriv OAuth with PKCE, connections, deposits with customer actions, withdrawals with the Deriv code, webhooks with signature checks, and the go-live checklist. In Claude Code, MCP prompts appear as slash commands, here /mcp__deripay__implement_cashier.

Every docs page is also available as an MCP resource at deripay://docs/{slug}.

Machine-readable docs

URL Contents
/llms.txt Short index of every docs page, for agents.
/llms-full.txt All docs pages in one Markdown file.
/openapi.json OpenAPI document for /api/v2, generated from the same request schemas the API validates with.

A prompt to give your agent

Copy this into Claude Code, Codex or Cursor after you add the MCP server:

text
Add a Deripay mobile money cashier to this project. Use the deripay MCP server
for docs (search_docs, get_doc, get_code_example, get_error_code) and follow
them exactly; do not guess field names.

Requirements:
- All Deripay calls are server side, base URL https://deriapi.site/api/v2,
  header Authorization: Bearer from the DERIPAY_API_KEY environment variable.
  The key must never reach the browser.
- Deriv sign-in: OAuth 2.0 Authorization Code with PKCE (S256), scopes
  "trade account_manage payment", check state, then POST /connections and store
  the con_ id against the user. A pasted Deriv personal access token with the
  same scopes can be sent to POST /connections instead. Do not store the Deriv
  token.
- Deposits: read GET /markets and GET /rates?country=, enforce whole-number
  limits, POST /deposits with an Idempotency-Key saved before sending, and
  handle customer_action steps otp, redirect, ussd and unsupported.
- Withdrawals: POST /withdrawals with amount_usd, ask for the Deriv code,
  POST /withdrawals/{id}/confirm, offer resend, handle
  WITHDRAWAL_ALREADY_ACTIVE and Retry-After.
- Status: a webhook route that verifies Deripay-Signature with
  DERIPAY_WEBHOOK_SECRET on the raw body (5 minute window) and dedupes by
  event id, plus a server-side relay of GET /transactions/{id}/events for the
  cashier screen.
- Branch on error.code. Show success only when state is "completed".

When done, run check_integration and walk me through the go-live checklist.

Your agent can set up Deriv apps, keys and webhooks for you through the account tools. It cannot move money, and it should never print a full API key or webhook secret into your code. Put those in your environment.