README.md

March 25, 2026 Β· View on GitHub

ASG Card

Your AI agent needs a credit card. ASG Card gives it one β€” programmatically, in seconds, with USDC or Stripe.

SDK version CLI version MCP Server version
SDK downloads CLI downloads MCP downloads
License Website Visitors

🌐 English | δΈ­ζ–‡


ASG Card is an agent-first virtual card platform. AI agents programmatically issue and manage MasterCard virtual cards, paying via Stellar x402 (USDC) or Stripe Machine Payments Protocol (card).

Quick Start β€” First Card

# One-step onboarding (creates wallet, configures MCP, installs skill)
npx @asgcard/cli onboard -y --client codex

# Fund your wallet with USDC on Stellar (address shown by onboard)
# Then:
npx @asgcard/cli card:create -a 10 -n "AI Agent" -e you@email.com

SDK Usage

import { ASGCardClient } from "@asgcard/sdk";

const client = new ASGCardClient({
  privateKey: "S...",  // Stellar secret key
  rpcUrl: "https://mainnet.sorobanrpc.com"
});

// Automatically handles: 402 β†’ USDC payment β†’ card creation
const card = await client.createCard({
  amount: 10,        // \$10 card load
  nameOnCard: "AI Agent",
  email: "agent@example.com"
});

// card.detailsEnvelope = { cardNumber, cvv, expiryMonth, expiryYear }

SDK Methods

MethodDescription
createCard({amount, nameOnCard, email, phone?})Issue a virtual card with x402 payment
fundCard({amount, cardId})Top up an existing card
listCards()List all cards for this wallet
getTransactions(cardId, page?, limit?)Get card transaction history
getBalance(cardId)Get live card balance
getPricing()Get current pricing
health()API health check

MCP Server (AI Agent Integration)

@asgcard/mcp-server exposes 11 tools for Codex, Claude Code, and Cursor:

ToolDescription
get_wallet_statusUse FIRST β€” wallet address, USDC balance, readiness
create_cardCreate virtual card (x402 payment)
fund_cardFund existing card (x402 payment)
list_cardsList all wallet cards
get_cardGet card summary
get_card_detailsGet PAN, CVV, expiry
freeze_cardFreeze a card
unfreeze_cardUnfreeze a card
get_pricingView pricing
get_transactionsCard transaction history (real 4payments data)
get_balanceLive card balance from 4payments

MCP Setup

npx @asgcard/cli install --client codex    # or claude, cursor

Architecture

graph TB
    subgraph Clients
        SDK["@asgcard/sdk<br>(npm, TypeScript)"]
        CLI["@asgcard/cli<br>onboard + card ops"]
        MCP["@asgcard/mcp-server<br>11 tools"]
        TG["Telegram Bot<br>@ASGCardbot"]
        WEB["asgcard.dev"]
        STRIPE_WEB["stripe.asgcard.dev"]
    end

    subgraph ASG Infrastructure
        API["ASG Card API<br>api.asgcard.dev"]
        FAC["x402 Facilitator"]
        DB["PostgreSQL"]
    end

    subgraph Payment Rails
        STELLAR["Stellar Pubnet<br>USDC"]
        STRIPE["Stripe<br>MPP"]
    end

    subgraph External
        ISSUER["Card Issuer<br>(MasterCard)"]
    end

    SDK -->|"x402 HTTP"| API
    CLI -->|"x402 HTTP"| API
    MCP -->|"x402 HTTP"| API
    TG -->|"Webhook"| API
    WEB -->|"Pricing"| API
    STRIPE_WEB -->|"MPP"| API
    API -->|"verify/settle"| FAC
    API -->|"SQL"| DB
    API -->|"REST"| ISSUER
    FAC -->|"Soroban RPC"| STELLAR
    API -->|"PaymentIntent"| STRIPE
    SDK -->|"Sign TX"| STELLAR

Payment Rails

ASG Card supports two payment rails. The card product is identical β€” only the payment method differs.

Stellar Edition (x402)

  1. Agent requests a card β†’ API returns 402 Payment Required with USDC amount
  2. Agent signs a Stellar USDC transfer via the SDK
  3. x402 Facilitator verifies and settles the payment on-chain
  4. API issues a MasterCard via the card issuer
  5. Card details returned immediately in the response

Uses: SDK, CLI, MCP server. No human in the loop.

Stripe Edition (MPP)

  1. Agent creates a payment request β†’ API returns approval_required + approvalUrl
  2. Owner opens the approval page at stripe.asgcard.dev/approve
  3. Owner reviews and approves β†’ Stripe Elements form with real-time pricing
  4. Owner pays via Stripe β†’ card/Apple Pay/Google Pay
  5. Card created β†’ agent polls until completed

Uses: session-based auth (X-STRIPE-SESSION). Human-in-the-loop approval.

Workspace

DirectoryDescription
/apiASG Card API (Express + x402 + Stripe MPP)
/sdk@asgcard/sdk TypeScript client
/cli@asgcard/cli CLI with onboarding
/mcp-server@asgcard/mcp-server MCP server (11 tools)
/webMarketing website (asgcard.dev)
/web-stripeStripe edition site (stripe.asgcard.dev)
/docsInternal documentation and ADRs

API Endpoints

Public

RouteMethodDescription
/healthGETHealth check
/pricingGETPricing info
/cards/tiersGETPricing info
/supportedGETx402 capabilities

Stellar x402 (Payment Required)

RouteMethodDescription
/cards/create/tier/:amountPOSTCreate a virtual card
/cards/fund/tier/:amountPOSTFund an existing card

Wallet Authenticated

RouteMethodDescription
/cards/GETList wallet's cards
/cards/:idGETCard details
/cards/:id/detailsGETSensitive data (nonce required)
/cards/:id/transactionsGETCard transaction history
/cards/:id/balanceGETLive card balance
/cards/:id/freezePOSTFreeze card
/cards/:id/unfreezePOSTUnfreeze card

Stripe MPP (Beta)

RouteMethodDescription
/stripe-beta/sessionPOSTCreate managed session
/stripe-beta/payment-requestsPOSTCreate payment request
/stripe-beta/payment-requests/:idGETPoll request status
/stripe-beta/approve/:idGET/POSTApproval page data / approve or reject
/stripe-beta/approve/:id/completePOSTComplete payment (MPP credential)
/stripe-beta/cardsGETList session's cards
/stripe-beta/cards/:id/detailsGETCard details (nonce required)

Pricing

Simple, transparent, no hidden fees.

  • $10 flat card creation (no initial load required)
  • 3.5% on every top-up

That's it. Load any amount from $5 to $5,000.

Create card with no load β†’ $10. Create card loaded with $100 β†’ $113.50. Top up $200 later β†’ just $207. Same pricing on both Stellar and Stripe rails.

Telegram Bot (@ASGCardbot)

Link your wallet to Telegram for card management:

CommandDescription
/startWelcome / Link account
/mycardsList your cards
/faqFAQ
/supportSupport

Security

  • Card details encrypted at rest with AES-256-GCM
  • Agent nonce-based anti-replay protection (5 reads/hour)
  • Wallet signature authentication (Stellar edition)
  • Session-based authentication with beta gates (Stripe edition)
  • Stripe session keys redacted from logs
  • Telegram webhook secret validation
  • Ops endpoints protected by API key + IP allowlist

Contributing

We welcome contributions! Please see CONTRIBUTING.md for guidelines and check out issues labeled good first issue to get started.

This project follows our Code of Conduct.

License

MIT


Star History Chart