MCP server

The Cryptunnel API is also an MCP server: point a coding agent - Claude Code, Cursor, anything that speaks the Model Context Protocol - at https://api.cryptunnel.io/mcp and it can create and look up payments for you. You build the integration by prompting: the agent creates a sandbox payment, reads its status, lists the currencies you can receive, and writes the code around it.

Nothing to install and nothing to run: it is an HTTP endpoint of the same API. The agent authorizes through your cabinet - you pick which merchant it may act for - and no key is ever pasted into a config file.

1. Add the server

Claude Code

claude mcp add --transport http cryptunnel https://api.cryptunnel.io/mcp

Then run /mcp inside Claude Code and choose Authenticate next to cryptunnel. To share the server with everyone on a project, put it in .mcp.json at the repository root - each person authenticates on their own:

{
  "mcpServers": {
    "cryptunnel": {
      "type": "http",
      "url": "https://api.cryptunnel.io/mcp"
    }
  }
}

Cursor

In .cursor/mcp.json for one project, or ~/.cursor/mcp.json for every project, then click Connect on the server in Cursor's MCP settings:

{
  "mcpServers": {
    "cryptunnel": {
      "url": "https://api.cryptunnel.io/mcp"
    }
  }
}

2. Authorize it

The client opens your browser on the cabinet. Sign in if you are not, then:

  1. Pick the merchant the agent may act for - one authorization, one merchant. Authorize again to connect a second one.
  2. Leave Allow live payments off unless you mean it - see the gate below.
  3. Approve. The browser hands the agent back to the client; from now on its calls carry a token bound to that merchant.

The MCP page in the cabinet lists every authorized agent with its merchant, whether live payments are allowed, and when it was last used. Revoke ends the agent's access immediately; it simply authorizes again if it should come back.

3. Ask for a payment

Create a sandbox payment for 10 USD for order test-1 and give me the checkout link.

The agent calls create_payment and answers with the payment id and a checkout url. Open it: the page lists the testnet coins your merchant can receive. An empty list means no testnet wallet is attached yet - see Test your integration for attaching one and for faucets.

The live-mode gate

An agent must not be one prompt away from a real invoice. So unless you ticked Allow live payments when authorizing, every payment the agent creates is a sandbox payment: the buyer is offered testnet coins only, nothing is charged, and the payment stays out of your stats and fees. If the agent asks for is_test: false, the tool refuses and tells it the authorization has to be granted with live payments enabled - the payment is not silently downgraded.

Even with live payments allowed, a payment is a sandbox one unless the agent passes is_test: false explicitly. The two appeal tools confirm payments and charge fees, so on a live payment they sit behind the same gate: without Allow live payments the agent can check and decide appeals on sandbox payments only.

Tools

ToolWhat the agent gets
create_paymentA checkout url for a given amount and currency, keyed by your external_id
get_paymentOne payment by id, with its status - deliver on confirmed or confirmed_manual
list_paymentsYour payments, newest first, paged
list_currenciesThe currencies you can receive - only those with an active wallet
confirm_payment_by_hashStep one of manual confirmation: the buyer's transaction hash checked against a failed or pending payment - confirmed, waiting with the checks, or refused
decide_appealStep two: approve or reject a waiting appeal by its id

Each tool returns the API response as JSON. An API error comes back as a tool error carrying the API code, for example WALLET_NOT_FOUND: Wallet not found, so the agent can act on it. The endpoint is stateless - no sessions, every request stands on its own - and shares the API's rate limit of 10 requests per second per merchant. Under the hood it is standard OAuth 2.1 with PKCE and dynamic client registration, discoverable from https://api.cryptunnel.io/.well-known/oauth-protected-resource, so any MCP client that follows the specification connects the same way.

📘

The MCP endpoint is for building and testing. Once the integration is written, production traffic goes through the Node, Python or PHP client directly, and the webhook is what confirms a payment.


Did this page help you?