MCP lets an AI agent discover and use EDPay tools through a shared protocol.
MCP is an open protocol that lets an AI client exchange structured requests and results with tools and data sources. EDPay MCP uses Streamable HTTP and JSON-RPC for that exchange.
Read tools work without credentials. Write tools use the one-time MCP credential created in Dashboard → Developers → EDPay MCP. It packages the existing API key pair; EDPay continues to validate that pair, account, environment, expiry, and scopes as before.
The MCP can look up operations and responses, return safe key setup instructions, create draft invoices, and create payment links when explicitly requested. A draft invoice does not send email or charge anyone. A payment link can accept payment once shared.
EDPay MCP works with AI clients that support remote MCP over Streamable HTTP. Examples include ChatGPT, Claude Code, Gemini CLI, Codex, Google Antigravity, and other MCP-compatible platforms.
We recommend the portable EDPay Agent Skill for maintained integration guidance. Install instructions, supported agents, and the source file are on the Skills page.
https://api-pay.edutecka.com/v1/mcpConfigure the single X-EDPay-MCP-Key header with the value shown once by the dashboard. It contains the existing public/private API key pair. Public setup instructions are available at /v1/mcp/setup, and the edpay_get_key_setup tool gives the same instructions without returning credential values. The versioned API contract is available as the edpay://openapi/v1 MCP resource.
The prompt tells an AI agent what EDPay MCP can do and when to use it.
Implement the requested EDPay checkout in this project. Work in the existing codebase, follow its patterns, and complete the change without asking me to consult documentation pages.
EDPay API: https://api-pay.edutecka.com
EDPay MCP: https://api-pay.edutecka.com/v1/mcp
OpenAPI contract: https://docs-pay.edutecka.com/openapi/v1.yaml
Before editing, identify the language, framework, order flow, and secret storage. Implement EDPay-hosted checkout. The flow below is sufficient to get started; MCP is optional for live discovery. Do not require me to consult documentation pages or invent fields, states, or response shapes.
Integration model:
1. Call GET /v1/public/payment-methods without credentials. Present only entries with enabled=true and availability=active. The method codes covered by this prompt are card, apple_pay, and google_pay; use the names, required fields, currencies, and availability returned by the API instead of hard-coding values.
2. Create a payment with POST /v1/payments and JSON fields amount_minor (positive integer), currency, and optional reference/description. currency must match the account's base currency and be supported by the active method. currency_conversion.base_currency describes the method's base/settlement currency; pricing.currency_code describes the fee currency. Respect the returned values and auto_convert_unsupported setting; never calculate or assume a conversion. The response contains data.id, data.reference, and data.status. Save the ID and reference with the order.
3. Create hosted checkout for that payment with POST /v1/payments/{id}/public-checkout. The JSON body accepts optional embed_origin; use it only as an exact HTTPS origin when the requested flow needs embedding, otherwise send an empty JSON object. The response contains data.id, data.token, and data.expires_at. Return the token to the browser through your app's backend endpoint. To present it, load https://pay.edutecka.com/v1/edpay.js, initialize the documented SDK with the publishable public key only if required, then call edpay.checkout({ token, mode: "redirect" }); modal and embedded are also documented modes, and embedded requires a DOM container. Never send the private key to the browser. Keep card data in EDPay-hosted checkout: do not collect, process, or store card numbers or security codes in the application.
4. Send a stable Idempotency-Key for each write and reuse it when retrying the same request. Confirm the status on the backend with GET /v1/payments/{id} or a verified webhook. Only succeeded confirms payment. pending, processing, and unknown are not confirmation; failed and cancelled are failure states. A browser redirect, SDK success callback, or HTTP 202 does not confirm payment.
Authentication and security:
- Partner requests use HTTPS and X-EDPay-Public-Key plus X-EDPay-Private-Key. Include a stable Idempotency-Key on each write and reuse it only when retrying the same operation.
- Keep API keys out of browser code and repositories. Server-to-server application integrations use X-EDPay-Public-Key and X-EDPay-Private-Key. For the remote MCP client, create a composite credential under Dashboard → Developers → EDPay MCP and store its X-EDPay-MCP-Key value in the client's secure secret store. MCP unpacks the original pair; the API keeps its existing validation. Read tools do not require credentials.
- Implement and validate in Sandbox. Do not make live charges, publish, or deploy to Production without an explicit request.
- Use a currency and methods supported by the EDPay account and application. Do not assume MZN, ZAR, or currency conversion.
- Use a stable idempotency key per business operation and reuse it when retrying the same request. Handle errors and states according to the contract.
- HTTP 202 means accepted/processing, not paid. Never mark an order paid because of a browser redirect or a pending response. Confirm a documented terminal success state server-side or verify a webhook.
- Use hosted checkout to collect payment details. Do not collect or store card data in the application.
Implement the requested flow across the necessary backend and frontend, update example configuration without secrets, and run relevant existing checks. If a business-critical value cannot be safely inferred, ask only for that value. Finish with a summary of changed files, required configuration, and checks performed.