← Open Source

Payments are broken for AI agents. Snaplii provides a secure, tokenized payment layer that enables AI agents to transact in the real world — without exposing users' underlying payment credentials.

AI EngineeringGive agent toolsPython
Momentum
+0stars in 24 hours0.0%
812
Stars
94
Forks
+0
This week
6
Contributors
Created 2026-04-27 · Updated 2026-11-10 · #17187 today
Top developers
llisnappayjessychennsunnyyg56
README

Snaplii A2M — Agent-to-Merchant Payments

Wallet skill · Merchant checkout skill

Snaplii lets an AI agent use prepaid Snaplii Cash to help a customer shop, pay a bill or send money. For shopping, the agent helps the customer buy a gift card for the merchant they plan to visit. The customer can spend the card at checkout and earn cashback on the eligible gift card purchase. The agent works within the customer’s spending permissions and never needs their bank or card details.

New in v0.21.1. An eligible new customer can start in the agent's chat, register by SMS, add funds on their phone and buy a gift card without installing the Snaplii app or creating an API key. This flow works in the Python command-line interface (CLI) and in the local Model Context Protocol (MCP) server. The remote MCP server connects with an app-issued API key.

Try the phone flow · Connect an MCP client · Install the agent skills · Explore a partnership

How businesses and agents work together

Relationship What it looks like
Business to Agent Snaplii publishes a catalog an agent can read, identifies the card and amount it can buy, enforces spending limits and returns the order status. An agent platform can use those details to decide what to offer.
Agent to Consumer A customer says, “Order me a coffee.” The agent checks whether the merchant accepts an eligible gift card, explains the cost and savings, and asks for approval. With the appropriate account access and a browser tool, it can apply the card at checkout, confirm the final order with the customer and report the result.

What customers get

  • Start with the task. Eligible customers can register by phone and start a request without upfront identity verification (KYC). If the selected service requires a check, the customer completes it before the transaction proceeds.
  • Save on purchases you already plan to make. Buy a participating merchant’s gift card through Snaplii, then use its face value to pay that merchant. Eligible gift card purchases can earn an extra 5%–10% cashback. For example, if you pay $100 for a $100 grocery gift card and the offer pays 8% cashback on that purchase, you earn $8 back and still have the full $100 to spend at that grocer. Snaplii’s gift card network covers 500,000+ North American retail locations. Check the selected brand’s current offer and where its card is accepted.
  • Combine eligible assets. The Snaplii AI wallet supports combining eligible assets in one payment. In this release, the API-key quote shows how an eligible voucher and available Snaplii Cash apply to a CAD or USD gift-card purchase. The quote shows how much, if anything, remains to be funded.

Partner economics

Under Snaplii’s proposed A2M partner terms, Snaplii charges merchants no acquiring fee on A2M gift-card payments. An agent platform can earn a share of revenue from eligible purchases its agent helps complete. Eligibility and settlement are agreed with each partner. Discuss a merchant or agent-platform pilot.

What you can do with Snaplii

Task SMS phone connection · CLI or local MCP App-issued API key · CLI or MCP
Connect a customer Register a new user or link an existing account by SMS. Snaplii issues a token for this agent. The user creates a scoped key in the app. Local clients exchange it for a session. Remote MCP uses Snaplii’s hosted sign-in.
Add funds Request a top-up. The customer pays through the link Snaplii texts to their phone. The customer can fund their wallet in the app.
Browse and buy gift cards Read the catalog, balance and available daily limit. Buy an available card into the customer’s wallet. Browse, quote, purchase and retrieve a card for redemption. A merchant checkout needs a browser tool and access to the merchant account where required.
Pay a bill Pay supported Canadian billers from a Canadian account, within the connection’s daily limit. A submitted bill payment cannot be undone. Pay supported Canadian billers from a Canadian account with payment-write access. A submitted bill payment cannot be undone.
Send money Send Snaplii Cash to another Snaplii user’s phone number in Canada or the US, within the connection’s daily limit. Send Snaplii Cash to another Snaplii user’s phone number in Canada or the US with transfer access.

Canadian accounts use CAD and US accounts use USD. The account’s country determines the catalog. For remote MCP, available tools also depend on the client and the key’s scope. Remote MCP details

Phone quick start

Use this path for an agent with shell access and an enabled agent name and phone number. Run the installer from a fresh directory with Git and Python 3.8+.

git clone --depth 1 --branch v0.21.1 https://github.com/Snaplii-Inc/agent-to-merchant-payments.git snaplii-src
python3 snaplii-src/scripts/install.py --cli-only --source ./snaplii-src

Use the snaplii executable printed in the install report for the commands below. On macOS and Linux it normally lives at ~/.snaplii-env/bin/snaplii. Run snaplii agent --help to verify the install without starting a connection. For Windows or an agent that loads skills, use the release installer guide.

1. Connect by SMS. Set AGENT_NAME to the name enabled for your integration and CUSTOMER_PHONE to the mobile number the customer wants to connect. Start the connection when the customer asks.

snaplii agent connect --agent "$AGENT_NAME" --phone "$CUSTOMER_PHONE" --no-wait

Show the customer the returned match_code in chat. They open the SMS link on their own phone and enter that code to approve. A new customer registers through the same link. Once they approve, resume the request and check the connection’s limits.

snaplii agent connect --agent "$AGENT_NAME" --resume
snaplii agent connection
snaplii agent balance
snaplii agent catalog

If the gateway refuses the connection, the CLI prints its code and message. An existing customer can also use the API-key flow. Phone and API-key sessions have separate credentials.

2. Buy a gift card. Run snaplii agent catalog BRAND_ID for the chosen brand. Set ITEM_ID to its exact item_id and PRICE to an amount allowed for that card. Check can_buy and the available daily limit. Use the brand and amount the customer authorized. In merchant autopilot, show the quote and wait for approval before buying the card.

snaplii agent buy --item-id "$ITEM_ID" --price "$PRICE"

A PAID result means the gift card is in the customer’s Snaplii wallet. Merchant checkout is a separate action. To redeem through an agent, use the API-key card-detail flow and a browser-capable agent. If checkout fails after the card was purchased, the customer still owns the card.

3. Handle a shortfall. If the order returns NEEDS_TOP_UP, use the shortfall in the order’s next_step. Keep its order ID. The example variables below refer to that order, its shortfall in dollars, and the ID returned by the top-up request.

snaplii agent top-up "$SHORTFALL"
snaplii agent top-up-status "$TOP_UP_ID"

The first command texts a payment link. The customer pays on their phone with an available method, such as Apple Pay or Google Pay. Use --payment-method alipay to request an Alipay link, or --payment-method stablecoin for a page that shows where to send USDC or USDT from the customer's own wallet; that transfer takes minutes to arrive. Once the top-up status is CREDITED, continue the same order.

snaplii agent order "$ORDER_ID" --continue

4. Pay a bill or send money. The phone connection also pays Canadian bills and sends Snaplii Cash to a phone number, with no API key. Both count toward the connection’s daily limit. snaplii help bill and snaplii help send give the steps.

snaplii agent billpay payees                                                 # then detail, save, quote, pay, result
snaplii agent transfer create --to-phone "$RECIPIENT_PHONE" --amount 12.50   # cancellable ~5 min, then auto-sends

A submitted bill payment cannot be undone. If the customer’s settings for the connection in the Snaplii app do not allow a payment, the gateway answers refused with what to change.

Check an existing order with snaplii agent order "$ORDER_ID". If a buy command was interrupted before returning an order, reuse its printed idempotency key with --key. If the gateway reports UNKNOWN, stop and have the customer check their orders. To revoke the phone connection, run snaplii agent disconnect. With the local MCP server, each of these commands is a snaplii_agent_* tool: see MCP Server. Phone order states and recovery


For AI agents: start here

Choose how to connect

You are Install
An agent that reads SKILL.md The skills plus the CLI or MCP server: Install from a release
An MCP client that does not load skill folders Remote MCP or local MCP
A terminal or a script CLI with phone onboarding or an API key

Install from a release

Install the skills, the CLI and the MCP server from one release tag, so all three come from the same commit. Use your agent’s values from the table. If your agent is not in the table or Node.js is missing, replace the second command with Manual install below.

Agent -a --host
Claude Code claude-code claude-code
Codex codex codex
Cursor cursor cursor
OpenClaw openclaw openclaw
Gemini CLI gemini-cli leave it out
GitHub Copilot github-copilot leave it out
Muse skip this command, see Muse below muse
Instinct skip both this command and Manual install; Instinct runs Snaplii through the MCP server, as the Instinct block under MCP Server describes instinct
Any other agent skip this command, use Manual install leave it out; add --cli-only unless you know how your agent registers an MCP server
  • --yes and -y skip prompts a shell tool cannot answer interactively. Always pair -y with -a, or the skills go to every agent the installer finds.
  • Where the table says leave it out, drop both --host and its value. Add --cli-only to the third command if your agent will not use MCP. Muse gets the CLI only by itself; Instinct needs MCP and refuses --cli-only.
git clone --depth 1 --branch v0.21.1 https://github.com/Snaplii-Inc/agent-to-merchant-payments.git snaplii-src
npx --yes skills add ./snaplii-src -g -a claude-code -y
python3 snaplii-src/scripts/install.py --host claude-code --source ./snaplii-src
  • On Windows, use py -3 in place of python3, and run Manual install in Git Bash. The skills are copied and the packages built into ~/.snaplii-env, so you can delete snaplii-src afterwards.
  • To install again or update, run the three commands from a directory with no snaplii-src folder.

Manual install. Use it only when the second command cannot run. Set SKILLS_DIR to your agent's user-wide skills directory, or its project skills directory if it has none. The commands copy both skills, each with SKILL.md at its top level, and update the files in place when repeated.

: "${SKILLS_DIR:?set SKILLS_DIR to your skills directory}"
mkdir -p "$SKILLS_DIR/snaplii-cli" "$SKILLS_DIR/snaplii-autopilot"
cp -R snaplii-src/clawhub-publish/.   "$SKILLS_DIR/snaplii-cli/"
cp -R snaplii-src/clawhub-autopilot/. "$SKILLS_DIR/snaplii-autopilot/"

Muse runs the skill with the CLI, not MCP. Install the snaplii-cli skill from snaplii-src/clawhub-publish/ with Muse's own skill installation; Muse names its folder under ~/workspace/skills/. Then run python3 snaplii-src/scripts/install.py --host muse --source ./snaplii-src.

Install the execution layer

The third command builds the CLI and the MCP server into ~/.snaplii-env and prints a JSON report with the next steps; it never asks for an API key or edits host configuration. --host also takes claude-desktop; see --help for other flags and No Python on the machine if Python is missing.

Reading the report. status: installed (exit 0) means every component you asked for works; --check reports installed (exit 0) or not_installed (exit 1). Work through next_steps in order:

  • required: blocking. Do what why says, then run command, which re-runs the installer, once; if the same failure.code returns, or failure.retryable is false, stop and report failure.remedy to the user. Carry out a remedy that deletes files only when the user agrees. When command is null, report why to the user.
  • pending: do the ones that apply: skip install_skill if this clone's skills are installed already, and register_mcp if your agent uses the CLI only. register_mcp gives a command to run, a file to merge its json into without removing other entries, or only a path to register as a stdio server; never run that path. If snaplii is already registered, it must start the report's path; replace it if not.

Verify. npx skills list -g shows snaplii-cli and snaplii-autopilot after the second command, where Agents: not linked is normal for agents that read ~/.agents/skills, and ls "$SKILLS_DIR" does after Manual install; Muse installs snaplii-cli only. Your agent loads them after the new session the report's reload_host step may need. Then check the connection state: in this session, run the report's CLI path with config show, and use that absolute path for every CLI command; if your agent uses MCP, also call the snaplii_config_show tool once it loads in the new session. Never buy anything to test the install.


Table of Contents

How authorization works

Phone connection API-key connection
What the user approves The SMS page links one named agent to the wallet. The CLI stores a dedicated, revocable connection token. The customer issues a key with the scope required by the task. The client exchanges the key for a session token.
What limits spending Snaplii sets a daily limit for the connection. Gift cards, bill payments and transfers count toward it. snaplii agent balance shows the limit and what is left of it for gift cards. The customer sets the key’s daily gift-card limit when creating the key. Bill payments are not subject to it and draw from Snaplii Cash. Transfers have a separate rolling 24-hour limit.
How to end access Run snaplii agent disconnect to revoke that connection. Revoke the key in the app. Create a new key to change its gift-card limit.

API-key permissions are PAY_READ for read access, PAY_WRITE for payments including gift-card purchases and Canadian bill pay, P2P for transfers, and ALL for combined access.

Sessions and reconnecting

For API-key authorization, check the session in the runtime that runs the task: a session in ~/.snaplii/config.json or the OS keychain serves both the CLI and the MCP server; one the MCP server keeps in memory serves only that server. A connection exchanges the API key once for a session token. The key is not kept, so connecting again needs it again unless the host's vault holds it (Muse, Instinct). The gateway sets when a session expires, so rely on has_valid_token rather than a fixed lifetime. Signing in with --base-url or SNAPLII_BASE_URL saves that gateway as the default, so later commands without it use the same session. The app shows a new key only once: the user should keep it in a password manager.

The API key stays out of the chat where the host allows it: a secure card, the hosted connect page, or the host's vault (Muse, Instinct). Otherwise the user runs snaplii init in their own terminal or, if the Snaplii MCP tools are available, pastes the key for snaplii_init, which passes it through the model once. API-key sign-in uses the Snaplii production or staging gateway.

snaplii config show and snaplii_config_show report has_valid_token, auth_state, host, credential_storage and next_action. auth_state is ready, auth_required (never connected), reauth_required (expired, rejected, or a memory-only MCP session lost in a restart) or mcp_required (the CLI was called in Instinct). host is unknown everywhere except Muse and Instinct, which is normal. Follow next_action:

next_action What to do
run_cli The user runs its argv in their own terminal: from a shell tool init has no key to read and answers api_key_missing; never pipe a key into it; in Muse the agent runs init --vault-auth itself. argv[0] is snaplii, or the CLI's absolute path when the snaplii on PATH is a different CLI; relay argv unchanged
call_mcp_tool The agent calls snaplii_connect, only while has_valid_token is false. Only authenticated or already_connected means connected; after card_requested, pending or use_terminal_or_chat_key, check the status again once the user has acted; after unreachable, call snaplii_connect again once Snaplii can be reached, without asking for the key again
muse_secure_entry The agent opens Muse's secure input; a stored key is reused without asking
offer_legacy The key was rejected (invalid_key); the user enters a key again
retry_auth_later Snaplii was unreachable; retry later
stop Cancelled, or no session could be stored; report it and do not retry or switch methods
  • Shell-only agent. On a machine without an OS keychain, init in a terminal first asks whether this and future sessions may be kept in the owner-only config file: yes saves allow_insecure_mode: true there, no stops before the key is typed. Without a terminal, or when a detected keychain fails to save, init answers session_cache_failed with reason no_persistent_storage; the user then sets allow_insecure_mode: true in the config file, or SNAPLII_ALLOW_INSECURE=1, and runs init again. The config-file setting applies to every Snaplii process, including an MCP server the host starts, until snaplii config clear; the environment variable reaches that server only if the host passes it on.
  • MCP host. A session the server keeps only in memory ends with the server; connect again after a restart.
  • Instinct. Repeat the two snaplii_connect calls with the vault fill; the vault keeps the key.

Requirements

  • Any Python 3.8+ to start the installer, which fetches CPython 3.12 with uv when no 3.10+ is available
    CLI needs 3.9+, the MCP server 3.10+. With no Python at all, see No Python on the machine.
  • Git
  • Node.js with npx, only for the one-line npx skills add install; the manual copy needs neither
  • An eligible phone number and agent name for SMS onboarding, or the Snaplii mobile app to create an API key for the API-key route.

Quick Start

This walkthrough uses an app-issued API key for the CLI or MCP. To register by SMS or request a top-up from chat, follow the phone quick start.

1. Get Your API Key via Snaplii App

For API-key access, create the key in the Snaplii mobile app. Installation itself needs no credential.

  1. Download the Snaplii app for iOS or Android.
  2. Register an account and bind a payment method to load your Snaplii Cash balance.
  3. In the app, go to More → Payment Methods → AI Payment Management.
  4. Tap + New API Key.
  5. Set a name, choose the scope (PAY_READ, PAY_WRITE, P2P, or ALL), and set a hard spending limit.
  6. Copy the API key.
    • Format: snp_sk_live_...
    • Keep it safe. It is shown only once.

2. Install the CLI and MCP server

Clone a release and run its installer (see Install the execution layer for the Windows and no-Python variants):

git clone --depth 1 --branch v0.21.1 https://github.com/Snaplii-Inc/agent-to-merchant-payments.git snaplii-src
python3 snaplii-src/scripts/install.py --source ./snaplii-src

It creates ~/.snaplii-env, builds snaplii-cli and snaplii-mcp from the clone, verifies both, and prints the executables' absolute paths. Add --cli-only if you do not need the MCP server.

The steps below call snaplii by name. Use the absolute path from the report (~/.snaplii-env/bin/snaplii, or %USERPROFILE%\.snaplii-env\Scripts\snaplii.exe on Windows), or run the report's cli_on_path command first.

3. Authenticate

Only when connecting, and only in the user's own interactive terminal; an agent's shell tool cannot answer the prompt.

snaplii init

The CLI will prompt for your API key via hidden input (like a password prompt). The key is used only to obtain a session token and is never stored on disk. Agent ID is auto-derived from the key.

Meta Muse secure credential store

To authenticate with an API key already saved in Muse's secure credential store:

snaplii init --vault-auth
snaplii config show

--agent-id is optional: Snaplii reuses a saved ID or generates one on successful login. Before using Snaplii, check that has_valid_token is true; the status output does not display credentials.

When Muse is recognized, snaplii init selects secure credential authentication by default and caches the session token in an owner-only file so later CLI commands can reuse it. The API key stays in Muse's secure credential store. The accompanying skill directs Muse to open its native secure input when a key is needed; cancellation stops the connection attempt. The skill describes when a first install in Muse connects on its own.

Use snaplii config doctor to check runtime detection and storage without logging in. If secure credential authentication is unavailable, you can explicitly choose snaplii init --legacy-auth and enter your API key at the terminal's hidden prompt.

Muse must use only the key it holds: never type, rebuild or copy a key into a command, including one pasted into the chat, since the value Muse sees there may not be the real key. In Muse, a raw key that is not a Snaplii key, or that Snaplii rejects, answers auth_required with next_action pointing to snaplii init --vault-auth, which uses the stored key.

Instinct

In Instinct the CLI does not authenticate at all. Connect through the MCP server and the Instinct vault, as described under MCP Server.

4. Use the CLI

snaplii browse tags                                  # Browse gift card categories
snaplii browse brand --id CB...                      # See denominations and cashback
snaplii balance                                      # Check spendable Snaplii Cash balance
snaplii quote --item-id CB...-CT... --price 50       # Preview price with voucher/cashback
snaplii giftcard list                                # View owned cards

For an authorized purchase, use the same item, amount and options as the quote. The following command charges the customer’s balance immediately. A successful gift-card purchase places the card in their wallet.

snaplii purchase --item-id CB...-CT... --price 50    # Buy a card
snaplii giftcard detail --card-no ...                # Read the redemption code

--item-id must be exactly {cardBrandId}-{cardTemplateId} (e.g. CB00000000000086-CT000000003618). Copy it verbatim from the item_id in the denominations that snaplii browse brand returns, and use the same value for quote and purchase. Never pass either ID alone or build one by hand: a different well-formed ID buys a different card.

The catalog is scoped to your account's country (fixed at login, enforced server-side), so there's no region/province flag to pass. balance labels the currency from the stored country; --country CA|US is only a fallback for older sessions.

--price must be within the brand's denomination range — browse brand shows each card's min/max (variable) or fixed amount. When the brand's rules are available, quote and purchase reject an out-of-range price up front (e.g. $10 on a $20-minimum card); if the catalog lookup fails, the check is skipped and the gateway decides.

Always quote before purchase. The quote's you_pay is what Snaplii Cash does not cover; if it is above zero, the user needs to top up in the app first.

5. Pay a Bill — Canada only

Canadian accounts can pay supported utility, telecom, and other bills from Snaplii Cash. Bill pay is not available for US accounts. Check the account country before starting; use the live biller list and quote for availability and any applicable savings.

snaplii billpay payees                                                       # Find your biller
snaplii billpay detail --payee-code PE01015                                  # Check account rules
snaplii billpay save --payee-code PE01015 --first-name Alex --last-name Chen --amount 75.25 --account 1234567890
snaplii billpay quote --pay-code PC... --price 75.25                         # Preview savings
snaplii billpay pay --pay-code PC... --price 75.25                          # Pay from Snaplii Cash
snaplii billpay result --payment-no PSP...                                   # Check status

Bill pay flow: payees → detail → save (returns payCode) → quote → pay → result. Payment draws from your prepaid Snaplii Cash balance without giving the agent access to your bank accounts or credit cards.

With the phone connection, the same commands are snaplii agent billpay ... and need no API key; a bill then counts toward the connection’s daily limit.

6. Send Money (P2P Transfer)

Available in Canada and the United States: send Snaplii Cash to another Snaplii user's phone number. With an API key, its scope must be P2P or ALL. With the phone connection, the same commands are snaplii agent transfer ... and need no API key.

snaplii transfer create --to-phone "$RECIPIENT_PHONE" --amount 12.50   # Cancellable ~5 min, then auto-sends
snaplii transfer cancel --order-no ZZ...                       # Undo within the window
snaplii transfer finish --order-no ZZ...                       # Send NOW; only when the user explicitly asks
snaplii transfer status --order-no ZZ... --wait --timeout 330  # Poll until FINISHED / CANCELLED / FAILED
snaplii transfer list                                          # List transfers, newest first

A new transfer stays cancellable until auto_finish_at (~5 minutes), then the gateway sends it automatically. After create, tell the user the amount, the masked recipient, and that deadline. Cross-currency transfers (recipient in another country) return the exact received_amount / received_currency / conversion_rate and a cross_currency_notice up front; show it and let the user keep or cancel. --wait polls every 3 seconds and its --timeout defaults to 120 seconds, shorter than the window, so size it to the time left plus settlement (about 330 right after create) or re-run on wait_timed_out. With an API key, transfers are capped by a rolling 24-hour per-key limit set in the app; with the phone connection they count toward the connection’s daily limit.


CLI Commands

Most business commands write their result as JSON on stdout, with errors on stderr. Some also print progress on stderr. The commands help, --help, and --version print plain text. The init command writes its hidden prompt to stderr. A few lookups report a not-found condition as an error field inside the stdout JSON with exit code 0, for example smart cashback when no denomination matches, so inspect the body as well as the exit code. Authentication errors carry auth_state and a next_action the agent can follow.

Command Purpose
snaplii init [--agent-id ID] [--vault-auth | --legacy-auth] Authenticate. Interactive: the user runs it in a terminal; without an OS keychain it first asks whether sessions may be kept in an owner-only file. A gateway given with --base-url or SNAPLII_BASE_URL becomes the saved default. Muse defaults to secure credentials, with an explicit original-input fallback. Refused in Instinct
snaplii config show Show current config and auth status, including has_valid_token, host, and next_action
snaplii config doctor Diagnose runtime detection (Muse, Instinct) and storage without logging in
snaplii config set --base-url URL Set the gateway URL. Without one, the CLI uses production, https://ai.snaplii.com. Sign-in works only with production (also under its former name, https://aipayment.snaplii.com) and staging https://aipay.stage.snaplii.com
snaplii config clear Clear local configuration and session; does not delete the host-stored API key
snaplii browse tags Browse card categories and brands
snaplii browse brand --id ID View brand details, denominations, and cashback
snaplii giftcard list List owned gift cards
snaplii giftcard detail --card-no NO View card redemption code and PIN
snaplii balance [--country CA|US] Show spendable Snaplii Cash balance; currency follows the stored account country
snaplii quote --item-id ID --price P Preview price with voucher/cashback before buying
snaplii purchase --item-id ID --price P [--voucher V] [--cashback C] [--voucher-id ID] Purchase a gift card; pass the same options you quoted with
snaplii smart cashback --brand-id ID --amount A Calculate cashback savings
snaplii smart dashboard View card inventory summary
snaplii billpay payees Canada only: list available billers (electricity, gas, telecom)
snaplii billpay detail --payee-code CODE View biller account validation rules
snaplii billpay save --payee-code CODE --first-name F --last-name L --amount A --account NO Save a bill pay instruction
snaplii billpay vouchers --pay-code PC --price P List eligible bill-payment vouchers
snaplii billpay history --payee-code CODE Get the previous bill instruction for a biller, for autofill; not a ledger of what was paid
snaplii billpay quote --pay-code PC --price P Preview bill price with voucher/cashback
snaplii billpay pay --pay-code PC --price P Canada only: pay the bill from Snaplii Cash
snaplii billpay result --payment-no NO Check bill payment status
snaplii transfer create --to-phone P --amount A Send Snaplii Cash to a phone number (cancellable ~5 min, then auto-sends)
snaplii transfer cancel --order-no NO Cancel a PENDING transfer within the undo window
snaplii transfer finish --order-no NO Send a PENDING transfer immediately
snaplii transfer status --order-no NO [--wait] [--timeout S] Get a transfer's state; polling defaults to a 120-second timeout
snaplii transfer list [--status S] List transfers, newest first
snaplii agent connect / connection / disconnect / balance / catalog / buy / order / top-up / top-up-status / top-up-cancel The phone connection, side by side with init: Snaplii texts the user a sign-in link, and the agent can then ask the user to top up Snaplii Cash (by a texted pay link) and buy gift cards under its own daily limit. Its token is kept like the session. The local MCP server has the same as its snaplii_agent_* tools; see the skill's Step 8
snaplii agent billpay payees / detail / history / save / vouchers / quote / pay / result Bill pay with the phone connection: the options of the snaplii billpay commands, no API key, within the connection's daily limit
snaplii agent transfer create / cancel / finish / status / list Transfers with the phone connection: the options of the snaplii transfer commands, no API key, within the connection's daily limit
snaplii update [--check] Check for and install a CLI update. With --check it only reports whether a newer version is out and how to update this install
snaplii help [TASK] One screen with the tasks and the commands of each (snaplii with no command prints the same); with a task (snaplii help top-up), that task's commands in order and its rules. Use snaplii <command> --help for command flags

In Instinct, only help, update, --version, and config run; every other command answers auth_state=mcp_required and points to the snaplii_connect MCP tool.


Integration Guides

Remote MCP server (no install)

Clients that add MCP servers by URL can use Snaplii without installing anything. Add this server, including the /mcp path:

https://aipayment.snaplii.com/mcp

Connecting opens Snaplii's sign-in page in the browser, where the user pastes an API key from the Snaplii app (see Get Your API Key). The key goes to Snaplii only: the client never receives it, just its own access to this connection.

Client How to add it
Claude (claude.ai) Settings → Connectors → Add custom connector, paste the URL, then Connect
Claude Code claude mcp add --transport http snaplii https://aipayment.snaplii.com/mcp, then run /mcp in Claude Code and sign in to snaplii
ChatGPT Turn on developer mode, then create a connector with the URL and OAuth sign-in
Relevance AI Add an MCP server with the URL

Other clients that connect to remote MCP servers with OAuth sign-in may work too; if sign-in fails, use the local MCP server.

What a connection can do. It depends on the client and on the key the user pastes: Snaplii's sign-in page lists what that client will be able to do before the user connects, and the key's scope and limits can narrow it further.

A key that only allows transfers cannot connect. The remote server has the payment tools only; the local setup tools (snaplii_init, snaplii_connect, snaplii_config_show), snaplii_dashboard and snaplii_autopilot are not part of it.

Limits. A connection spends within its key's limits: gift cards count toward the key's daily limit and transfers toward its rolling 24-hour limit; bill payments are not capped by the key's limit. Every payment draws from Snaplii Cash.

Disconnecting. Remove the server in the client to stop using it there. Deleting the API key in the app cuts off every connection made with it, in every client: a client may still look connected and list its tools, but its next tool call that reaches Snaplii is refused and the connection ends.

If it does not work.

  • Sign-in succeeds but no tools appear, or every call fails: check that the URL ends with /mcp.
  • The sign-in page says the app cannot connect: that client is not supported yet; use the local MCP server.
  • Calls stop working after the key was deleted in the app: connect again with a current key.

MCP Server (Claude, OpenClaw, Cursor, Instinct)

The MCP server exposes 52 tools via the Model Context Protocol. One of them, snaplii_submit_api_key, is callable only by the host's secure card, and Instinct hides it together with snaplii_init. Works with any MCP-compatible client.

Twenty-six of the tools are the phone connection, one for each snaplii agent command: snaplii_agent_connect, snaplii_agent_connection, snaplii_agent_disconnect, snaplii_agent_balance, snaplii_agent_catalog, snaplii_agent_buy, snaplii_agent_order, snaplii_agent_order_continue (the command's --continue), snaplii_agent_orders, snaplii_agent_card, snaplii_agent_top_up, snaplii_agent_top_up_status, snaplii_agent_top_up_cancel, the eight snaplii_agent_billpay_* tools and the five snaplii_agent_transfer_* tools, which take the arguments of snaplii_billpay_* and snaplii_transfer_* and need no API key. They share the CLI's phone connection: a user connected in one is connected in the other. Connecting takes two calls, because a tool call cannot wait for the user as long as a command does: snaplii_agent_connect with agent and phone returns the match_code to tell the user, and the same tool without phone waits for their approval. Instinct hides these twenty-six too, and the remote MCP server does not have them.

Step 1: Install dependencies

Run the installer from the release clone (see Install from a release) and keep the register_mcp step from its report; it contains the absolute path of snaplii-mcp and the exact command or config snippet for your host:

python3 snaplii-src/scripts/install.py --host claude-desktop --source ./snaplii-src   # or claude-code, codex, cursor, openclaw, instinct

Step 2: Configure your MCP client

Use the snaplii-mcp path from the installer's register_mcp step; the report already contains the exact command or snippet for your host.

Claude Desktop

Edit your config file:

OS Config file location
macOS ~/Library/Application Support/Claude/claude_desktop_config.json
Windows %APPDATA%\Claude\claude_desktop_config.json
Linux ~/.config/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "snaplii": {
      "command": "/Users/you/.snaplii-env/bin/snaplii-mcp"
    }
  }
}

Use the absolute path from the report's register_mcp step; the file does not expand ~. Restart Claude Desktop after saving.

Claude Code

Register the installer's server for your user, so it works in every project, then check it:

claude mcp add --scope user snaplii -- ~/.snaplii-env/bin/snaplii-mcp
claude mcp get snaplii   # expect "User config" and "Connected"

Without --scope user, Claude Code registers the server only for the directory you ran the command in. If it says the server already exists, check that claude mcp get snaplii shows the report's path; if it does not, run claude mcp remove snaplii and add it again.

Codex

Register the installer's server for your user, then check it:

codex mcp add snaplii -- ~/.snaplii-env/bin/snaplii-mcp
codex mcp list
OpenClaw

Register the server with the OpenClaw CLI (reference):

openclaw mcp add snaplii --command ~/.snaplii-env/bin/snaplii-mcp

Then install the skills from the same release clone, as Install from a release shows, if you have not already.

Instinct

Instinct installs the MCP server with the installer and connects through the Instinct vault, so the API key never enters the chat.

  1. Run the installer from the release clone: python3 snaplii-src/scripts/install.py --host instinct --source ./snaplii-src. It refuses --cli-only because Instinct executes only through MCP.
  2. Register the snaplii-mcp executable from the report's register_mcp step (~/.snaplii-env/bin/snaplii-mcp) as a stdio MCP server in Instinct.
  3. Skip snaplii init. In Instinct the CLI only serves help, update, --version and config; everything else runs through the MCP tools.
  4. Make sure the Instinct vault holds the entry named below. If it does not, the agent explains how to create a key in the Snaplii App and sends the vault's encrypted submission link so you can save it there.
  5. Connect right after the first install, without waiting for a request. Call snaplii_connect and open the returned connect_url in the cloud browser. Use the Instinct vault fill action on the API key field with the returned vault_entry, click Connect, then call snaplii_connect again with the returned eid within 2 minutes. If the MCP tools only load in a new session, connect at the start of that session.

The vault entry is Snaplii API Key for the production gateway. Other gateways append their host, for example Snaplii API Key aipay.stage.snaplii.com.

Instinct is detected from any environment variable whose name starts with INSTINCT_; Muse takes precedence. snaplii_config_show and snaplii config doctor list the matching variable names, never their values.

The one-time eid in the connect link is visible to the agent. Whoever holds it can take the session token once, within 2 minutes after Connect is pressed. If someone else takes it first, snaplii_connect reports pending instead of connecting.

Cursor / VS Code / Other MCP clients

Any MCP-compatible client can start the Snaplii MCP server over stdio. Register the absolute snaplii-mcp path from the report's register_mcp step as a stdio server; for Cursor, that step names ~/.cursor/mcp.json. Most clients take a JSON entry like this:

{
  "mcpServers": {
    "snaplii": {
      "command": "/Users/you/.snaplii-env/bin/snaplii-mcp"
    }
  }
}

Step 3: Connect

Connect when the user asks to connect or gives a Snaplii task; installing alone does not connect. Connecting from inside the client is preferred: call snaplii_connect, and the host renders a secure card or opens a hosted page where the user enters the key off-model. If the client can do neither, the user authenticates in their own terminal first; an agent cannot answer the hidden prompt:

~/.snaplii-env/bin/snaplii init

Enter your API key when prompted.

In Instinct, skip this step and follow the Instinct instructions under Step 2.

Available MCP Tools

Tool Description
snaplii_connect Connect the account off-model: a secure card on hosts that render MCP Apps, a hosted page on hosts with URL elicitation, the vault-filled page in Instinct. Call only when has_valid_token is false
snaplii_init Authenticate with an API key passed as an argument. Fallback for clients with neither card nor page; hidden in Instinct
snaplii_config_show Auth status: has_valid_token, host, next_action
snaplii_balance Real spendable Snaplii Cash balance, labelled in the account's currency
snaplii_browse_tags Browse gift card categories; returns account_country
snaplii_browse_brand Brand details and denominations
snaplii_giftcard_list List owned gift cards
snaplii_giftcard_detail Card redemption code (sensitive)
snaplii_quote Preview price with voucher/cashback
snaplii_purchase Buy a gift card from Snaplii Cash; the charge happens as soon as it runs, within the daily limit
snaplii_cashback_calc Calculate cashback savings
snaplii_dashboard Owned card inventory summary
snaplii_billpay_* Canada only: payees, detail, history, save, vouchers, quote, pay, result
snaplii_transfer_* P2P transfers: create (cancellable ~5 min, then auto-sends), cancel, finish (send now), status, list
snaplii_agent_billpay_*, snaplii_agent_transfer_* The same bill pay and transfer tools through the phone connection: no API key, within the connection's daily limit

The local server also offers one MCP prompt, snaplii_autopilot, which carries the end-to-end buy, redeem, and order flow for hosts that can drive a browser.

API keys are created and managed only in the Snaplii app. There are no CLI or MCP tools to list, create, or delete them.


Components

agent-to-merchant-payments/
├── snaplii-cli/        # Python CLI (PyPI: snaplii-cli); also the library the MCP server uses
├── mcp-server/         # MCP server (PyPI: snaplii-mcp), 26 tools + the snaplii_autopilot prompt
├── skills/             # The core of each skill, written once (snaplii-cli_en.md, snaplii-autopilot_en.md; a Chinese _cn.md once written)
├── clawhub-publish/    # snaplii-cli skill folder: a short SKILL.md and the core beside it (ClawHub: snaplii-a2m-payment)
├── clawhub-autopilot/  # snaplii-autopilot skill folder, laid out the same way (ClawHub: snaplii-autopilot)
├── clawhub-plugin/     # ClawHub MCP bundle plugin (snaplii-a2m-mcp)
├── cursor-plugin/      # Cursor Marketplace plugin: MCP server + both skills, each a SKILL.md with Cursor's lines and the core (.cursor-plugin/ lists it)
├── claude-plugin/      # Claude Code plugin: MCP server + both skills, each a SKILL.md with Claude Code's lines and the core (.claude-plugin/ lists it)
├── copilot-connector/  # Copilot Studio / Power Platform connector: definition, properties, script.csx, readme
├── claude-desktop/     # Older project instructions for Claude Desktop; the MCP server's own instructions take precedence
├── scripts/            # The installer (install.py), Claude Desktop setup, the skill build (build_skills.py), candidate bundles
└── tests/              # pytest suite for the CLI, the MCP server, and the skill documents

Each skill is written once, in skills/<skill>.md: the core. Every agent's skill folder (clawhub-*/, and the skill folders under claude-plugin/ and cursor-plugin/) has a short SKILL.md, written by hand, which tells the agent to read the core and adds only what is particular to that agent. An agent installs its folder alone, so python3 scripts/build_skills.py puts the core beside each SKILL.md as <skill>.md, the same text in every folder. Edit the core in skills/, never those copies; python3 scripts/build_skills.py --check fails when a copy differs from its source, and the tests run it. A skill says when Snaplii fits; how to do each task is in the CLI's own guide, snaplii help (snaplii-cli/src/snaplii/guide.py), and in the MCP tools' descriptions. scripts/sync_muse_auth_docs.py --check verifies that the skills' Auth sections match the code.


Updating

When the user asks to update Snaplii, repeat the three commands with the new release tag, from a directory with no snaplii-src folder, so --source points at the new clone. On files_in_use, the running Snaplii server holds the files: the user closes the host and runs the report's retry command in a terminal; then open a new session. Do not use snaplii update here: it upgrades only the CLI, not the MCP server.


Uninstall

If you used phone onboarding, run snaplii agent disconnect before clearing local credentials. For an API-key installation, follow the steps that apply to your host.

  1. Revoke the API key in the Snaplii App: More → Payment Methods → AI Payment Management.
  2. Sign out locally: ~/.snaplii-env/bin/snaplii config clear. It does not delete a key the host stores (Muse, the Instinct vault).
  3. Remove the MCP registration: claude mcp remove snaplii in Claude Code, codex mcp remove snaplii in Codex, or delete the snaplii entry from claude_desktop_config.json or ~/.cursor/mcp.json.
  4. Remove the skills: npx --yes skills remove -g -y snaplii-cli snaplii-autopilot. After Manual install, delete the two folders from that skills directory instead; a skill installed earlier from ClawHub is removed with ClawHub.
  5. Delete the environment and the local configuration: rm -rf ~/.snaplii-env ~/.snaplii (PowerShell: Remove-Item -Recurse -Force $HOME\.snaplii-env, $HOME\.snaplii).
  6. If the installer fetched CPython 3.12 with uv and nothing else uses it, remove it with uv python uninstall 3.12. If the installer also installed uv into ~/.local/bin, delete uv and uvx there.

Troubleshooting

snaplii: command not found after install

If you used the installer, the CLI is not on PATH by design: call ~/.snaplii-env/bin/snaplii (Scripts\snaplii.exe on Windows) or run the report's cli_on_path command.

The skill is installed but the agent does not use it

Check that the folder is named after the skill (snaplii-cli or snaplii-autopilot) and contains SKILL.md at its top level, and that it sits in the skills directory your agent reads. Most agents load skills at session start, so open a new session after installing. Muse names the folder itself; there, find the skill with grep -l '^name: snaplii-cli' ~/workspace/skills/*/SKILL.md.

Every Snaplii call answers auth_required, reauth_required, or mcp_required

There is no valid session in the runtime that is executing the task. reauth_required means there was one and it expired, was rejected, or was lost when the MCP server restarted. Run snaplii config show or snaplii_config_show and follow its next_action; Sessions and reconnecting lists the actions by host. mcp_required means the host is Instinct: connect with snaplii_connect instead of the CLI.

No Python on the machine

Bootstrap uv into ~/.local/bin and let it fetch CPython 3.12, then start the installer with that Python and the same flags you chose:

export UV_INSTALL_DIR="$HOME/.local/bin" UV_NO_MODIFY_PATH=1
curl -LsSf https://astral.sh/uv/install.sh | sh
"$UV_INSTALL_DIR/uv" python install --no-bin --no-registry 3.12
PY312="$("$UV_INSTALL_DIR/uv" python find --no-project --managed-python 3.12)"
"$PY312" snaplii-src/scripts/install.py --host claude-code --source ./snaplii-src   # your --host or --cli-only

In PowerShell on Windows:

$env:UV_INSTALL_DIR = "$HOME\.local\bin"; $env:UV_NO_MODIFY_PATH = "1"
irm https://astral.sh/uv/install.ps1 | iex
& "$env:UV_INSTALL_DIR\uv.exe" python install --no-bin --no-registry 3.12
$py312 = & "$env:UV_INSTALL_DIR\uv.exe" python find --no-project --managed-python 3.12
& $py312 snaplii-src\scripts\install.py --host claude-code --source .\snaplii-src   # your --host or --cli-only

The environment then depends on that Python; Uninstall removes both.

The installer reported failed or partial

Read failure.code, failure.remedy and failure.retryable:

Code Meaning Retryable
python_too_old, python_download_failed, venv_create_failed No Python 3.10+ that can create an environment, and uv could not fetch one yes, after the remedy
venv_path_occupied, venv_locked, destination_unwritable, source_invalid The destination or --source cannot be used as given venv_locked only
venv_broken, venv_python_too_old The installer's own environment exists but cannot be reused, for example after the base Python was upgraded no: delete that directory and re-run (it is recreated at the same path, so the host registration keeps working), or pass another --venv
index_unreachable, disk_full, files_in_use pip could not download or write yes
index_auth_failed, tls_failed, package_unavailable, build_failed, permission_denied, dependency_conflict, pip_failed pip failed for a reason a re-run will not fix no
cli_missing, mcp_missing, cli_verification_failed, mcp_handshake_failed, *_timeout The installed component is missing or did not answer as expected yes
bad_arguments, mcp_required_on_instinct, *_spawn_failed, internal_error The command line cannot work here, or the installer hit a bug no
cleanup_incomplete A helper process could not be stopped; the lock file was kept on purpose no: wait for the listed pids, delete the lock, re-run

When retryable is true, apply the required step's why, then run its command once; if the same code returns, report it. files_in_use means the host's registered Snaplii server holds the files: close the host, then re-run.

The host's Snaplii server stopped working after ~/.snaplii-env was deleted

The registration points at ~/.snaplii-env/bin/snaplii-mcp. Clone the release again and re-run its installer with --source: it recreates the environment at the same path, so the registration works again without changes.


Security

  • Customer consent. In merchant autopilot, show the brand, card amount and quote, then wait for the customer’s explicit approval before buying. Get fresh approval if the quote changes. After applying the card at checkout, confirm the final order with the customer before placing it. The card remains in the customer’s wallet if checkout fails.
  • Credentials. The phone connection token stays in the system keychain or the supported private local store. An API key can be entered on Snaplii’s hosted sign-in page, in a secure host card or vault, or at the terminal’s hidden prompt. The local MCP fallback snaplii_init passes the key through the model once. Prefer a secure entry method when available.
  • Payment outcomes. For phone orders, use the original order ID or idempotency key. An unclear bill payment with a paymentNo can be checked with snaplii agent billpay result (snaplii billpay result with an API key). Without that number, reconcile the bill in the app before submitting another payment. Reuse the original idempotency key for a transfer in CREATING.
  • Card details. Card numbers, PINs and redemption codes are sensitive. Enter the code at the merchant checkout. Share it in chat only when the user has chosen to redeem the card themselves.

License

This project is licensed under the Apache License 2.0.

See LICENSE for the full text.

Nearby in the ranking
Similar items

AI Rank for iPhone

Follow AI model rankings

Download on the App Store