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 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 Touch ID confirmation at the point of invocation.

    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 history      # Recent transactions with amounts and any generated media URLs
    visa-cli mcp          # Start the MCP server

    Authentication

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

    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 Touch ID).


    Payments & Touch ID

    Every paid tool call requires Touch ID (or device password on macOS). Your assistant will show you the amount and merchant before prompting. If you cancel Touch ID, 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

    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 (Touch ID required)
    set_default_card Change the default card (Touch ID required)
    get_status Auth, card, spend limits, and budget summary
    update_spending_controls Set daily and per-transaction limits (Touch ID 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 Touch ID 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. Touch ID is always required per payment regardless of limits — this cannot be disabled.


    Config & data locations

    Path Contents
    ~/.visa-mcp/config.json Session token, device key
    ~/.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 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.

    "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. Contributor workflow: AGENTS.md, doc index: docs/agents/README.md.