402-mcp 3.9.1 → 3.10.0
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 +41 -132
- package/build/tools/search.d.ts +3 -0
- package/build/tools/search.js +3 -0
- package/build/tools/search.js.map +1 -1
- package/package.json +3 -1
package/README.md
CHANGED
|
@@ -3,53 +3,35 @@
|
|
|
3
3
|
[](./LICENSE)
|
|
4
4
|
[](https://www.typescriptlang.org/)
|
|
5
5
|
[](https://nodejs.org/)
|
|
6
|
+
[](./docs/security.md)
|
|
6
7
|
[](https://primal.net/p/npub1mgvlrnf5hm9yf0n5mf9nqmvarhvxkc6remu5ec3vf8r0txqkuk7su0e7q2)
|
|
7
8
|
|
|
8
|
-
L402 + x402 client MCP that gives AI agents economic agency. Discover, pay for, and consume any payment-gated API
|
|
9
|
+
L402 + x402 client MCP that gives AI agents economic agency. Discover, pay for, and consume any payment-gated API — no human registration, no API keys, no middlemen.
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
The L402 ecosystem is growing fast - Lightning Labs' [lightning-agent-tools](https://github.com/lightninglabs/lightning-agent-tools), Coinbase's x402, and others. 402-mcp is the **payment-rail agnostic** alternative:
|
|
15
|
-
|
|
16
|
-
| | 402-mcp | Lightning Labs agent tools |
|
|
17
|
-
|---|---|---|
|
|
18
|
-
| **Payment rails** | NWC + Cashu + human fallback | Lightning only |
|
|
19
|
-
| **Node required?** | No — connects to any NWC wallet | Yes — runs LND |
|
|
20
|
-
| **Server compatibility** | Any L402 server | Aperture-focused |
|
|
21
|
-
| **Spend safety** | Per-payment cap + rolling 60s window | Per-call max-cost |
|
|
22
|
-
| **Credential storage** | Encrypted at rest (AES-256-GCM) | File permissions |
|
|
23
|
-
| **Privacy** | No PII, SSRF protection, error sanitisation | Standard |
|
|
24
|
-
|
|
25
|
-
Use Lightning Labs' tools if you want agents that **run their own Lightning node**. Use 402-mcp if you want agents that **pay from any wallet without infrastructure**.
|
|
11
|
+
- **Discover** paid APIs on Nostr — no URLs needed upfront
|
|
12
|
+
- **Auto-pay** with Lightning (NWC), Cashu ecash, or human QR fallback
|
|
13
|
+
- **Credentials cached and encrypted** at rest (AES-256-GCM)
|
|
14
|
+
- **Works with any L402 server** — toll-booth, Aperture, or any future implementation
|
|
26
15
|
|
|
27
16
|
## Quick start
|
|
28
17
|
|
|
18
|
+
**1. Install**
|
|
19
|
+
|
|
29
20
|
```bash
|
|
30
21
|
npx 402-mcp
|
|
31
22
|
```
|
|
32
23
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
```json
|
|
38
|
-
{
|
|
39
|
-
"mcpServers": {
|
|
40
|
-
"l402": {
|
|
41
|
-
"command": "npx",
|
|
42
|
-
"args": ["402-mcp"],
|
|
43
|
-
"env": {
|
|
44
|
-
"NWC_URI": "nostr+walletconnect://...",
|
|
45
|
-
"MAX_AUTO_PAY_SATS": "1000"
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
24
|
+
**2. Connect to Claude Code**
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
claude mcp add 402-mcp -- npx 402-mcp
|
|
50
28
|
```
|
|
51
29
|
|
|
52
|
-
|
|
30
|
+
**3. Try it**
|
|
31
|
+
|
|
32
|
+
Ask Claude: *"Search for paid joke APIs using l402_search"* — no wallet needed, just discovery.
|
|
33
|
+
|
|
34
|
+
Ready to make paid calls? See the [full quickstart guide](./docs/quickstart.md) to set up a wallet and watch your agent pay for its first API call.
|
|
53
35
|
|
|
54
36
|
## Configuration
|
|
55
37
|
|
|
@@ -75,6 +57,7 @@ See [examples/](./examples/) for more configuration samples.
|
|
|
75
57
|
| `l402_credentials` | List stored credentials and cached balances |
|
|
76
58
|
| `l402_balance` | Check cached credit balance for a server |
|
|
77
59
|
| `l402_search` | Discover L402 services on Nostr relays (kind 31402 announcements) |
|
|
60
|
+
| `l402_store_token` | Store an L402 token obtained from a payment page |
|
|
78
61
|
|
|
79
62
|
### toll-booth extensions
|
|
80
63
|
|
|
@@ -115,41 +98,15 @@ Agent: "I need routing data from routing.trotters.cc"
|
|
|
115
98
|
-> 200 OK, route data, 545 credits remaining
|
|
116
99
|
```
|
|
117
100
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
Agents can discover paid APIs without knowing URLs upfront. `l402_search` queries Nostr relays for kind 31402 service announcements — the decentralised registry for L402 services.
|
|
121
|
-
|
|
122
|
-
```mermaid
|
|
123
|
-
sequenceDiagram
|
|
124
|
-
participant Agent as AI Agent
|
|
125
|
-
participant MCP as 402-mcp
|
|
126
|
-
participant Relay as Nostr Relays
|
|
127
|
-
|
|
128
|
-
Agent->>MCP: l402_search("routing")
|
|
129
|
-
MCP->>Relay: Subscribe kind 31402
|
|
130
|
-
Relay-->>MCP: Matching service events
|
|
131
|
-
MCP-->>Agent: Services with URLs, pricing, capabilities
|
|
132
|
-
Agent->>MCP: l402_discover(service_url)
|
|
133
|
-
Note over Agent: Continue with payment flow...
|
|
134
|
-
```
|
|
101
|
+
For detailed architecture and payment flow diagrams, see [docs/architecture.md](./docs/architecture.md).
|
|
135
102
|
|
|
136
103
|
## Payment methods
|
|
137
104
|
|
|
138
|
-
```mermaid
|
|
139
|
-
graph TD
|
|
140
|
-
Pay["Pay Invoice"]
|
|
141
|
-
Pay --> NWC{"NWC configured?"}
|
|
142
|
-
NWC -->|Yes| NWCPay["Pay via Lightning wallet<br/>(fully autonomous)"]
|
|
143
|
-
NWC -->|No| CashuQ{"Cashu tokens<br/>available?"}
|
|
144
|
-
CashuQ -->|Yes| CashuPay["Melt ecash tokens<br/>(fully autonomous)"]
|
|
145
|
-
CashuQ -->|No| HumanPay["Present QR code<br/>(human pays)"]
|
|
146
|
-
```
|
|
147
|
-
|
|
148
105
|
Three payment rails, tried in priority order:
|
|
149
106
|
|
|
150
|
-
1. **NWC** (Nostr Wallet Connect)
|
|
151
|
-
2. **Cashu**
|
|
152
|
-
3. **Human-in-the-loop**
|
|
107
|
+
1. **NWC** (Nostr Wallet Connect) — fully autonomous; pays from your connected wallet
|
|
108
|
+
2. **Cashu** — fully autonomous; melts ecash tokens to pay invoices
|
|
109
|
+
3. **Human-in-the-loop** — presents QR code, polls for settlement
|
|
153
110
|
|
|
154
111
|
The agent can override the method per-call, or you can configure only the methods you want.
|
|
155
112
|
|
|
@@ -159,73 +116,7 @@ The agent can override the method per-call, or you can configure only the method
|
|
|
159
116
|
|
|
160
117
|
## Privacy
|
|
161
118
|
|
|
162
|
-
402-mcp stores credentials locally on your machine only (`~/.402-mcp/credentials.json`, encrypted at rest). No data is sent to any third party. No accounts, no tracking, no analytics. Payments use Lightning or Cashu
|
|
163
|
-
|
|
164
|
-
## Architecture
|
|
165
|
-
|
|
166
|
-
```mermaid
|
|
167
|
-
graph TB
|
|
168
|
-
Agent["AI Agent<br/>(Claude, Cursor, etc.)"]
|
|
169
|
-
MCP["402-mcp<br/>MCP Server"]
|
|
170
|
-
|
|
171
|
-
subgraph Wallets["Payment Rails"]
|
|
172
|
-
NWC["NWC<br/>(Lightning)"]
|
|
173
|
-
Cashu["Cashu<br/>(Ecash)"]
|
|
174
|
-
Human["Human-in-the-loop<br/>(QR code)"]
|
|
175
|
-
end
|
|
176
|
-
|
|
177
|
-
subgraph Storage["Local Storage"]
|
|
178
|
-
Creds["Credential Store<br/>(AES-256-GCM)"]
|
|
179
|
-
Tokens["Cashu Token Store"]
|
|
180
|
-
end
|
|
181
|
-
|
|
182
|
-
subgraph Servers["Any L402 Server"]
|
|
183
|
-
TB["toll-booth"]
|
|
184
|
-
Aperture["Aperture"]
|
|
185
|
-
Other["Any L402<br/>implementation"]
|
|
186
|
-
end
|
|
187
|
-
|
|
188
|
-
Nostr["Nostr Relays<br/>(Service Discovery)"]
|
|
189
|
-
|
|
190
|
-
Agent <-->|"MCP protocol<br/>(stdio / HTTP)"| MCP
|
|
191
|
-
MCP --> NWC
|
|
192
|
-
MCP --> Cashu
|
|
193
|
-
MCP --> Human
|
|
194
|
-
MCP <--> Creds
|
|
195
|
-
MCP <--> Tokens
|
|
196
|
-
MCP <-->|"HTTP + L402"| TB
|
|
197
|
-
MCP <-->|"HTTP + L402"| Aperture
|
|
198
|
-
MCP <-->|"HTTP + L402"| Other
|
|
199
|
-
MCP <-->|"kind 31402"| Nostr
|
|
200
|
-
```
|
|
201
|
-
|
|
202
|
-
## Payment flow
|
|
203
|
-
|
|
204
|
-
```mermaid
|
|
205
|
-
sequenceDiagram
|
|
206
|
-
participant Agent as AI Agent
|
|
207
|
-
participant MCP as 402-mcp
|
|
208
|
-
participant API as L402 API
|
|
209
|
-
participant Wallet as Wallet (NWC/Cashu)
|
|
210
|
-
|
|
211
|
-
Agent->>MCP: l402_discover(url)
|
|
212
|
-
MCP->>API: GET /endpoint
|
|
213
|
-
API-->>MCP: 402 + invoice + macaroon
|
|
214
|
-
MCP-->>Agent: price: 10 sats, server: toll-booth
|
|
215
|
-
|
|
216
|
-
Agent->>Agent: Reason about pricing
|
|
217
|
-
|
|
218
|
-
Agent->>MCP: l402_fetch(url)
|
|
219
|
-
MCP->>API: GET /endpoint
|
|
220
|
-
API-->>MCP: 402 + invoice + macaroon
|
|
221
|
-
MCP->>MCP: Amount ≤ MAX_AUTO_PAY_SATS?
|
|
222
|
-
MCP->>Wallet: Pay invoice
|
|
223
|
-
Wallet-->>MCP: preimage
|
|
224
|
-
MCP->>MCP: Store credential
|
|
225
|
-
MCP->>API: GET /endpoint + Authorization: L402
|
|
226
|
-
API-->>MCP: 200 OK + data
|
|
227
|
-
MCP-->>Agent: Response data + balance
|
|
228
|
-
```
|
|
119
|
+
402-mcp stores credentials locally on your machine only (`~/.402-mcp/credentials.json`, encrypted at rest). No data is sent to any third party. No accounts, no tracking, no analytics. Payments use Lightning or Cashu — pseudonymous by design.
|
|
229
120
|
|
|
230
121
|
## Ecosystem
|
|
231
122
|
|
|
@@ -236,6 +127,24 @@ sequenceDiagram
|
|
|
236
127
|
| **[402-mcp](https://github.com/TheCryptoDonkey/402-mcp)** | **MCP client — AI agents discover, pay, and consume L402 + x402 APIs** |
|
|
237
128
|
| [402-announce](https://github.com/TheCryptoDonkey/402-announce) | Publish L402 services on Nostr for decentralised discovery |
|
|
238
129
|
|
|
130
|
+
<details>
|
|
131
|
+
<summary>How does this compare to alternatives?</summary>
|
|
132
|
+
|
|
133
|
+
The L402 ecosystem is growing fast — Lightning Labs' [lightning-agent-tools](https://github.com/lightninglabs/lightning-agent-tools), Coinbase's x402, and others. 402-mcp is the **payment-rail agnostic** alternative:
|
|
134
|
+
|
|
135
|
+
| | 402-mcp | Lightning Labs agent tools |
|
|
136
|
+
|---|---|---|
|
|
137
|
+
| **Payment rails** | NWC + Cashu + human fallback | Lightning only |
|
|
138
|
+
| **Node required?** | No — connects to any NWC wallet | Yes — runs LND |
|
|
139
|
+
| **Server compatibility** | Any L402 server | Aperture-focused |
|
|
140
|
+
| **Spend safety** | Per-payment cap + rolling 60s window | Per-call max-cost |
|
|
141
|
+
| **Credential storage** | Encrypted at rest (AES-256-GCM) | File permissions |
|
|
142
|
+
| **Privacy** | No PII, SSRF protection, error sanitisation | Standard |
|
|
143
|
+
|
|
144
|
+
Use Lightning Labs' tools if you want agents that **run their own Lightning node**. Use 402-mcp if you want agents that **pay from any wallet without infrastructure**.
|
|
145
|
+
|
|
146
|
+
</details>
|
|
147
|
+
|
|
239
148
|
See [CONTRIBUTING.md](./CONTRIBUTING.md) for development setup and guidelines.
|
|
240
149
|
|
|
241
150
|
---
|
package/build/tools/search.d.ts
CHANGED
|
@@ -20,6 +20,9 @@ export interface ParsedService {
|
|
|
20
20
|
name: string;
|
|
21
21
|
description: string;
|
|
22
22
|
endpoint?: string;
|
|
23
|
+
pricing?: string;
|
|
24
|
+
auth?: string;
|
|
25
|
+
timeout?: number;
|
|
23
26
|
}[];
|
|
24
27
|
}
|
|
25
28
|
/** Extracts service metadata (name, URL, pricing, capabilities) from a kind 31402 Nostr event. */
|
package/build/tools/search.js
CHANGED
|
@@ -29,6 +29,9 @@ export function parseAnnounceEvent(event) {
|
|
|
29
29
|
name: c.name.slice(0, 500),
|
|
30
30
|
description: c.description.slice(0, 2000),
|
|
31
31
|
...(typeof c.endpoint === 'string' ? { endpoint: c.endpoint.slice(0, 2048) } : {}),
|
|
32
|
+
...(typeof c.pricing === 'string' ? { pricing: c.pricing } : {}),
|
|
33
|
+
...(typeof c.auth === 'string' ? { auth: c.auth } : {}),
|
|
34
|
+
...(typeof c.timeout === 'number' && c.timeout > 0 ? { timeout: c.timeout } : {}),
|
|
32
35
|
}));
|
|
33
36
|
}
|
|
34
37
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.js","sourceRoot":"","sources":["../../src/tools/search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAElD,MAAM,cAAc,GAAG;IACrB,sBAAsB;IACtB,wBAAwB;IACxB,eAAe;CAChB,CAAA;AAED,MAAM,kBAAkB,GAAG,KAAK,CAAA;AAiBhC,kGAAkG;AAClG,MAAM,UAAU,kBAAkB,CAAC,KAAiB;IAClD,MAAM,MAAM,GAAG,CAAC,GAAW,EAAsB,EAAE,CACjD,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;IAEzC,MAAM,UAAU,GAAG,CAAC,GAAW,EAAc,EAAE,CAC7C,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAA;IAEtC,MAAM,cAAc,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,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GAAG,CAAC,CAAC,QAAQ,CAAC,6EAA6E,CAAC;YAClH,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,+DAA+D,CAAC;YACrH,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,4CAA4C,CAAC;YAC7G,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,6EAA6E,CAAC;YACrI,UAAU,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,kDAAkD,CAAC;YAC3G,OAAO,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,2DAA2D,CAAC;SACvH;KACF,EACD,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,YAAY,CAAC,IAAI,EAAE,IAAI,CAAC,CACzC,CAAA;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "402-mcp",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.10.0",
|
|
4
4
|
"description": "L402 + x402 client MCP - AI agents discover, pay for, and consume any payment-gated API",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
"build": "tsc",
|
|
20
20
|
"test": "vitest run",
|
|
21
21
|
"test:watch": "vitest",
|
|
22
|
+
"test:coverage": "vitest run --coverage",
|
|
22
23
|
"typecheck": "tsc --noEmit",
|
|
23
24
|
"start": "node build/index.js",
|
|
24
25
|
"start:http": "TRANSPORT=http node build/index.js",
|
|
@@ -46,6 +47,7 @@
|
|
|
46
47
|
"@types/express": "^5.0.0",
|
|
47
48
|
"@types/node": "^25.4.0",
|
|
48
49
|
"@types/qrcode": "^1.5.5",
|
|
50
|
+
"@vitest/coverage-v8": "^4.1.0",
|
|
49
51
|
"semantic-release": "^25.0.3",
|
|
50
52
|
"typescript": "^5.7.0",
|
|
51
53
|
"vitest": "^4.0.18"
|