@dexterai/mcp 0.1.3 → 0.1.4
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 +153 -39
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,20 +1,31 @@
|
|
|
1
1
|
# @dexterai/mcp
|
|
2
2
|
|
|
3
|
-
x402 gateway for AI agents. Search, pay, and call any x402 API through Dexter.
|
|
3
|
+
x402 gateway for AI agents. Search, pay, and call any x402-protected API through Dexter — the world's most-used x402 facilitator.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Your agent gets four tools: discover paid APIs, check pricing, pay automatically, and manage its wallet. One package, every chain.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## Quick Start
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
10
|
npx @dexterai/mcp install
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
That's it. Pick your client, the installer writes the config. On first run a Solana wallet is created at `~/.dexterai-mcp/wallet.json`. Fund it with USDC and your agent can start paying for APIs.
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
## Supported Clients
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
| Client | Install |
|
|
18
|
+
|--------|---------|
|
|
19
|
+
| **Cursor** | `npx @dexterai/mcp install` or add to `~/.cursor/mcp.json` |
|
|
20
|
+
| **Claude Code** | `claude mcp add dexter-x402 -- npx -y @dexterai/mcp@latest` |
|
|
21
|
+
| **Codex** | `npx @dexterai/mcp install` or add to `~/.codex/config.toml` |
|
|
22
|
+
| **VS Code** | `npx @dexterai/mcp install` |
|
|
23
|
+
| **Windsurf** | `npx @dexterai/mcp install` |
|
|
24
|
+
| **Gemini CLI** | `npx @dexterai/mcp install` |
|
|
25
|
+
|
|
26
|
+
### Manual Config
|
|
27
|
+
|
|
28
|
+
**Cursor** — `~/.cursor/mcp.json`:
|
|
18
29
|
|
|
19
30
|
```json
|
|
20
31
|
{
|
|
@@ -27,13 +38,7 @@ Supports: **Cursor**, **Claude Code**, **Codex**, **VS Code**, **Windsurf**, **G
|
|
|
27
38
|
}
|
|
28
39
|
```
|
|
29
40
|
|
|
30
|
-
**
|
|
31
|
-
|
|
32
|
-
```bash
|
|
33
|
-
claude mcp add dexter-x402 -- npx -y @dexterai/mcp@latest
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
**Codex** — add to `~/.codex/config.toml`:
|
|
41
|
+
**Codex** — `~/.codex/config.toml`:
|
|
37
42
|
|
|
38
43
|
```toml
|
|
39
44
|
[mcp_servers.dexter-x402]
|
|
@@ -41,42 +46,105 @@ command = "npx"
|
|
|
41
46
|
args = ["-y", "@dexterai/mcp@latest"]
|
|
42
47
|
```
|
|
43
48
|
|
|
44
|
-
##
|
|
49
|
+
## Tools
|
|
50
|
+
|
|
51
|
+
### `x402_search`
|
|
52
|
+
|
|
53
|
+
Search the Dexter marketplace for paid API resources. Returns pricing, quality scores, verification status, and call volume.
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
Agent: "Find me an image generation API"
|
|
57
|
+
→ x402_search("image generation")
|
|
58
|
+
→ Image Model - Seedream-4.5 — $0.08/call — verified — 44 calls
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
**Parameters:**
|
|
45
62
|
|
|
46
|
-
|
|
63
|
+
| Param | Type | Description |
|
|
64
|
+
|-------|------|-------------|
|
|
65
|
+
| `query` | string | Search term |
|
|
66
|
+
| `category` | string | Filter: "AI", "DeFi", "Data", "Tools", etc. |
|
|
67
|
+
| `network` | string | Filter: "solana", "base", "polygon" |
|
|
68
|
+
| `maxPriceUsdc` | number | Max price per call |
|
|
69
|
+
| `verifiedOnly` | boolean | Only quality-checked endpoints |
|
|
70
|
+
| `sort` | string | "relevance", "quality_score", "settlements", "volume", "recent" |
|
|
71
|
+
| `limit` | number | Max results (1-50, default 20) |
|
|
47
72
|
|
|
48
|
-
###
|
|
73
|
+
### `x402_fetch`
|
|
74
|
+
|
|
75
|
+
Call any x402-protected API with automatic payment. Detects 402, signs the payment with your local wallet, and returns the API response.
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
Agent: "Get a Jupiter DEX quote for 1 SOL to USDC"
|
|
79
|
+
→ x402_fetch("https://x402.dexter.cash/api/jupiter/quote?inputMint=So11...&outputMint=EPjF...&amount=1000000000")
|
|
80
|
+
→ Pays $0.05 USDC, returns full quote with route plan
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Works with any x402 endpoint, not just Dexter's. We tested with third-party sellers (Xona Agent, Corbits, etc.) and payment goes through identically.
|
|
84
|
+
|
|
85
|
+
**Parameters:**
|
|
86
|
+
|
|
87
|
+
| Param | Type | Description |
|
|
88
|
+
|-------|------|-------------|
|
|
89
|
+
| `url` | string | The x402 resource URL |
|
|
90
|
+
| `method` | string | GET, POST, PUT, DELETE (default: GET) |
|
|
91
|
+
| `body` | string | JSON request body for POST/PUT |
|
|
92
|
+
|
|
93
|
+
**Response includes:**
|
|
94
|
+
|
|
95
|
+
```json
|
|
96
|
+
{
|
|
97
|
+
"status": 200,
|
|
98
|
+
"data": { "...API response..." },
|
|
99
|
+
"payment": {
|
|
100
|
+
"settled": true,
|
|
101
|
+
"details": {
|
|
102
|
+
"transaction": "Djo6aA9SXFx...",
|
|
103
|
+
"network": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
|
|
104
|
+
"payer": "2SB3VTnjrct9ayYCsQ4Fi5C5vNVpwL8X8RYUQoaPNZGh"
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
```
|
|
49
109
|
|
|
50
|
-
|
|
51
|
-
|------|-------------|
|
|
52
|
-
| `x402_search` | Search the Dexter marketplace for paid APIs |
|
|
53
|
-
| `x402_fetch` | Call any x402 API with automatic payment |
|
|
54
|
-
| `x402_check` | Preview endpoint pricing without paying |
|
|
55
|
-
| `x402_wallet` | Show wallet address and USDC balance |
|
|
110
|
+
### `x402_check`
|
|
56
111
|
|
|
57
|
-
|
|
112
|
+
Preview endpoint pricing without making a payment. Probes the URL and returns payment requirements.
|
|
58
113
|
|
|
59
114
|
```
|
|
60
|
-
Agent: "
|
|
61
|
-
→
|
|
62
|
-
→
|
|
115
|
+
Agent: "How much does this API cost?"
|
|
116
|
+
→ x402_check("https://x402.dexter.cash/api/v2-test", method: "POST")
|
|
117
|
+
→ $0.01 USDC on Solana, or $0.01 USDC on Base
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### `x402_wallet`
|
|
63
121
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
122
|
+
Show the wallet address, USDC balance, and deposit instructions.
|
|
123
|
+
|
|
124
|
+
```json
|
|
125
|
+
{
|
|
126
|
+
"address": "2SB3VTnjrct9ayYCsQ4Fi5C5vNVpwL8X8RYUQoaPNZGh",
|
|
127
|
+
"network": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
|
|
128
|
+
"balances": { "sol": 0, "usdc": 0.94 }
|
|
129
|
+
}
|
|
67
130
|
```
|
|
68
131
|
|
|
69
132
|
## CLI
|
|
70
133
|
|
|
134
|
+
Every tool is also available as a CLI command:
|
|
135
|
+
|
|
71
136
|
```bash
|
|
72
|
-
#
|
|
137
|
+
# Create wallet and show address + balance
|
|
73
138
|
npx @dexterai/mcp wallet
|
|
74
139
|
|
|
75
140
|
# Search the marketplace
|
|
76
141
|
npx @dexterai/mcp search "token analysis"
|
|
77
142
|
|
|
78
|
-
#
|
|
79
|
-
npx @dexterai/mcp fetch "https://x402.dexter.cash/api/jupiter/quote?inputMint=
|
|
143
|
+
# Pay for and call an x402 endpoint
|
|
144
|
+
npx @dexterai/mcp fetch "https://x402.dexter.cash/api/jupiter/quote?inputMint=So11111111111111111111111111111111111111112&outputMint=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v&amount=1000000000"
|
|
145
|
+
|
|
146
|
+
# POST with body
|
|
147
|
+
npx @dexterai/mcp fetch "https://api.xona-agent.com/image-model/seedream-4.5" --method POST --body '{"prompt":"a robot painting"}'
|
|
80
148
|
|
|
81
149
|
# Check pricing without paying
|
|
82
150
|
npx @dexterai/mcp fetch "https://x402.dexter.cash/api/v2-test" --method POST
|
|
@@ -84,21 +152,67 @@ npx @dexterai/mcp fetch "https://x402.dexter.cash/api/v2-test" --method POST
|
|
|
84
152
|
|
|
85
153
|
## Wallet
|
|
86
154
|
|
|
87
|
-
|
|
155
|
+
A standard Solana keypair stored at `~/.dexterai-mcp/wallet.json` with `600` permissions. The key never leaves your machine.
|
|
88
156
|
|
|
89
|
-
Override with environment variable
|
|
157
|
+
**Override with environment variable:**
|
|
90
158
|
|
|
91
159
|
```bash
|
|
92
160
|
export DEXTER_PRIVATE_KEY="your-base58-private-key"
|
|
93
161
|
```
|
|
94
162
|
|
|
95
|
-
|
|
163
|
+
Or use an existing key:
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
export SOLANA_PRIVATE_KEY="your-base58-private-key"
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
Both work. The env var takes priority over the wallet file.
|
|
170
|
+
|
|
171
|
+
## Chains
|
|
172
|
+
|
|
173
|
+
Supports Solana and EVM chains through the [`@dexterai/x402`](https://www.npmjs.com/package/@dexterai/x402) SDK:
|
|
174
|
+
|
|
175
|
+
| Chain | Network ID |
|
|
176
|
+
|-------|------------|
|
|
177
|
+
| Solana | `solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp` |
|
|
178
|
+
| Base | `eip155:8453` |
|
|
179
|
+
| Polygon | `eip155:137` |
|
|
180
|
+
| Arbitrum | `eip155:42161` |
|
|
181
|
+
| Optimism | `eip155:10` |
|
|
182
|
+
| Avalanche | `eip155:43114` |
|
|
183
|
+
| SKALE Europa | `eip155:2046399126` |
|
|
184
|
+
|
|
185
|
+
The MCP auto-detects which chain a 402 response requires and uses the appropriate signing method.
|
|
186
|
+
|
|
187
|
+
## How It Works
|
|
96
188
|
|
|
97
|
-
|
|
189
|
+
1. Your agent calls `x402_search` to find a paid API
|
|
190
|
+
2. Your agent calls `x402_fetch` with the URL
|
|
191
|
+
3. The MCP hits the endpoint, gets a 402 Payment Required response
|
|
192
|
+
4. The MCP reads the payment requirements (price, chain, recipient)
|
|
193
|
+
5. The MCP builds and signs a payment transaction using your local wallet
|
|
194
|
+
6. The MCP retries the request with the payment proof
|
|
195
|
+
7. The endpoint validates payment via the Dexter facilitator
|
|
196
|
+
8. Your agent gets the API response
|
|
197
|
+
|
|
198
|
+
All of this happens in one tool call. The agent never touches crypto.
|
|
199
|
+
|
|
200
|
+
## What is x402?
|
|
201
|
+
|
|
202
|
+
[x402](https://x402.org) is an open standard for machine-to-machine payments over HTTP. When an API returns `402 Payment Required`, it includes payment instructions. The client pays (usually USDC on Solana or Base), and the API delivers the response.
|
|
203
|
+
|
|
204
|
+
Dexter operates the most-used x402 facilitator, processing millions of settlements. This MCP package connects your AI agent to that infrastructure.
|
|
98
205
|
|
|
99
206
|
## Links
|
|
100
207
|
|
|
101
|
-
- **
|
|
102
|
-
- **
|
|
103
|
-
- **
|
|
208
|
+
- **Dexter:** [dexter.cash](https://dexter.cash)
|
|
209
|
+
- **Marketplace:** [dexter.cash/marketplace](https://dexter.cash/marketplace)
|
|
210
|
+
- **Facilitator:** [x402.dexter.cash](https://x402.dexter.cash)
|
|
211
|
+
- **SDK:** [@dexterai/x402](https://www.npmjs.com/package/@dexterai/x402)
|
|
212
|
+
- **x402 Protocol:** [x402.org](https://x402.org)
|
|
104
213
|
- **Twitter:** [@dexteraisol](https://twitter.com/dexteraisol)
|
|
214
|
+
- **Telegram:** [t.me/dexterdao](https://t.me/dexterdao)
|
|
215
|
+
|
|
216
|
+
## License
|
|
217
|
+
|
|
218
|
+
MIT
|