@vapi-network/mcp 0.2.0-dev.2 → 0.2.1
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 +135 -10
- package/dist/index.d.ts +2 -1
- package/dist/index.js +7270 -1126
- package/dist/index.js.map +3 -3
- package/dist/server.d.ts +6 -4
- package/dist/siwx.d.ts +12 -0
- package/dist/tools/call.d.ts +6 -5
- package/dist/tools/inspect.d.ts +4 -1
- package/dist/tools/search.d.ts +1 -1
- package/dist/tools/wallet.d.ts +5 -2
- package/dist/x402.d.ts +3 -3
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -18,16 +18,25 @@ npm i -g vapi-network
|
|
|
18
18
|
vapi init # encrypted wallet + config under ~/.vapi (or $VAPI_HOME), prints the address
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
-
Fund that address with
|
|
21
|
+
Fund that address with `vapi fund` (card or Apple Pay via Coinbase Onramp) or by
|
|
22
|
+
sending USDC on Base to it. Then:
|
|
22
23
|
|
|
23
24
|
```bash
|
|
25
|
+
vapi fund # hosted onramp link, or direct-transfer instructions
|
|
24
26
|
vapi search "weather" # every catalog, merged, with provenance
|
|
25
27
|
vapi inspect <listing-ref> # request contract and the live 402 quote, before paying
|
|
26
28
|
vapi pay <listing-ref> --max 0.02
|
|
27
29
|
vapi balance
|
|
30
|
+
vapi accounts # balances plus network-specific deposit guidance
|
|
28
31
|
vapi receipts # one line per paid call: quote, settlement, latency
|
|
29
32
|
```
|
|
30
33
|
|
|
34
|
+
`vapi search` tags each listing with its group — `[vapi]`, `[added]`,
|
|
35
|
+
`[partner]`, or `[external]` — and prints the network fee already inside the
|
|
36
|
+
price: vAPI and added APIs carry a 5% network fee inside the quoted price, while
|
|
37
|
+
partner and external listings carry none. `vapi inspect` and `--json` return the
|
|
38
|
+
same `group` and `fee` fields.
|
|
39
|
+
|
|
31
40
|
No install? Prefix any command with `npx vapi-network`, for example `npx vapi-network init`.
|
|
32
41
|
(`npx vapi` cannot work: the bare `vapi` name on npm belongs to an unrelated package.)
|
|
33
42
|
|
|
@@ -47,8 +56,118 @@ Add this to Claude Desktop, Claude Code, or Cursor. The passphrase unlocks the l
|
|
|
47
56
|
}
|
|
48
57
|
```
|
|
49
58
|
|
|
50
|
-
Tools: `call.search`, `call.inspect`, `call.pay`, `wallet.address`, `wallet.balance`,
|
|
51
|
-
|
|
59
|
+
Tools: `call.search`, `call.inspect`, `call.pay`, `wallet.address`, `wallet.balance`,
|
|
60
|
+
`wallet.accounts`, `wallet.fund`, `receipts.list`, `receipts.stats`, `support.report`. Spend caps
|
|
61
|
+
default to $0.10 per call and $1.00 per day; the wallet checks both before it signs a payment.
|
|
62
|
+
|
|
63
|
+
## Sign-in with X
|
|
64
|
+
|
|
65
|
+
x402 v2 services can require Sign-In-With-X (SIWX) before returning a price. When `call.pay` or
|
|
66
|
+
`vapi pay` receives that challenge, vAPI checks that both the challenge domain and URI match the
|
|
67
|
+
final resource origin, signs the canonical EIP-4361 message locally with EVM `personal_sign`, and
|
|
68
|
+
retries once with `SIGN-IN-WITH-X`. The proof is never sent to a redirect or a different host.
|
|
69
|
+
|
|
70
|
+
If the retry returns a normal 402 quote, the usual spend-policy and payment flow continues. If the
|
|
71
|
+
resource is free after sign-in, the result has `outcome: "signed_in"` and the local receipt records
|
|
72
|
+
`amountAtomic: "0"`.
|
|
73
|
+
|
|
74
|
+
## Fund the wallet
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
vapi fund # ask the registry for a hosted onramp session
|
|
78
|
+
vapi fund --amount 25 # prefill a US dollar amount
|
|
79
|
+
vapi fund --json # stable machine-readable shape
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
`vapi fund` POSTs `{ address, network: "base", asset: "USDC", fiatAmount }` to
|
|
83
|
+
`<registry>/api/wallet/onramp-session` through the same guarded network client as
|
|
84
|
+
every other command, prints the returned URL, and opens it in your default
|
|
85
|
+
browser when you are on a terminal. The onramp is **Coinbase's**: Coinbase takes
|
|
86
|
+
the card or Apple Pay payment and sends USDC straight to your local address.
|
|
87
|
+
**vAPI never holds your funds**, never proxies the payment, and never sees your
|
|
88
|
+
card details or your private key.
|
|
89
|
+
|
|
90
|
+
When the registry replies `503 onramp_unavailable` — or cannot be reached at all
|
|
91
|
+
— the command stays useful instead of failing: it prints your address and
|
|
92
|
+
|
|
93
|
+
```text
|
|
94
|
+
Send USDC on Base (eip155:8453) to this address; add a little ETH for gas if you plan to sweep.
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Either way it finishes by printing the current balance. MCP clients can use the
|
|
98
|
+
`wallet.fund` tool, which returns the same `{ url }` or the same fallback text.
|
|
99
|
+
|
|
100
|
+
## Accounts and deposits
|
|
101
|
+
|
|
102
|
+
`vapi accounts` lists one deposit account for every configured network, including its CAIP-2 ID,
|
|
103
|
+
network name, address, atomic and formatted USDC balance, gas-token balance, and deposit guidance.
|
|
104
|
+
Use `--json` for the stable `{ "accounts": [...] }` shape. `vapi init` prints the same account list
|
|
105
|
+
after creating the encrypted keystore and configuration. MCP clients can use `wallet.accounts`.
|
|
106
|
+
|
|
107
|
+
Base uses the wallet's EVM address and tells you to send USDC on Base. For Arc testnet, add the
|
|
108
|
+
faucet URL or instructions to that network's `config.json` entry:
|
|
109
|
+
|
|
110
|
+
```json
|
|
111
|
+
{
|
|
112
|
+
"depositUrl": "https://your-arc-faucet.example",
|
|
113
|
+
"depositInstructions": "Use the configured Arc testnet faucet, then send USDC to this address."
|
|
114
|
+
}
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Account lookup dispatches by CAIP namespace: the EVM and Solana adapters use their corresponding
|
|
118
|
+
local address and guarded RPC balance calls without coupling one wallet family to the other.
|
|
119
|
+
|
|
120
|
+
## Reporting a bug
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
vapi report "the provider returned 402 twice"
|
|
124
|
+
vapi report "the provider returned 402 twice" --include-addresses
|
|
125
|
+
vapi report "the provider returned 402 twice" --send
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
The command first writes `$VAPI_HOME/reports/<timestamp>.json`, then prints that path and a prefilled
|
|
129
|
+
GitHub issue URL. Reports contain the message, client version, OS/Node information, and only the
|
|
130
|
+
newest five receipt IDs. Wallet and payee addresses are included only with `--include-addresses`;
|
|
131
|
+
amounts are never included. No report is uploaded unless `--send` is explicit. With `--send`, vAPI
|
|
132
|
+
uses the guarded network client to POST the same JSON to the configured registry and prints the HTTP
|
|
133
|
+
response code, including non-success responses such as 404. MCP clients can use `support.report`
|
|
134
|
+
with the corresponding `includeAddresses` and `send` booleans.
|
|
135
|
+
|
|
136
|
+
## Networks
|
|
137
|
+
|
|
138
|
+
| Network | x402 identifier | USDC | Gas / RPC notes |
|
|
139
|
+
| -------------- | ----------------------------------------------------- | ---------------------------------------------- | ------------------------------------------------------ |
|
|
140
|
+
| Base mainnet | `eip155:8453` | `0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913` | ETH; defaults to `https://mainnet.base.org` |
|
|
141
|
+
| Arc testnet | `eip155:5042002` | `0x3600000000000000000000000000000000000000` | USDC is also the gas token; set `ARC_TESTNET_RPC_URL` |
|
|
142
|
+
| Solana mainnet | `solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdpKuc147dw2N9d` | `EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v` | SOL; defaults to `https://api.mainnet-beta.solana.com` |
|
|
143
|
+
|
|
144
|
+
The x402 reference packages shorten the Solana CAIP-2 reference to
|
|
145
|
+
`solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp`; vAPI accepts that identifier as an
|
|
146
|
+
alias while persisting the full genesis hash above. Arc mainnet is not enabled:
|
|
147
|
+
**not yet — placeholder only.** Arc and the x402 packages do not publish a
|
|
148
|
+
mainnet RPC plus canonical USDC, so the client deliberately carries only a
|
|
149
|
+
non-routable code placeholder instead of guessing a production configuration.
|
|
150
|
+
|
|
151
|
+
Create both local accounts during initialization:
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
vapi init --networks base,solana
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
Or add an Ed25519 account to an existing encrypted keystore:
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
vapi accounts --enable solana
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
Fund the printed Solana address with SPL USDC. Exact x402 payments use the
|
|
164
|
+
facilitator advertised in the challenge as fee payer, so they do not consume the
|
|
165
|
+
local SOL balance. `vapi sweep <solana-address> --network
|
|
166
|
+
solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdpKuc147dw2N9d` is a separate transaction
|
|
167
|
+
and requires a small amount of SOL locally for fees and, when necessary,
|
|
168
|
+
creation of the destination token account. The default public Solana RPC is
|
|
169
|
+
rate-limited and has no availability guarantee; set `SOLANA_RPC_URL` to a
|
|
170
|
+
trusted dedicated endpoint for regular use.
|
|
52
171
|
|
|
53
172
|
## Discovery sources
|
|
54
173
|
|
|
@@ -60,7 +179,11 @@ provenance:
|
|
|
60
179
|
`https://api.vapinetwork.ai/api/call/discovery` for discovery and
|
|
61
180
|
`https://api.vapinetwork.ai/api/call/services` for service details. If the
|
|
62
181
|
primary returns HTTP 404 or cannot be resolved, the client logs one notice
|
|
63
|
-
and tries the configured fallback at `https://console.vapinetwork.ai
|
|
182
|
+
and tries the configured fallback at `https://console.vapinetwork.ai`, using
|
|
183
|
+
the same canonical paths. The registry's historical `/api/marketplace/discovery`
|
|
184
|
+
and `/api/network/services` paths still answer for one release and reply with
|
|
185
|
+
`Deprecation: true` plus a `Link` header naming the successor; a base URL
|
|
186
|
+
supplied on either of them is normalized to the canonical pair.
|
|
64
187
|
- **Coinbase Bazaar** reads the public x402 v2
|
|
65
188
|
`/discovery/resources` catalog exposed by a facilitator.
|
|
66
189
|
- **Local file** reads a JSON array of listings for private or development
|
|
@@ -110,6 +233,7 @@ config.json
|
|
|
110
233
|
keystore.json
|
|
111
234
|
receipts.jsonl
|
|
112
235
|
spend-ledger.json
|
|
236
|
+
reports/
|
|
113
237
|
```
|
|
114
238
|
|
|
115
239
|
Set `VAPI_HOME` to use a different directory. On first use of the default home,
|
|
@@ -167,7 +291,8 @@ pnpm build
|
|
|
167
291
|
pnpm pack:check
|
|
168
292
|
```
|
|
169
293
|
|
|
170
|
-
See [CONTRIBUTING.md](./CONTRIBUTING.md) for the development workflow
|
|
294
|
+
See [CONTRIBUTING.md](./CONTRIBUTING.md) for the development workflow,
|
|
295
|
+
[CHANGELOG.md](./CHANGELOG.md) for what shipped in each release, and
|
|
171
296
|
[SECURITY.md](./SECURITY.md) for private vulnerability reports.
|
|
172
297
|
|
|
173
298
|
CLI commands exit `0` on success, `1` on an operational failure, and `2` for
|
|
@@ -181,8 +306,7 @@ All five packages share one version and are published together. npm reads a
|
|
|
181
306
|
package manifest before lifecycle hooks run, so the release is made from the
|
|
182
307
|
generated `publish/` directories, never from the workspace package roots.
|
|
183
308
|
|
|
184
|
-
First update every package to the same version
|
|
185
|
-
`publishConfig.tag = "next"`, and verify the exact tarballs:
|
|
309
|
+
First update every package to the same version and verify the exact tarballs:
|
|
186
310
|
|
|
187
311
|
```sh
|
|
188
312
|
pnpm install --frozen-lockfile
|
|
@@ -202,9 +326,10 @@ pnpm --dir packages/vapi-network publish:npm
|
|
|
202
326
|
```
|
|
203
327
|
|
|
204
328
|
Each package's `publish:npm` script publishes its staged `./publish` directory
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
329
|
+
to the `latest` npm tag. Every package also has a `publish:npm:next` script that
|
|
330
|
+
publishes the same tarball to `next` instead, for preview builds. The manual
|
|
331
|
+
release workflow verifies and prints these commands; it never receives npm
|
|
332
|
+
credentials or publishes automatically.
|
|
208
333
|
|
|
209
334
|
## License
|
|
210
335
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { callService, createVapiServer, loadServerConfig, startStdioServer, type CallToolInput, type CallToolResult, type VapiServerOptions, } from "./server.js";
|
|
2
2
|
export { inspectService, type InspectToolInput, type InspectToolResult } from "./tools/inspect.js";
|
|
3
|
-
export { resolveServiceEndpoint, searchMarketplace, type MarketplaceSearchInput, } from "./tools/search.js";
|
|
3
|
+
export { resolveServiceEndpoint, resolveServiceListing, searchMarketplace, type MarketplaceSearchInput, } from "./tools/search.js";
|
|
4
4
|
export { getWallet, type WalletBalance } from "./tools/wallet.js";
|
|
5
|
+
export { buildSIWxProof, parseSIWxResponse } from "./siwx.js";
|