JSPM

@visa/cli

1.13.1-rc.0
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 4874
    • Score
      100M100P100Q118050F
    • 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 over MCP. Exposes Visa card payment tools as MCP (Model Context Protocol) tools so your AI assistant can pay for image generation, video, music, onchain data queries, and more — charged to a Visa card with authentication confirmation at the point of invocation.

      Platform support

      Platform Credential Storage Payment Auth Install
      macOS Keychain Touch ID / Secure Enclave bash <(curl -fsSL ...) or npm i -g @visa/cli
      Windows ACL-restricted file Server-verified (restricted limits) npm i -g @visa/cli or `iwr -useb https://visacli.sh/install.ps1
      Linux libsecret (GNOME Keyring / KDE Wallet) Server-verified (restricted limits) bash <(curl -fsSL ...) or npm i -g @visa/cli

      Install

      npm install -g @visa/cli

      MCP setup

      Add to your MCP client config:

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

      Once connected, your assistant will have access to all payment tools. The first time you use a paid tool, you'll be prompted to log in and enroll a card.


      CLI commands

      visa-cli login        # GitHub OAuth — opens browser, stores session token
      visa-cli add-card     # Enroll a Visa card via VGS secure form
      visa-cli status       # Show auth state, enrolled cards, daily spend remaining
      visa-cli api-key create my-demo-app
                            # Create an API key for an app or agent
      visa-cli history      # Recent transactions with amounts and any generated media URLs
      visa-cli hud enable   # Explicitly pin the Visa HUD below Claude Code input
      visa-cli hud disable  # Remove the Visa HUD from Claude Code
      visa-cli statusline   # Render the multi-line HUD Claude Code calls automatically
      visa-cli mcp          # Start the MCP server

      Authentication

      Login is GitHub OAuth. Your session token is stored at ~/.visa-mcp/session-token.

      visa-cli login    # opens github.com/login/oauth/authorize in your browser
      visa-cli status   # verify you're logged in

      Card enrollment

      Cards are tokenized via VGS — your raw card number never touches Visa servers. add_card opens a hosted VGS Collect form in your browser.

      visa-cli add-card

      Multiple cards can be enrolled. The first becomes the default; you can switch defaults with set_default_card from within your assistant. To remove a card: remove_card (requires authentication).


      Payments & Authentication

      Every paid tool call requires authentication. On macOS, this is Touch ID (or device password); on Windows and Linux, payments are server-verified with restricted spending limits. Your assistant will show you the amount and merchant before prompting. If you cancel, the payment is aborted — nothing is charged.

      You can set hard limits via the update_spending_controls tool, or check your current limits any time:

      visa-cli status

      API keys for apps and agents

      Approved users can create API keys from the CLI with their existing login:

      visa-cli api-key create my-demo-app --tools generate_image_card,run_llm --daily-cap 5
      visa-cli api-key list
      visa-cli api-key revoke 1

      The create command prints the raw vk_... key once. Store it in your app or agent secret store and send it as X-Api-Key to /v1/api/shortcuts/:tool.


      MCP tools

      Account

      Tool Description
      login GitHub OAuth login — opens browser
      add_card Enroll a card via VGS tokenization
      get_cards List enrolled cards (masked)
      remove_card Remove an enrolled card (authentication required)
      set_default_card Change the default card (authentication required)
      get_status Auth, card, spend limits, and budget summary
      update_spending_controls Set daily and per-transaction limits (authentication required)
      transaction_history Recent transactions with amounts and media URLs
      feedback Submit feedback on a tool result
      reset Clear auth state and credentials

      Generation

      Tool Price Description
      generate_image_card ~$0.06 FLUX1.1 Ultra — 2K resolution, ~30s
      generate_image_fast_card ~$0.04 FLUX1.1 Pro — 1K resolution, ~10s
      generate_video $0.10–$0.30 Text-to-video (Wan / MiniMax / Kling)
      generate_music_tempo_card ~$0.10 Suno AI music generation, ~2 min
      check_music_status_tempo_card ~$0.01 Poll Suno task for audio URL
      generate_audio ~$0.03–$0.04 TTS (MetaVoice) or SFX (Stable Audio)
      generate_3d ~$0.08 Text-to-3D mesh (Trellis), returns GLB URL
      upscale_image ~$0.03 Image upscaling (Aura SR)
      transcribe_audio ~$0.02 Speech-to-text (Whisper)

      Data

      Tool Price Description
      query_onchain_prices_card ~$0.02 Real-time or historical token prices (150+ chains via Allium)
      allium_explorer_card ~$0.10 Natural language → SQL blockchain query (step 1)
      allium_explorer_results_card up to $3.00 Fetch results for a submitted query (step 2)
      run_llm $0.01–$0.09 Run a prompt through GPT-4o Mini, Claude, DeepSeek, Perplexity, or Llama

      Utility

      Tool Description
      pay Generic HTTP 402 payment endpoint
      batch Execute multiple paid tools in one authentication approval
      discover_tools Search the dynamic tool catalog
      execute_tool Run a tool from the dynamic catalog by ID

      Dynamic catalog

      The tool catalog is fetched live from the auth server at startup (5-minute TTL). If the server is unreachable, it falls back to the compiled-in baseline from @visa/tools.

      To see all available tools with current pricing, ask your assistant:

      "What tools do you have available?"


      Spending controls

      Daily limit         — hard cap on total spend per day
      Max per-transaction — hard cap per single tool call

      Both limits are enforced server-side. Authentication is always required per payment regardless of limits — this cannot be disabled. On macOS this means Touch ID; on other platforms, server-side verification with restricted spending limits applies.


      Config & data locations

      Path Contents
      ~/.visa-mcp/session-token Session token
      ~/.visa-mcp/catalog-cache.json Cached tool catalog (24h TTL)
      ~/.visa-mcp/allium-results/ Large query result CSVs

      Troubleshooting

      Touch ID prompt doesn't appear (macOS) Make sure visa-cli mcp is running as a foreground process that has access to the macOS security framework. Running inside some sandboxed environments may prevent Touch ID. On Windows and Linux, biometric prompts are not used — payments are server-verified.

      "Not logged in" after visa-cli login Restart the MCP server after logging in — your MCP client needs to reconnect to pick up the new session.

      Card not showing in get_cards Enrollment is only confirmed after you complete the VGS form in the browser. Call get_cards after finishing the form to verify.

      Tool returns an error about daily limit Check your remaining budget with visa-cli status or ask your assistant: "What's my remaining budget today?"

      Catalog shows stale tools Delete ~/.visa-mcp/catalog-cache.json and restart the MCP server to force a fresh fetch.


      Monorepo context

      Request routing (MCP vs MPP vs Studio): docs/agents/ARCHITECTURE.md. Branches and deploy: docs/agents/PIPELINE.md. Contributor workflow: AGENTS.md, doc index: docs/agents/README.md.