Skip to content

Connect an Agent

ElasticPay runs a hosted MCP server at mcp.elasticpay.co. An MCP-capable agent — Claude Code, Cursor, an MCP inspector, or anything speaking streamable HTTP — can search these docs, read the API schema, and run a complete sandbox integration (customers, payment methods, payments, recurring plans, test clocks, webhook events) without you copying keys into config files.

There are three endpoints, all under one namespace:

Endpoint Auth Serves
https://mcp.elasticpay.co/mcp/docs None Documentation and API-schema tools only
https://mcp.elasticpay.co/mcp/sandbox OAuth or sandbox secret key Docs tools plus the sandbox write loop
https://mcp.elasticpay.co/mcp/live OAuth only Docs tools plus read-only access to your live account — see Operate a live account

The public endpoint means an agent can start reading documentation and exact API shapes before anyone has an ElasticPay account. This page covers the sandbox connect; live read-only has its own page and accepts no API keys.

The MCP server implements standard OAuth discovery, dynamic client registration, and PKCE, so any compliant MCP client can connect with no pre-shared credentials. In Claude Code:

Terminal window
claude mcp add --transport http elasticpay https://mcp.elasticpay.co/mcp/sandbox

Then, inside a session, run /mcp and choose Authenticate. A browser opens to the ElasticPay dashboard: sign in (or sign up — a sandbox account is created immediately), review the consent screen, and click Approve. The agent never sees a key; approving the connection is the whole setup.

If your organisation has more than one sandbox account, the consent screen lists them with the account you’re working in preselected: choose the one this connection is for before approving.

What the grant covers, in plain terms:

  • It authorises the application for one sandbox account: the one named on the consent screen, or the one you chose. A grant made here operates on that account’s sandbox data only — reading a live account is a separate, read-only connection with its own consent (Operate a live account).
  • To switch to another account, reconnect: authenticate the server again from your MCP client (in Claude Code, /mcp) and choose the other account on the consent screen. The earlier connection stays listed under Connected apps until you disconnect it there.
  • Access tokens are short-lived and refresh automatically; disconnecting the server from your MCP client ends its use, and every connection can be revoked from the dashboard under Connected apps (in the account menu, or via Settings).

Verify the connection by asking the agent to call whoami:

{
"auth": "oauth",
"mode": "sandbox",
"biller_id": "acct_…",
"biller_name": "Your Business - Sandbox",
"organisation_id": "org_…"
}

Option 2 — sandbox secret key (headless)

Section titled “Option 2 — sandbox secret key (headless)”

For CI or contexts where a browser flow is impossible, supply a sandbox secret key as a bearer token:

Terminal window
claude mcp add --transport http elasticpay https://mcp.elasticpay.co/mcp/sandbox \
--header "Authorization: Bearer sk_sandbox_..."

Get the key from the dashboard — see Get a sandbox API key. Only sk_sandbox_ keys are accepted: live secret keys and publishable (pk_) keys are rejected outright.

  • Browse the full tool surface in the tool reference.
  • Have the agent run the end-to-end integration loop — including watching a recurring plan renew under a test clock.
  • Moving off another platform? Have it stage the migration for you to approve in the dashboard: customers first, then their payment plans.