The flow you implement
Three steps, in order. Each page contains a paste-ready instruction block for your coding agent plus the underlying API calls.1
User authentication
Connect the user to Agentcard from inside your own app. Your backend
triggers a one-time code and receives the user’s
user_id and connection
tokens — no redirects, no hosted sign-in page.
Implement user authentication →2
Card attachment
Your backend asks Agentcard for a secure link; the user opens it and adds
their card in about a minute (a one-time code from their bank plus a
passkey). The card number is entered on the hosted page only — it never
touches your servers.
Implement card attachment →
3
MCP server
Point your agent at the Agentcard MCP server with the user’s connection
token. The card tools load automatically — the agent creates single-use
cards against the attached card with
connected_card_id.
Wire up the MCP server →When to use which flow
Use attach when your users can pay with a card they already have — it skips KYC and wallet funding entirely. Use create card when you need balance-funded cards (multi-use cards, spend controlled by a prepaid balance) or when the user’s card isn’t eligible: an ineligible attach returnsattach_ineligible, and the agent can switch flows by calling create_card —
which may first require KYC and wallet funding.
Everything works in test mode first — see
Testing cards in staging for eligible test card numbers.