Skip to content

Commit adfb72f

Browse files
Add Link CLI to wallet and Stripe docs (#660)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 9c10c5e commit adfb72f

3 files changed

Lines changed: 69 additions & 0 deletions

File tree

src/pages/payment-methods/stripe/charge.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,10 @@ See the [payment links guide](/guides/payment-links) for a full walkthrough and
170170

171171
## Client
172172

173+
::::tip[For agents]
174+
The [Link CLI](/tools/wallet#link-cli) handles `stripe.charge` end-to-end—`link-cli mpp pay` parses the 402 Challenge, creates an SPT from the user's Link wallet, and retries the request with the Credential. No code required.
175+
::::
176+
173177
Use `stripe` with `Mppx.create` to automatically handle `402` responses. The client parses the Challenge, creates an SPT through the `createToken` callback, and retries with the Credential.
174178

175179
SPT creation requires a Stripe secret key, so the client accepts a `createToken` callback that proxies through a server endpoint. You can optionally pass a `client` (a Stripe.js instance from `@stripe/stripe-js`) which is forwarded to the `createToken` callback for use with Elements.

src/pages/payment-methods/stripe/index.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ Machine payments must be enabled on your Stripe account before you can accept MP
2020

2121
To learn more, read the [Stripe documentation](https://docs.stripe.com/payments/machine/mpp) on accepting MPP.
2222

23+
::::tip[For agents]
24+
Use the [Link CLI](/tools/wallet#link-cli) to pay for `stripe.charge` services from a Link wallet without writing integration code. `link-cli mpp pay` handles the full 402 → SPT → retry flow automatically.
25+
::::
26+
2327
## How it works
2428

2529
<MermaidDiagram chart={`sequenceDiagram

src/pages/tools/wallet.mdx

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Agents need a wallet to pay for MPP-enabled services. Choose the wallet that fit
1414
| [Tempo Wallet](#tempo-wallet) | Tempo MPP services with spend controls and service discovery | `tempo` | `tempo wallet login` |
1515
| [Privy Agent CLI](#privy-agent-cli) | Multi-chain agent wallets with browser-based funding | `tempo`, `solana` | `privy-agent-wallets login` |
1616
| [AgentCash](#agentcash) | Discover and use 300+ premium APIs via MPP | `tempo` | `npx agentcash onboard` |
17+
| [Link CLI](#link-cli) | Stripe payments via Link wallet | `stripe` | `link-cli auth login` |
1718
| [`mppx` CLI](#mppx) | Development and debugging | All | `mppx account create` |
1819

1920
## Tempo Wallet
@@ -199,6 +200,66 @@ $ claude mcp add agentcash --scope user -- npx -y agentcash@latest
199200
- **API and tool discovery** - any service that implements MPP is automatically discoverable and usable
200201
- **MPPScan integration** — easily discover and use services via [mppscan.com](https://www.mppscan.com/)
201202

203+
## Link CLI
204+
205+
[Link CLI](https://github.com/stripe/link-cli) lets agents pay for MPP services using a [Link](https://link.co) wallet. The agent authenticates with Link, then `link-cli mpp pay` handles the full `402` → SPT → retry flow automatically—no Stripe integration code required.
206+
207+
The user approves each purchase via the Link app, and credentials are one-time-use tokens scoped to a specific merchant and amount.
208+
209+
<Tabs>
210+
<Tab title="Agent">
211+
212+
Paste this into your agent:
213+
214+
```
215+
Read https://github.com/stripe/link-cli/blob/main/SKILL.md and set up link-cli
216+
```
217+
218+
</Tab>
219+
<Tab title="Human">
220+
::::steps
221+
222+
### Install
223+
224+
```bash [terminal]
225+
$ npm install -g @stripe/link-cli
226+
```
227+
228+
### Log in
229+
230+
```bash [terminal]
231+
$ link-cli auth login --client-name "My Agent"
232+
```
233+
234+
This displays a verification URL and phrase. Approve in the Link app to complete authentication.
235+
236+
### List payment methods
237+
238+
```bash [terminal]
239+
$ link-cli payment-methods list
240+
```
241+
242+
### Make a paid request
243+
244+
```bash [terminal]
245+
$ link-cli mpp pay https://api.example.com/resource \
246+
--method POST \
247+
--data '{"prompt": "hello"}'
248+
```
249+
250+
::::
251+
</Tab>
252+
</Tabs>
253+
254+
**Supported methods:** <Badge variant="info">stripe.charge</Badge>
255+
256+
**Key features:**
257+
258+
- **End-to-end 402 handling**`link-cli mpp pay` parses the Challenge, creates an SPT, and retries with the Credential
259+
- **User approval**—each purchase requires explicit approval in the Link app
260+
- **One-time-use credentials**—SPTs are scoped to a specific merchant, amount, and context
261+
- **MCP server mode**—run as `link-cli --mcp` for integration with Claude Code and other MCP-compatible agents
262+
202263
## `mppx`
203264

204265
The [`mppx`](/sdk/typescript/cli) CLI is a lightweight MPP client bundled with the `mppx` package. It handles `402` responses automatically using a local keychain account—ideal for development, testing, and debugging.

0 commit comments

Comments
 (0)