x402-proxy 0.11.1 → 0.11.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +62 -39
- package/dist/bin/cli.js +5 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,53 +1,37 @@
|
|
|
1
1
|
# x402-proxy
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/x402-proxy)
|
|
4
|
+
[](LICENSE)
|
|
5
|
+
[](https://github.com/RichardLitt/standard-readme)
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
curl for x402 and MPP paid APIs with MCP proxy support. Auto-pays HTTP 402 on Base, Solana, and Tempo.
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
npx x402-proxy https://surf.cascade.fyi/api/v1/twitter/user/openclaw
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
That's it. The endpoint returns 402, x402-proxy pays and streams the response.
|
|
9
|
+
Zero crypto code on the buyer side. One mnemonic derives both EVM (Base/Tempo) and Solana keypairs - fund any chain and go. Supports one-time payments (x402, MPP charge) and pay-per-token streaming (MPP sessions). Use it as a CLI, an MCP proxy for AI agents, or as a Node.js library.
|
|
12
10
|
|
|
13
|
-
|
|
11
|
+
## Table of Contents
|
|
14
12
|
|
|
15
|
-
|
|
13
|
+
- [Install](#install)
|
|
14
|
+
- [Usage](#usage)
|
|
15
|
+
- [Commands](#commands)
|
|
16
|
+
- [MCP Proxy](#mcp-proxy)
|
|
17
|
+
- [Wallet](#wallet)
|
|
18
|
+
- [Env Vars](#env-vars)
|
|
19
|
+
- [Library Usage](#library-usage)
|
|
20
|
+
- [OpenClaw Plugin](#openclaw-plugin)
|
|
21
|
+
- [Contributing](#contributing)
|
|
22
|
+
- [License](#license)
|
|
16
23
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
### Quick setup
|
|
24
|
+
## Install
|
|
20
25
|
|
|
21
26
|
```bash
|
|
22
|
-
npx x402-proxy
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
Auto-detects installed AI clients (Claude Code, Cursor, VS Code, and 16+ others), shows a config preview, and writes it for you. Runs wallet setup if needed.
|
|
26
|
-
|
|
27
|
-
### Manual config
|
|
28
|
-
|
|
29
|
-
Or add to your client config directly:
|
|
30
|
-
|
|
31
|
-
```json
|
|
32
|
-
{
|
|
33
|
-
"mcpServers": {
|
|
34
|
-
"surf": {
|
|
35
|
-
"command": "npx",
|
|
36
|
-
"args": ["-y", "x402-proxy", "mcp", "https://surf.cascade.fyi/mcp"]
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
27
|
+
npx x402-proxy https://surf.cascade.fyi/api/v1/twitter/user/openclaw
|
|
40
28
|
```
|
|
41
29
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
For OpenClaw:
|
|
30
|
+
That's it. The endpoint returns 402, x402-proxy pays and streams the response.
|
|
45
31
|
|
|
46
|
-
|
|
47
|
-
openclaw mcp set surf '{"command":"npx","args":["-y","x402-proxy","mcp","https://surf.cascade.fyi/mcp"]}'
|
|
48
|
-
```
|
|
32
|
+
No wallet? It'll walk you through setup automatically. One mnemonic derives both EVM (Base/Tempo) and Solana keypairs. Fund any chain and go.
|
|
49
33
|
|
|
50
|
-
##
|
|
34
|
+
## Usage
|
|
51
35
|
|
|
52
36
|
Works like curl. Response body streams to stdout, payment info goes to stderr.
|
|
53
37
|
|
|
@@ -97,6 +81,41 @@ $ npx x402-proxy wallet export-key <target> # bare key/mnemonic to stdout (evm|s
|
|
|
97
81
|
|
|
98
82
|
All commands support `--help` for details. Use `-c <dir>` to override the config directory.
|
|
99
83
|
|
|
84
|
+
## MCP Proxy
|
|
85
|
+
|
|
86
|
+
Let your AI agent consume any paid MCP server.
|
|
87
|
+
|
|
88
|
+
### Quick setup
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
npx x402-proxy mcp add surf https://surf.cascade.fyi/mcp
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Auto-detects installed AI clients (Claude Code, Cursor, VS Code, and 16+ others), shows a config preview, and writes it for you. Runs wallet setup if needed.
|
|
95
|
+
|
|
96
|
+
### Manual config
|
|
97
|
+
|
|
98
|
+
Or add to your client config directly:
|
|
99
|
+
|
|
100
|
+
```json
|
|
101
|
+
{
|
|
102
|
+
"mcpServers": {
|
|
103
|
+
"surf": {
|
|
104
|
+
"command": "npx",
|
|
105
|
+
"args": ["-y", "x402-proxy", "mcp", "https://surf.cascade.fyi/mcp"]
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
The proxy auto-generates a wallet on first run and uses `~/.config/x402-proxy/wallet.json`. No env vars needed. Your agent never touches crypto.
|
|
112
|
+
|
|
113
|
+
For OpenClaw:
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
openclaw mcp set surf '{"command":"npx","args":["-y","x402-proxy","mcp","https://surf.cascade.fyi/mcp"]}'
|
|
117
|
+
```
|
|
118
|
+
|
|
100
119
|
## Wallet
|
|
101
120
|
|
|
102
121
|
A single BIP-39 mnemonic derives both chains:
|
|
@@ -143,7 +162,7 @@ See the [library API docs](https://github.com/cascade-protocol/x402-proxy/tree/m
|
|
|
143
162
|
|
|
144
163
|
## OpenClaw Plugin
|
|
145
164
|
|
|
146
|
-
The OpenClaw plugin
|
|
165
|
+
The OpenClaw plugin ships as a separate npm package: `x402-proxy-openclaw`.
|
|
147
166
|
|
|
148
167
|
```bash
|
|
149
168
|
openclaw plugins install x402-proxy-openclaw
|
|
@@ -155,6 +174,10 @@ By default, the plugin registers a built-in `surf` provider at `/x402-proxy/v1`
|
|
|
155
174
|
|
|
156
175
|
For MPP-backed inference, make sure the wallet source includes an EVM key as well as Solana. `npx x402-proxy setup` does this automatically.
|
|
157
176
|
|
|
177
|
+
## Contributing
|
|
178
|
+
|
|
179
|
+
PRs welcome. Feel free to [open an issue](https://github.com/cascade-protocol/x402-proxy/issues) for bug reports or feature requests.
|
|
180
|
+
|
|
158
181
|
## License
|
|
159
182
|
|
|
160
|
-
Apache-2.0
|
|
183
|
+
[Apache-2.0](LICENSE) (c) Cascade Protocol
|
package/dist/bin/cli.js
CHANGED
|
@@ -2321,7 +2321,7 @@ Wallet is auto-generated on first run. No env vars needed.`
|
|
|
2321
2321
|
}
|
|
2322
2322
|
const remoteClient = new Client({
|
|
2323
2323
|
name: "x402-proxy",
|
|
2324
|
-
version: "0.11.
|
|
2324
|
+
version: "0.11.3"
|
|
2325
2325
|
});
|
|
2326
2326
|
await connectTransport(remoteClient);
|
|
2327
2327
|
function recordX402Payment(ctx) {
|
|
@@ -2352,7 +2352,7 @@ Wallet is auto-generated on first run. No env vars needed.`
|
|
|
2352
2352
|
}
|
|
2353
2353
|
const localServer = new Server({
|
|
2354
2354
|
name: "x402-proxy",
|
|
2355
|
-
version: "0.11.
|
|
2355
|
+
version: "0.11.3"
|
|
2356
2356
|
}, { capabilities: {
|
|
2357
2357
|
tools: tools.length > 0 ? {} : void 0,
|
|
2358
2358
|
resources: remoteResources.length > 0 ? {} : void 0
|
|
@@ -2425,7 +2425,7 @@ Wallet is auto-generated on first run. No env vars needed.`
|
|
|
2425
2425
|
}));
|
|
2426
2426
|
const remoteClient = new Client({
|
|
2427
2427
|
name: "x402-proxy",
|
|
2428
|
-
version: "0.11.
|
|
2428
|
+
version: "0.11.3"
|
|
2429
2429
|
});
|
|
2430
2430
|
await connectTransport(remoteClient);
|
|
2431
2431
|
const mppClient = McpClient.wrap(remoteClient, { methods: wrappedMethods });
|
|
@@ -2440,7 +2440,7 @@ Wallet is auto-generated on first run. No env vars needed.`
|
|
|
2440
2440
|
}
|
|
2441
2441
|
const localServer = new Server({
|
|
2442
2442
|
name: "x402-proxy",
|
|
2443
|
-
version: "0.11.
|
|
2443
|
+
version: "0.11.3"
|
|
2444
2444
|
}, { capabilities: {
|
|
2445
2445
|
tools: tools.length > 0 ? {} : void 0,
|
|
2446
2446
|
resources: remoteResources.length > 0 ? {} : void 0
|
|
@@ -2826,7 +2826,7 @@ const app = buildApplication(buildRouteMap({
|
|
|
2826
2826
|
docs: { brief: "curl for x402 paid APIs" }
|
|
2827
2827
|
}), {
|
|
2828
2828
|
name: "x402-proxy",
|
|
2829
|
-
versionInfo: { currentVersion: "0.11.
|
|
2829
|
+
versionInfo: { currentVersion: "0.11.3" },
|
|
2830
2830
|
scanner: { caseStyle: "allow-kebab-for-camel" }
|
|
2831
2831
|
});
|
|
2832
2832
|
//#endregion
|
package/package.json
CHANGED