Agents and SDKs
MCP server
One command gives any MCP client the six AgentPay tools. Claude Desktop, Claude Code, Cursor, and every other client that speaks the Model Context Protocol.
Configure
Add the server to your client's MCP configuration. The only setting is the API key.
JSON
{
"mcpServers": {
"agentpay": {
"command": "npx",
"args": ["-y", "@agentpay-global/mcp"],
"env": { "AGENTPAY_API_KEY": "mk_live_your_key_here" }
}
}
}Or run it by hand to check it starts:
cURL
AGENTPAY_API_KEY=mk_live_... npx -y @agentpay-global/mcpThe older variable name JOOMJOO_API_KEY is still read.
The six tools
| Tool | What it does | Endpoint |
|---|---|---|
complete_purchase | Hand AgentPay the whole checkout: task, merchant, cap, confirm_pay, idempotency_key, optional start_url. Preferred. | POST /v1/checkout |
get_checkout_status | Poll a checkout until it ends. | GET /v1/checkout/{id} |
issue_card | A real card with a cap, when the agent must type it itself. | POST /v1/cards |
get_spend_status | Was the card charged. | GET /v1/spend/{id} |
get_wallet | Balance, available, reserved, pending, and the cards that already hold money. | GET /v1/wallet |
create_topup_link | A Stripe page for the person when the wallet is short. | POST /v1/wallet/funding-sessions |
The tool descriptions carry the rules the agent must follow: never above the cap, one card per purchase, prefer the checkout, never ask the person for a card number or a one-time code, always send an idempotency key.
An agent that checks get_wallet before buying should read ready_to_spend, not available: an open card that already holds money pays a checkout whose total fits it.