Skip to main content
tpay runs as a Model Context Protocol server, so an agent can pay for APIs and read balances as tools — no shell access required. This is the cleanest way to give an LLM-based agent a wallet.

The MCP tools

tpay mcp exposes the active wallet over stdio with two tools:
pay
tool
Makes an HTTP request from the wallet. If the endpoint responds with 402 Payment Required, tpay settles the payment and retries automatically. The user is asked to approve the payment (Touch ID on macOS) before it is signed. Returns the upstream status, headers, and body, plus a receipt when a payment was made.Parameters: url (required), method, headers, body.
get_balance
tool
Returns the wallet’s balances for known stablecoins and SUI on the given network.Parameters: network (mainnet or testnet, defaults to mainnet).
The agent proposes a payment, but it settles only after you approve it on your device. The model never sees or holds the secret key.

Run with Claude

The fastest path is tpay claude, which launches the Claude CLI with the active wallet already wired in as an MCP server. It forwards every Claude flag:
tpay claude
Ask Claude to call a paid endpoint and it will use the pay tool, pausing for your approval before spending.
tpay claude requires the Claude CLI to be installed and on your PATH.

Add to any MCP client

To wire the wallet into another MCP client (Claude Desktop, Cursor, and others), register tpay mcp as a stdio server. The exact file differs per client, but the server entry looks the same:
mcp config
{
  "mcpServers": {
    "tpay": {
      "command": "tpay",
      "args": ["mcp"]
    }
  }
}
The server acts on whichever wallet is currently active. To pin a specific wallet, set it as the default first with tpay account default <label>.

Run the server directly

You can also start the server yourself — useful for custom agent runtimes that speak MCP over stdio:
tpay mcp
tpay mcp reserves stdout for the MCP JSON-RPC stream. Don’t pipe other output into it.

Next steps

CLI reference

Every command and flag.