AgentCard MCP Server
Give your AI agent a real payment method, straight from Claude, Cursor, or any MCP client. The agentcard-mcp server exposes AgentCard's purchase surface as MCP tools: your agent pays securely with the card you already have. Mastercard holders pay through Mastercard Agent Pay (the default: a one-time network token per purchase, scoped to the merchant and amount and approved with a passkey). Any other card gets a one-time card number capped at the purchase amount (instant, live for 7 days).
Spending is guarded end to end: per-card caps, separate account budgets per payment source, a hard daily ceiling, and KYC verification.
Requirements
- Node.js 18+ on the machine running your MCP client. That's it — the server runs locally over stdio, wraps the
agentcardCLI vianpx, and needs no API keys or hosted infrastructure. Your session is stored at~/.agentcard/config.json.
Setup
Claude Desktop / Claude Code
Add to your MCP config (claude_desktop_config.json, or claude mcp add agentcard -- npx -y agentcard-mcp for Claude Code):
{
"mcpServers": {
"agentcard": {
"command": "npx",
"args": ["-y", "agentcard-mcp"]
}
}
}
Cursor
Add the same block to .cursor/mcp.json.
Windsurf / Cline / other MCP clients
Same configuration — npx -y agentcard-mcp as the command.
First-time account setup
Your agent can do all of this through the MCP tools, in order:
signup— pass your email; click the magic link it sends.setup— the agent asks whether you pay with a Mastercard and passesmastercard: true(Mastercard Agent Pay enrollment) orfalse(saves a card for one-time card numbers). Either way it returns a URL for you to open and enter your card (the agent never sees or types your real card). Also provisions your agent email inbox and wallet.check_identity— new accounts may need KYC; the tool returns a hosted verification URL to complete.
After that, your agent can pay.
Tools
Account
| Tool | Description |
|---|---|
get_setup_instructions | Usage instructions for the agent |
signup | Sign up or log in with email (sends magic link) |
setup | Choose how the agent pays (mastercard: true for Agent Pay), agent email, wallet |
check_identity | Check KYC status; returns a verification URL when required |
get_limits | Show both spend budgets (issued cards + wallet, connected cards) |
request_limit_increase | Change a spend limit — raises are email-approved by the account owner |
Purchases
| Tool | Description |
|---|---|
create_card | One-time card number for users without Agent Pay, or as the Agent Pay fallback ($1–$150) |
list_purchases | List all purchases across both payment sources, with unified statuses |
get_card_details | Re-fetch a live issued card's number/CVV/expiry, or a connected purchase's status |
cancel_card | Cancel an unused issued card and release its hold immediately |
get_3ds_code | Checkout 3DS / verification codes from the last 5 minutes |
report_issue | Report a problem to AgentCard support |
Mastercard Agent Pay and connected cards
| Tool | Description |
|---|---|
list_sources | List payment sources; a connected Mastercard is the default (isDefaultSource) |
connect_card | Connect your Mastercard for Agent Pay (returns a browser URL) |
create_connected_purchase | Pay through Agent Pay: merchant-scoped purchase (returns a passkey-approval URL) |
get_purchase_credentials | Retrieve the one-time card credential after you approve (returned exactly once) |
A typical purchase
- Agent calls
get_limitsto confirm budget, thenlist_sources. - Mastercard Agent Pay (a connected Mastercard is the default source):
create_connected_purchasewith the merchant, URL, item, and total — you approve with a passkey — thenget_purchase_credentials. Otherwise:create_cardwith the checkout total (e.g.24.99→ a $25 one-time card number). - Agent completes checkout with the returned card number, CVV, and expiry (plus, for one-time card numbers, cardholder name
Alchemy Agentcardand the billing address) — exactly as returned. - If the merchant asks for a verification code, agent calls
get_3ds_code. - Done with a one-time card number early?
cancel_cardreleases the hold immediately; otherwise unused holds release within 7 days and you're only ever charged when a merchant actually uses a card. With Agent Pay the merchant charges your Mastercard directly — no hold.
If any Agent Pay step fails, the agent tells you and falls back to create_card.
Safety model
- The agent never handles your real card numbers — enrollment and payment-method setup happen in your browser via Stripe/Basis Theory.
- Agent Pay credentials are single-use and merchant-scoped; one-time card numbers are single-use and capped at the requested amount.
- Two separate account budgets (issued + wallet, connected) — raises require email approval by the account owner — plus a hard $200/day ceiling for normal direct accounts.
- One-time connected credentials require the authenticated session; browser approval links can approve a purchase but can never retrieve card numbers.
Troubleshooting
| Symptom | Fix |
|---|---|
| Tools return "Not logged in" | Run signup again — sessions expire |
create_card says no payment method | Run setup and open the returned Stripe URL |
| KYC verification required | Run check_identity and complete the returned URL |
| Over a spend limit | get_limits to see which budget tripped; request_limit_increase with that source |
| Agent Pay enrollment fails | The card isn't supported for agentic payments yet — setup with mastercard: false, then create_card |
| Anything else | report_issue with the error details |
Links
- Website: agentcard.ai
- Direct REST API reference: agentcard.ai/docs/api
- Agent (skill) instructions: agentcard.ai/skill
- CLI package: npmjs.com/package/agentcard
- MCP package: npmjs.com/package/agentcard-mcp