JSPM

  • Created
  • Published
  • Downloads 3305
  • Score
    100M100P100Q107863F
  • License SEE LICENSE IN LICENSE

AI-powered payments for Claude Code

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@visa/cli) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    @visa/cli

    AI-powered payments for Claude Code. Exposes Visa card payment tools as MCP (Model Context Protocol) tools so Claude can pay for image generation, video, music, onchain data queries, and more — charged to a Visa card at the point of invocation.

    Install

    npm install -g @visa/cli

    Usage

    # Start MCP server (used by Claude Code)
    visa-cli mcp
    
    # Login with GitHub
    visa-cli login
    
    # Add a Visa card
    visa-cli add-card
    
    # Check status
    visa-cli status
    
    # View transaction history
    visa-cli history

    Claude Code integration

    {
      "mcpServers": {
        "visa": {
          "command": "visa-cli",
          "args": ["mcp"]
        }
      }
    }

    MCP Tools

    Core (immutable)

    Tool Description
    login GitHub OAuth login flow
    add_card Enroll a Visa card via VGS tokenization
    reset Reset auth state
    pay Generic payment endpoint
    get_status Auth + card + account status
    get_cards List enrolled cards
    transaction_history Recent transactions with amounts
    update_spending_controls Set daily/per-transaction limits
    send_feedback Submit feedback on a tool result
    get_feedback Retrieve feedback history
    batch Batch multiple tool calls
    discover List all available tools with pricing

    Dynamic (from catalog)

    Loaded from the auth server at runtime with a 5-minute TTL. Falls back to the compiled-in baseline from @visa/tools if the server is unreachable.

    Current catalog (18 tools): image generation (FLUX, Recraft, Ideogram, SeedEdit, upscale), video generation (Grok/Luma, Kling, Wan, MiniMax), 3D (Meshy), audio (F5-TTS, Suno), onchain data (Allium, 150+ chains), canvas (pxlwall, USDC/x402 native).


    Catalog Resolution

    1. Live:     GET /v1/suggestions → tools[]   (auth server, TTL-cached, 5 min)
    2. Cache:    ~/.visa-mcp/catalog-cache.json  (disk, <24h)
    3. Baseline: CATALOG from @visa/tools        (compiled-in fallback)

    Architecture

    visa-cli (this package)
    ├── cli.ts           Commander CLI entry (login, add-card, status, history, mcp)
    ├── api-client.ts    HTTP client for apps/auth (auth, attestation, shortcuts)
    ├── mcp-server/
    │   ├── index.ts     MCP server bootstrap, tool registration
    │   ├── tools.ts     Core tool handler implementations
    │   └── suggestions.ts  Dynamic catalog polling
    ├── touchid.ts       macOS Touch ID / Secure Enclave attestation
    ├── rc-gate.ts       RC version gate (checks RC_CODE_HASH)
    └── config/
        └── manager.ts   ~/.visa-mcp/config.json read/write

    Development (monorepo)

    # From monorepo root
    pnpm --filter @visa/cli build
    pnpm --filter @visa/cli test
    pnpm --filter @visa/cli test:unit:coverage
    
    # Watch mode
    pnpm --filter @visa/cli dev

    RC hash stub

    src/__generated__/rc-hash.ts is committed with an all-zeros stub. The real hash is injected at publish time by cli-publish.yml from the RC_ACCESS_CODE secret. Local builds with the stub work normally — the RC gate only activates for prerelease versions.


    Release Pipeline

    PR to dev
      → cli-changeset.yml   (AI classifies bump type, writes .changeset/ file)
      → CI passes on dev
      → cli-release-rc.yml  (bumps RC version, pushes v*-rc.* tag)
      → cli-publish.yml     (injects hash, builds, publishes @visa/cli@rc)
    
    Merge dev → main
      → CI passes on main
      → cli-release-stable.yml  (exits pre mode, bumps stable, pushes v* tag)
      → cli-publish.yml         (publishes @visa/cli@latest)