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 two endpoints:

EndpointAuthServes
https://mcp.elasticpay.co/docs/mcpNoneDocumentation and API-schema tools only
https://mcp.elasticpay.co/mcpOAuth or sandbox secret keyDocs tools plus the sandbox write loop
https://mcp.elasticpay.co/live/mcpOAuth onlyDocs 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

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.

What the grant covers, in plain terms:

  • It authorises the application for your organisation’s sandbox account. A grant made here operates on sandbox data only — reading a live account is a separate, read-only connection with its own consent (Operate a live account).
  • Access tokens are short-lived and refresh automatically; disconnecting the server from your MCP client ends its use, and every grant 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)

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 \
--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.

What to do next

  • 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.