@1ly/mcp-server 0.1.1 → 0.1.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.
Files changed (71) hide show
  1. package/README.md +684 -166
  2. package/dist/config.d.ts +7 -0
  3. package/dist/config.d.ts.map +1 -1
  4. package/dist/config.js +19 -3
  5. package/dist/config.js.map +1 -1
  6. package/dist/index.js +38 -2
  7. package/dist/index.js.map +1 -1
  8. package/dist/keys.d.ts +13 -0
  9. package/dist/keys.d.ts.map +1 -0
  10. package/dist/keys.js +52 -0
  11. package/dist/keys.js.map +1 -0
  12. package/dist/selftest.d.ts.map +1 -1
  13. package/dist/selftest.js +14 -9
  14. package/dist/selftest.js.map +1 -1
  15. package/dist/tools/call.d.ts.map +1 -1
  16. package/dist/tools/call.js +48 -16
  17. package/dist/tools/call.js.map +1 -1
  18. package/dist/tools/create-key.d.ts +21 -0
  19. package/dist/tools/create-key.d.ts.map +1 -0
  20. package/dist/tools/create-key.js +38 -0
  21. package/dist/tools/create-key.js.map +1 -0
  22. package/dist/tools/create-link.d.ts +4 -0
  23. package/dist/tools/create-link.d.ts.map +1 -1
  24. package/dist/tools/create-link.js +3 -0
  25. package/dist/tools/create-link.js.map +1 -1
  26. package/dist/tools/create-store.d.ts +27 -0
  27. package/dist/tools/create-store.d.ts.map +1 -0
  28. package/dist/tools/create-store.js +99 -0
  29. package/dist/tools/create-store.js.map +1 -0
  30. package/dist/tools/list-keys.d.ts +17 -0
  31. package/dist/tools/list-keys.d.ts.map +1 -0
  32. package/dist/tools/list-keys.js +29 -0
  33. package/dist/tools/list-keys.js.map +1 -0
  34. package/dist/tools/list-withdrawals.d.ts +26 -0
  35. package/dist/tools/list-withdrawals.d.ts.map +1 -0
  36. package/dist/tools/list-withdrawals.js +43 -0
  37. package/dist/tools/list-withdrawals.js.map +1 -0
  38. package/dist/tools/review.d.ts.map +1 -1
  39. package/dist/tools/review.js +45 -20
  40. package/dist/tools/review.js.map +1 -1
  41. package/dist/tools/revoke-key.d.ts +22 -0
  42. package/dist/tools/revoke-key.d.ts.map +1 -0
  43. package/dist/tools/revoke-key.js +37 -0
  44. package/dist/tools/revoke-key.js.map +1 -0
  45. package/dist/tools/update-avatar.d.ts +34 -0
  46. package/dist/tools/update-avatar.d.ts.map +1 -0
  47. package/dist/tools/update-avatar.js +63 -0
  48. package/dist/tools/update-avatar.js.map +1 -0
  49. package/dist/tools/update-link.d.ts +3 -0
  50. package/dist/tools/update-link.d.ts.map +1 -1
  51. package/dist/tools/update-link.js +3 -0
  52. package/dist/tools/update-link.js.map +1 -1
  53. package/dist/tools/update-profile.d.ts +30 -0
  54. package/dist/tools/update-profile.d.ts.map +1 -0
  55. package/dist/tools/update-profile.js +42 -0
  56. package/dist/tools/update-profile.js.map +1 -0
  57. package/dist/tools/update-socials.d.ts +41 -0
  58. package/dist/tools/update-socials.d.ts.map +1 -0
  59. package/dist/tools/update-socials.js +85 -0
  60. package/dist/tools/update-socials.js.map +1 -0
  61. package/dist/tools/withdraw.d.ts +27 -0
  62. package/dist/tools/withdraw.d.ts.map +1 -0
  63. package/dist/tools/withdraw.js +45 -0
  64. package/dist/tools/withdraw.js.map +1 -0
  65. package/dist/wallet/evm.d.ts.map +1 -1
  66. package/dist/wallet/evm.js +4 -4
  67. package/dist/wallet/evm.js.map +1 -1
  68. package/dist/wallet/solana.d.ts.map +1 -1
  69. package/dist/wallet/solana.js +2 -1
  70. package/dist/wallet/solana.js.map +1 -1
  71. package/package.json +1 -1
package/README.md CHANGED
@@ -1,75 +1,74 @@
1
1
  # @1ly/mcp-server
2
2
 
3
- MCP server for [1ly.store](https://1ly.store) — Discover and pay for APIs with AI agents.
3
+ MCP server for [1ly.store](https://1ly.store) — Enable AI agents to discover, pay for, and sell APIs using crypto.
4
4
 
5
- ## What is this?
5
+ ## Overview
6
6
 
7
- This MCP server enables AI agents (Claude, GPT, Cursor, etc.) to:
7
+ This MCP server gives AI agents the ability to:
8
8
 
9
- 1. **Search** for APIs and services on 1ly.store
10
- 2. **Get details** about pricing, reviews, and usage
11
- 3. **Call APIs** with automatic crypto payments (x402 protocol)
12
- 4. **Leave reviews** after purchases
13
- 5. **Create and manage API links** (Developer Mode + API key)
9
+ - **Buy** — Search, discover, and pay for APIs, resources with automatic crypto payments (x402 protocol)
10
+ - **Sell** Create a store, list paid API endpoints or resources, and accept payments
14
11
 
15
- ## Quick Start (1 minute)
12
+ **Supported Networks:** Solana (mainnet), Base (mainnet)
13
+ **Payment Currency:** USDC
16
14
 
17
- Pick **one** of the following and paste it into your terminal.
15
+ ## What is this?
16
+ This MCP server enables AI agents (Claude, GPT, Cursor, or any AI Agents etc.) to:
18
17
 
19
- ### Solana (mainnet)
18
+ Create store on 1ly.store
19
+ Accept payments for your own APIs/resources using 1ly as the payment layer
20
+ Create paid links that any x402‑compatible agent can call and pay automatically
21
+ Paid links are listed on the 1ly marketplace by default for instant agent discovery
22
+ Search for APIs and services on 1ly.store
23
+ Get details about pricing, reviews, and usage
24
+ Call paid APIs with automatic crypto payments (x402 protocol) in secure way.
25
+ Leave reviews after purchases, optional but recommended to make better experience for 1ly users
20
26
 
21
- ```bash
22
- ONELY_WALLET_TYPE=solana \
23
- ONELY_WALLET_KEY="$HOME/1ly-agent-wallet.json" \
24
- npx @1ly/mcp-server
25
- ```
27
+ ---
28
+
29
+ ## Quick Start
26
30
 
27
- ### Base (mainnet)
31
+ ### 1. Install and Run
28
32
 
29
33
  ```bash
30
- ONELY_WALLET_TYPE=evm \
31
- ONELY_WALLET_KEY="$HOME/.1ly-base-private-key" \
32
- npx @1ly/mcp-server
33
- ```
34
+ # Solana wallet
35
+ ONELY_WALLET_SOLANA_KEY="/path/to/solana-wallet.json" npx @1ly/mcp-server
34
36
 
35
- Optional safety limits:
37
+ # OR Base/EVM wallet
38
+ ONELY_WALLET_EVM_KEY="/path/to/evm.key" npx @1ly/mcp-server
36
39
 
37
- ```bash
38
- ONELY_BUDGET_PER_CALL=1.00
39
- ONELY_BUDGET_DAILY=50.00
40
+ # OR both wallets
41
+ ONELY_WALLET_SOLANA_KEY="/path/to/solana-wallet.json" \
42
+ ONELY_WALLET_EVM_KEY="/path/to/evm.key" \
43
+ npx @1ly/mcp-server
40
44
  ```
41
45
 
42
- ### Developer Mode (create/manage API links)
46
+ ### 2. Verify Setup
43
47
 
44
48
  ```bash
45
- ONELY_API_KEY="1ly_live_..." \
46
- npx @1ly/mcp-server
49
+ ONELY_WALLET_SOLANA_KEY="/path/to/solana-wallet.json" npx @1ly/mcp-server --self-test
47
50
  ```
48
51
 
49
- ## Get an API Key (Developer Mode)
50
-
51
- 1. Sign in to 1ly store: `https://1ly.store`
52
- 2. Open **Settings** (profile dropdown → Settings)
53
- 3. Enable **Developer Mode**
54
- 4. Open **Developer Settings** and click **Create API Key**
55
- 5. Copy the key (shown once)
52
+ ---
56
53
 
57
- Keys look like:
58
- ```
59
- 1ly_live_xxxxxxxx...
60
- ```
54
+ ## Configuration
61
55
 
62
- ## How API keys are used
56
+ ### Environment Variables
63
57
 
64
- - **For MCP tools**: set `ONELY_API_KEY` in your MCP config or environment.
65
- The MCP server attaches it as `Authorization: Bearer <key>` automatically.
66
- - **For direct API calls**: include the header yourself:
58
+ | Variable | Required | Description |
59
+ |----------|----------|-------------|
60
+ | `ONELY_WALLET_SOLANA_KEY` | Yes* | Path to Solana keypair JSON file, or inline JSON array |
61
+ | `ONELY_WALLET_EVM_KEY` | Yes* | Path to EVM private key file, or inline hex key (with or without `0x`) |
62
+ | `ONELY_API_KEY` | No | API key for seller tools. Auto-loaded after `1ly_create_store` |
63
+ | `ONELY_BUDGET_PER_CALL` | No | Max USD per API call (default: `1.00`) |
64
+ | `ONELY_BUDGET_DAILY` | No | Daily USD spending limit (default: `50.00`) |
65
+ | `ONELY_BUDGET_STATE_FILE` | No | Path to local budget state file (default: `~/.1ly-mcp-budget.json`) |
66
+ | `ONELY_NETWORK` | No | Preferred network: `solana` or `base` (default: `solana`) |
67
+ | `ONELY_API_BASE` | No | API base URL (default: `https://1ly.store`) |
67
68
 
68
- ```http
69
- Authorization: Bearer 1ly_live_...
70
- ```
69
+ *At least one wallet is required for payments.
71
70
 
72
- ## Install (Claude Desktop)
71
+ ### Claude Desktop Configuration
73
72
 
74
73
  Add to `claude_desktop_config.json`:
75
74
 
@@ -80,8 +79,7 @@ Add to `claude_desktop_config.json`:
80
79
  "command": "npx",
81
80
  "args": ["@1ly/mcp-server"],
82
81
  "env": {
83
- "ONELY_WALLET_TYPE": "solana",
84
- "ONELY_WALLET_KEY": "/path/to/solana-wallet.json",
82
+ "ONELY_WALLET_SOLANA_KEY": "/absolute/path/to/solana-wallet.json",
85
83
  "ONELY_BUDGET_PER_CALL": "1.00",
86
84
  "ONELY_BUDGET_DAILY": "50.00"
87
85
  }
@@ -90,7 +88,8 @@ Add to `claude_desktop_config.json`:
90
88
  }
91
89
  ```
92
90
 
93
- ### Developer Mode (API key only)
91
+ <details>
92
+ <summary>Base/EVM wallet configuration</summary>
94
93
 
95
94
  ```json
96
95
  {
@@ -99,25 +98,28 @@ Add to `claude_desktop_config.json`:
99
98
  "command": "npx",
100
99
  "args": ["@1ly/mcp-server"],
101
100
  "env": {
102
- "ONELY_API_KEY": "1ly_live_..."
101
+ "ONELY_WALLET_EVM_KEY": "/absolute/path/to/evm.key",
102
+ "ONELY_BUDGET_PER_CALL": "1.00",
103
+ "ONELY_BUDGET_DAILY": "50.00"
103
104
  }
104
105
  }
105
106
  }
106
107
  }
107
108
  ```
109
+ </details>
108
110
 
109
- ## Install (Cursor)
110
-
111
- Add to `.cursor/mcp.json`:
111
+ <details>
112
+ <summary>Both Solana + Base wallets</summary>
112
113
 
113
114
  ```json
114
115
  {
115
- "servers": {
116
+ "mcpServers": {
116
117
  "1ly": {
117
- "command": "npx @1ly/mcp-server",
118
+ "command": "npx",
119
+ "args": ["@1ly/mcp-server"],
118
120
  "env": {
119
- "ONELY_WALLET_TYPE": "solana",
120
- "ONELY_WALLET_KEY": "/path/to/solana-wallet.json",
121
+ "ONELY_WALLET_SOLANA_KEY": "/absolute/path/to/solana-wallet.json",
122
+ "ONELY_WALLET_EVM_KEY": "/absolute/path/to/evm.key",
121
123
  "ONELY_BUDGET_PER_CALL": "1.00",
122
124
  "ONELY_BUDGET_DAILY": "50.00"
123
125
  }
@@ -125,199 +127,715 @@ Add to `.cursor/mcp.json`:
125
127
  }
126
128
  }
127
129
  ```
130
+ </details>
131
+
132
+ ---
133
+
134
+ ## Tools Reference
128
135
 
129
- ### Developer Mode (API key only)
136
+ ### Buyer Tools (Pay for APIs)
137
+
138
+ These tools require a **wallet** configured.
139
+
140
+ #### `1ly_search`
141
+
142
+ Search for APIs on 1ly.store marketplace.
143
+
144
+ | Parameter | Type | Required | Description |
145
+ |-----------|------|----------|-------------|
146
+ | `query` | string | **Yes** | Search term (e.g., "weather api") |
147
+ | `type` | string | No | Filter: `"api"` or `"standard"` |
148
+ | `maxPrice` | number | No | Maximum price in USD |
149
+ | `minPrice` | number | No | Minimum price in USD |
150
+ | `limit` | number | No | Results to return (default: 10, max: 50) |
130
151
 
131
152
  ```json
132
153
  {
133
- "servers": {
134
- "1ly": {
135
- "command": "npx @1ly/mcp-server",
136
- "env": {
137
- "ONELY_API_KEY": "1ly_live_..."
154
+ "query": "weather api",
155
+ "type": "api",
156
+ "maxPrice": 0.10
157
+ }
158
+ ```
159
+
160
+ **Returns:**
161
+ ```json
162
+ {
163
+ "ok": true,
164
+ "data": {
165
+ "results": [
166
+ {
167
+ "title": "Real-time Weather",
168
+ "endpoint": "/api/link/joe/weather",
169
+ "price": "$0.010000000000000000 USDC",
170
+ "type": "api",
171
+ "seller": "Joe's APIs",
172
+ "stats": { "buyers": 150, "rating": "95%" }
138
173
  }
174
+ ],
175
+ "total": 42,
176
+ "showing": 10
177
+ }
178
+ }
179
+ ```
180
+
181
+ ---
182
+
183
+ #### `1ly_get_details`
184
+
185
+ Get detailed information about a specific API.
186
+
187
+ | Parameter | Type | Required | Description |
188
+ |-----------|------|----------|-------------|
189
+ | `endpoint` | string | **Yes** | API endpoint (e.g., `"joe/weather"`) |
190
+
191
+ ```json
192
+ {
193
+ "endpoint": "joe/weather"
194
+ }
195
+ ```
196
+
197
+ **Returns (example):**
198
+ ```json
199
+ {
200
+ "ok": true,
201
+ "data": {
202
+ "endpoint": "/api/link/joe/weather",
203
+ "fullUrl": "https://1ly.store/api/link/joe/weather",
204
+ "link": {
205
+ "title": "Real-time Weather",
206
+ "description": "Global weather data",
207
+ "slug": "weather",
208
+ "price": "0.010000000000000000",
209
+ "currency": "USDC"
210
+ },
211
+ "paymentInfo": { "networks": ["solana", "base"] },
212
+ "reviews": {
213
+ "stats": { "total": 50, "positive": 48 },
214
+ "recent": [{ "positive": true, "comment": "Fast!" }]
139
215
  }
140
216
  }
141
217
  }
142
218
  ```
143
219
 
144
- ## Verify it works (recommended)
220
+ ---
145
221
 
146
- Run a quick self-test:
222
+ #### `1ly_call`
147
223
 
148
- ```bash
149
- ONELY_WALLET_TYPE=solana \
150
- ONELY_WALLET_KEY="$HOME/1ly-agent-wallet.json" \
151
- npx @1ly/mcp-server --self-test
224
+ Call a paid API with automatic crypto payment.
225
+
226
+ | Parameter | Type | Required | Description |
227
+ |-----------|------|----------|-------------|
228
+ | `endpoint` | string | **Yes** | API endpoint (e.g., `"joe/weather"`) |
229
+ | `method` | string | No | HTTP method: `GET`, `POST`, `PUT`, `DELETE`, `PATCH` (default: `GET`) |
230
+ | `body` | object | No | Request body for POST/PUT/PATCH |
231
+ | `headers` | object | No | Additional headers |
232
+
233
+ ```json
234
+ {
235
+ "endpoint": "joe/weather",
236
+ "method": "POST",
237
+ "body": { "city": "NYC" }
238
+ }
152
239
  ```
153
240
 
154
- ## What agents can do
241
+ **Returns (example):**
242
+ ```json
243
+ {
244
+ "ok": true,
245
+ "data": {
246
+ "data": {
247
+ "temp": 72,
248
+ "conditions": "sunny"
249
+ },
250
+ "_1ly": {
251
+ "purchaseId": "abc123",
252
+ "txHash": "tx_hash_here",
253
+ "reviewUrl": "https://1ly.store/api/review/abc123",
254
+ "reviewToken": "xyz789"
255
+ }
256
+ }
257
+ }
258
+ ```
155
259
 
156
- Typical flow:
260
+ > **Note:** The `_1ly` object contains tokens needed for `1ly_review`. Save these if you want to leave a review.
261
+ > For free APIs, `_1ly` may be `{ "note": "No payment required (free API)" }`.
157
262
 
158
- 1. `1ly_search` → find an API
159
- 2. `1ly_get_details` → confirm price + supported networks
160
- 3. `1ly_call` → auto‑pay with x402 v2 and return the API response
161
- 4. `1ly_review` → optional review using the `_1ly` metadata
162
- 5. `1ly_create_link` → create a paid or free API link (Developer Mode)
263
+ ---
163
264
 
164
- ## Tools
265
+ #### `1ly_review`
165
266
 
166
- ### `1ly_search`
267
+ Leave a review after a successful purchase.
167
268
 
168
- Search for APIs by keyword.
269
+ | Parameter | Type | Required | Description |
270
+ |-----------|------|----------|-------------|
271
+ | `purchaseId` | string | **Yes** | From `_1ly.purchaseId` in `1ly_call` response |
272
+ | `reviewToken` | string | **Yes** | From `_1ly.reviewToken` in `1ly_call` response |
273
+ | `positive` | boolean | **Yes** | `true` for positive, `false` for negative |
274
+ | `comment` | string | No | Review comment (max 500 chars) |
169
275
 
170
- ```typescript
171
- // Input
172
- { query: "weather api", type: "api", maxPrice: 0.10 }
276
+ ```json
277
+ {
278
+ "purchaseId": "abc123",
279
+ "reviewToken": "xyz789",
280
+ "positive": true,
281
+ "comment": "Fast and accurate!"
282
+ }
283
+ ```
284
+
285
+ **Returns:**
286
+ ```json
287
+ {
288
+ "ok": true,
289
+ "data": {
290
+ "success": true,
291
+ "reviewId": "rev_456",
292
+ "message": "Positive review submitted!"
293
+ }
294
+ }
295
+ ```
296
+
297
+ ---
298
+
299
+ ### Seller Tools (Accept Payments)
300
+
301
+ These tools require an **API key**. Run `1ly_create_store` first to get one.
302
+
303
+ #### `1ly_create_store`
304
+
305
+ Create a new store and get an API key. **Run this once.** The API key is automatically saved locally.
306
+
307
+ | Parameter | Type | Required | Description |
308
+ |-----------|------|----------|-------------|
309
+ | `username` | string | No | Store username (3-20 chars, auto-generated if omitted) |
310
+ | `displayName` | string | No | Display name (max 50 chars) |
311
+ | `avatarUrl` | string | No | Avatar URL |
312
+
313
+ ```json
314
+ {
315
+ "username": "myagent",
316
+ "displayName": "My Agent Store"
317
+ }
318
+ ```
173
319
 
174
- // Output
320
+ **Returns (example):**
321
+ ```json
175
322
  {
176
- results: [
177
- {
178
- title: "Real-time Weather",
179
- endpoint: "/api/link/joe/weather",
180
- price: 0.01,
181
- stats: { buyers: 150, rating: 95 }
323
+ "ok": true,
324
+ "data": {
325
+ "success": true,
326
+ "data": {
327
+ "store": {
328
+ "username": "myagent",
329
+ "displayName": "My Agent Store",
330
+ "storeUrl": "https://1ly.store/myagent",
331
+ "createdBy": "agent",
332
+ "avatarUrl": null
333
+ },
334
+ "apiKey": "1ly_live_...",
335
+ "apiKeyPrefix": "1ly_live_..."
336
+ },
337
+ "meta": {
338
+ "savedKeyPath": "~/Library/Application Support/1ly/onely_api_key.json"
182
339
  }
183
- ]
340
+ }
341
+ }
342
+ ```
343
+
344
+ > **API Key Storage:**
345
+ > - macOS: `~/Library/Application Support/1ly/onely_api_key.json`
346
+ > - Linux: `~/.config/1ly/onely_api_key.json`
347
+ > - Windows: `%APPDATA%\1ly\onely_api_key.json`
348
+
349
+ ---
350
+
351
+ #### `1ly_create_link`
352
+
353
+ Create a new API link (paid or free).
354
+
355
+ | Parameter | Type | Required | Description |
356
+ |-----------|------|----------|-------------|
357
+ | `title` | string | **Yes** | Link title (max 200 chars) |
358
+ | `url` | string | **Yes** | Target URL (your API endpoint) |
359
+ | `price` | string | No | Price in USD (e.g., `"0.10"`). Omit for free |
360
+ | `description` | string | No | Description (max 500 chars) |
361
+ | `slug` | string | No | Custom slug (3-64 chars, lowercase, hyphens allowed) |
362
+ | `currency` | string | No | Always `"USDC"` |
363
+ | `isPublic` | boolean | No | List publicly (default: `true`) |
364
+ | `isStealth` | boolean | No | Hide from search (default: `false`) |
365
+ | `webhookUrl` | string | No | Optional webhook URL for purchase events |
366
+
367
+ ```json
368
+ {
369
+ "title": "Premium Weather API",
370
+ "url": "https://api.example.com/weather",
371
+ "price": "0.05",
372
+ "description": "Real-time weather data",
373
+ "webhookUrl": "https://example.com/webhooks/1ly"
374
+ }
375
+ ```
376
+
377
+ **Returns (example):**
378
+ ```json
379
+ {
380
+ "ok": true,
381
+ "data": {
382
+ "success": true,
383
+ "data": {
384
+ "id": "uuid-here",
385
+ "slug": "premium-weather-api",
386
+ "fullUrl": "https://1ly.store/myagent/premium-weather-api",
387
+ "privateSlug": null,
388
+ "privateUrl": null,
389
+ "price": "0.050000000000000000",
390
+ "currency": "USDC",
391
+ "linkType": "api",
392
+ "createdAt": "2026-01-01T00:00:00.000Z"
393
+ }
394
+ }
395
+ }
396
+ ```
397
+
398
+ ---
399
+
400
+ #### `1ly_list_links`
401
+
402
+ List all your API links.
403
+
404
+ *No parameters.*
405
+
406
+ ```json
407
+ {}
408
+ ```
409
+
410
+ **Returns (example):**
411
+ ```json
412
+ {
413
+ "ok": true,
414
+ "data": {
415
+ "success": true,
416
+ "data": {
417
+ "links": [
418
+ {
419
+ "id": "uuid-here",
420
+ "url": "https://api.example.com/weather",
421
+ "title": "Premium Weather API",
422
+ "description": "Real-time weather data",
423
+ "slug": "premium-weather-api",
424
+ "privateSlug": null,
425
+ "price": "0.050000000000000000",
426
+ "currency": "USDC",
427
+ "isPaid": true,
428
+ "isPublic": true,
429
+ "isActive": true,
430
+ "linkType": "api",
431
+ "isStealth": false,
432
+ "createdAt": "2026-01-01T00:00:00.000Z",
433
+ "updatedAt": "2026-01-01T00:00:00.000Z"
434
+ }
435
+ ]
436
+ }
437
+ }
438
+ }
439
+ ```
440
+
441
+ ---
442
+
443
+ #### `1ly_update_link`
444
+
445
+ Update an existing API link.
446
+
447
+ | Parameter | Type | Required | Description |
448
+ |-----------|------|----------|-------------|
449
+ | `id` | string (UUID) | **Yes** | Link ID |
450
+ | `title` | string | No | New title |
451
+ | `url` | string | No | New target URL |
452
+ | `price` | string | No | New price |
453
+ | `description` | string | No | New description |
454
+ | `slug` | string | No | New slug |
455
+ | `isPublic` | boolean | No | Update visibility |
456
+ | `isStealth` | boolean | No | Update stealth mode |
457
+ | `webhookUrl` | string | No | Update webhook URL (set to `null` to clear) |
458
+
459
+ ```json
460
+ {
461
+ "id": "uuid-here",
462
+ "price": "0.10"
463
+ }
464
+ ```
465
+
466
+ **Returns (example):**
467
+ ```json
468
+ {
469
+ "ok": true,
470
+ "data": {
471
+ "success": true,
472
+ "data": {
473
+ "id": "uuid-here",
474
+ "profileId": "profile-id",
475
+ "url": "https://api.example.com/weather",
476
+ "title": "Premium Weather API (updated)",
477
+ "description": "Real-time weather data",
478
+ "slug": "premium-weather-api",
479
+ "privateSlug": null,
480
+ "price": "0.100000000000000000",
481
+ "currency": "USDC",
482
+ "isPaid": true,
483
+ "isPublic": true,
484
+ "isActive": true,
485
+ "linkType": "api",
486
+ "isStealth": false,
487
+ "displayOrder": 1,
488
+ "createdAt": "2026-01-01T00:00:00.000Z",
489
+ "updatedAt": "2026-01-01T00:00:00.000Z"
490
+ }
491
+ }
492
+ }
493
+ ```
494
+
495
+ ---
496
+
497
+ #### `1ly_delete_link`
498
+
499
+ Delete an API link.
500
+
501
+ | Parameter | Type | Required | Description |
502
+ |-----------|------|----------|-------------|
503
+ | `id` | string (UUID) | **Yes** | Link ID to delete |
504
+
505
+ ```json
506
+ {
507
+ "id": "uuid-here"
508
+ }
509
+ ```
510
+
511
+ **Returns (example):**
512
+ ```json
513
+ {
514
+ "ok": true,
515
+ "data": {
516
+ "success": true
517
+ }
184
518
  }
185
519
  ```
186
520
 
187
- ### `1ly_get_details`
521
+ ---
522
+
523
+ #### `1ly_get_stats`
188
524
 
189
- Get full details about an API.
525
+ Get store or link statistics.
190
526
 
191
- ```typescript
192
- // Input
193
- { endpoint: "joe/weather" }
527
+ | Parameter | Type | Required | Description |
528
+ |-----------|------|----------|-------------|
529
+ | `period` | string | No | Time period: `"7d"`, `"30d"`, `"90d"`, `"all"` |
530
+ | `linkId` | string (UUID) | No | Specific link ID (omit for store-wide stats) |
531
+
532
+ ```json
533
+ {
534
+ "period": "30d"
535
+ }
536
+ ```
194
537
 
195
- // Output
538
+ **Returns (example):**
539
+ ```json
196
540
  {
197
- title: "Real-time Weather",
198
- description: "Global weather data with forecasts",
199
- price: 0.01,
200
- reviews: [...],
201
- paymentInfo: { networks: ["solana", "base"] }
541
+ "ok": true,
542
+ "data": {
543
+ "success": true,
544
+ "data": {
545
+ "period": "30d",
546
+ "views": 0,
547
+ "buyers": 9,
548
+ "revenue": "0.081000000000000009"
549
+ }
550
+ }
202
551
  }
203
552
  ```
204
553
 
205
- ### `1ly_call`
554
+ ---
206
555
 
207
- Call an API with automatic payment.
556
+ #### `1ly_list_keys`
208
557
 
209
- ```typescript
210
- // Input
211
- { endpoint: "joe/weather", body: { city: "NYC" } }
558
+ List all API keys for your store.
212
559
 
213
- // Output
560
+ *No parameters.*
561
+
562
+ **Returns (example):**
563
+ ```json
214
564
  {
215
- data: { temp: 72, conditions: "sunny" },
216
- _1ly: { purchaseId: "...", reviewToken: "..." }
565
+ "ok": true,
566
+ "data": {
567
+ "success": true,
568
+ "data": {
569
+ "keys": [
570
+ {
571
+ "id": "uuid-here",
572
+ "name": "Agent Key",
573
+ "keyPrefix": "1ly_live_...",
574
+ "isActive": true,
575
+ "lastUsedAt": "2026-01-01T00:00:00.000Z",
576
+ "createdAt": "2026-01-01T00:00:00.000Z"
577
+ }
578
+ ]
579
+ }
580
+ }
217
581
  }
218
582
  ```
219
583
 
220
- ### `1ly_review`
584
+ ---
585
+
586
+ #### `1ly_create_key`
587
+
588
+ Create a new API key.
221
589
 
222
- Leave a review after purchase.
590
+ | Parameter | Type | Required | Description |
591
+ |-----------|------|----------|-------------|
592
+ | `name` | string | No | Key name (max 64 chars) |
223
593
 
224
- ```typescript
225
- // Input
226
- { purchaseId: "...", reviewToken: "...", positive: true, comment: "Fast and accurate!" }
594
+ ```json
595
+ {
596
+ "name": "production-key"
597
+ }
598
+ ```
227
599
 
228
- // Output
229
- { success: true, reviewId: "..." }
600
+ **Returns (example when key limit is reached):**
601
+ ```json
602
+ {
603
+ "ok": false,
604
+ "error": {
605
+ "message": "Create key failed | status=400 | ... | body={\"success\":false,\"error\":{\"code\":\"LIMIT_REACHED\",\"message\":\"Maximum number of API keys reached\"}}"
606
+ }
607
+ }
230
608
  ```
231
609
 
232
- ### `1ly_create_link`
610
+ ---
233
611
 
234
- Create an API link (paid or free). Requires `ONELY_API_KEY`.
612
+ #### `1ly_revoke_key`
613
+
614
+ Revoke an API key.
615
+
616
+ | Parameter | Type | Required | Description |
617
+ |-----------|------|----------|-------------|
618
+ | `id` | string (UUID) | **Yes** | Key ID to revoke |
619
+
620
+ ```json
621
+ {
622
+ "id": "uuid-here"
623
+ }
624
+ ```
235
625
 
236
- ```typescript
237
- // Input
626
+ **Returns (example):**
627
+ ```json
238
628
  {
239
- title: "Premium Trading Signals",
240
- url: "https://example.com/signals",
241
- price: "10.00",
242
- description: "Daily crypto signals"
629
+ "ok": true,
630
+ "data": {
631
+ "success": true,
632
+ "data": {
633
+ "id": "uuid-here",
634
+ "revoked": true
635
+ }
636
+ }
243
637
  }
244
638
  ```
245
639
 
246
- ### `1ly_list_links`
640
+ ---
247
641
 
248
- List API links for the store. Requires `ONELY_API_KEY`.
642
+ #### `1ly_update_profile`
249
643
 
250
- ### `1ly_update_link`
644
+ Update basic profile fields.
251
645
 
252
- Update an API link by id. Requires `ONELY_API_KEY`.
646
+ | Parameter | Type | Required | Description |
647
+ |-----------|------|----------|-------------|
648
+ | `username` | string | No | New username (lowercase + underscores) |
649
+ | `displayName` | string | No | Public display name |
650
+ | `bio` | string | No | Short bio (max 160 chars) |
253
651
 
254
- ### `1ly_delete_link`
652
+ ```json
653
+ {
654
+ "displayName": "My Store",
655
+ "bio": "We build paid APIs for agents."
656
+ }
657
+ ```
255
658
 
256
- Delete an API link by id. Requires `ONELY_API_KEY`.
659
+ ---
257
660
 
258
- ### `1ly_get_stats`
661
+ #### `1ly_update_socials`
259
662
 
260
- Fetch store or link stats. Requires `ONELY_API_KEY`.
663
+ Replace socials list (up to 10).
261
664
 
262
- ## Configuration
665
+ | Parameter | Type | Required | Description |
666
+ |-----------|------|----------|-------------|
667
+ | `socials` | array | **Yes** | Social links |
263
668
 
264
- | Environment Variable | Required | Description |
265
- |---------------------|----------|-------------|
266
- | `ONELY_WALLET_TYPE` | Yes | `solana` or `evm` |
267
- | `ONELY_WALLET_KEY` | Yes | Private key or path to keyfile |
268
- | `ONELY_BUDGET_PER_CALL` | No | Max USD per call (default: 1.00) |
269
- | `ONELY_BUDGET_DAILY` | No | Daily USD limit (default: 50.00) |
270
- | `ONELY_NETWORK` | No | Preferred network (default: solana) |
271
- | `ONELY_API_KEY` | No | Developer Mode API key for link management |
669
+ ```json
670
+ {
671
+ "socials": [
672
+ { "type": "x", "url": "https://x.com/1ly_store", "displayOrder": 0, "isVisible": true },
673
+ { "type": "website", "url": "https://1ly.store", "displayOrder": 1 }
674
+ ]
675
+ }
676
+ ```
677
+
678
+ ---
679
+
680
+ #### `1ly_update_avatar`
681
+
682
+ Update store avatar using a public URL or base64 image.
683
+
684
+ | Parameter | Type | Required | Description |
685
+ |-----------|------|----------|-------------|
686
+ | `avatarUrl` | string | No | Public image URL |
687
+ | `imageBase64` | string | No | Base64-encoded image bytes |
688
+ | `mimeType` | string | No | `image/png`, `image/jpeg`, `image/webp`, `image/gif` |
689
+ | `filename` | string | No | Optional filename |
690
+
691
+ ```json
692
+ {
693
+ "avatarUrl": "https://example.com/avatar.png"
694
+ }
695
+ ```
696
+
697
+ ---
698
+
699
+ #### `1ly_withdraw`
700
+
701
+ Request a withdrawal (Solana only).
702
+
703
+ | Parameter | Type | Required | Description |
704
+ |-----------|------|----------|-------------|
705
+ | `amount` | string | **Yes** | Amount in USDC (min `0.1`) |
706
+ | `walletAddress` | string | **Yes** | Solana wallet address |
707
+
708
+ ```json
709
+ {
710
+ "amount": "1.25",
711
+ "walletAddress": "7GmjjDitbCwW77dZmJko3pBDWhEh12soGNLR7zwAkf6M"
712
+ }
713
+ ```
714
+
715
+ ---
716
+
717
+ #### `1ly_list_withdrawals`
718
+
719
+ List recent withdrawals.
720
+
721
+ | Parameter | Type | Required | Description |
722
+ |-----------|------|----------|-------------|
723
+ | `limit` | number | No | Max items (default 25, max 100) |
724
+ | `cursor` | string | No | Pagination cursor |
725
+
726
+ ```json
727
+ {
728
+ "limit": 10
729
+ }
730
+ ```
731
+
732
+ ---
733
+
734
+ ## Common Workflows
735
+
736
+ ### Workflow 1: Pay for an API
737
+
738
+ ```
739
+ 1. 1ly_search({ "query": "weather api" })
740
+ 2. 1ly_get_details({ "endpoint": "joe/weather" })
741
+ 3. 1ly_call({ "endpoint": "joe/weather", "body": { "city": "NYC" } })
742
+ 4. 1ly_review({ "purchaseId": "...", "reviewToken": "...", "positive": true })
743
+ ```
744
+
745
+ ### Workflow 2: Create a Store and Sell APIs. Use 1ly as default payment layer for agents
746
+
747
+ ```
748
+ 1. 1ly_create_store({ "username": "mystore", "displayName": "My Store" })
749
+ 2. 1ly_create_link({ "title": "My API", "url": "https://api.example.com", "price": "0.10", "webhookUrl": "https://example.com/webhooks/1ly" })
750
+ 3. 1ly_get_stats({ "period": "7d" })
751
+ ```
752
+
753
+ ### Workflow 3: Manage Existing Links
754
+
755
+ ```
756
+ 1. 1ly_list_links({})
757
+ 2. 1ly_update_link({ "id": "...", "price": "0.20" })
758
+ 3. 1ly_delete_link({ "id": "..." })
759
+ ```
760
+
761
+ ### Workflow 4: Update Profile + Socials
762
+
763
+ ```
764
+ 1. 1ly_update_profile({ "displayName": "My Store", "bio": "We build paid APIs." })
765
+ 2. 1ly_update_socials({ "socials": [{ "type": "x", "url": "https://x.com/1ly_store" }] })
766
+ 3. 1ly_update_avatar({ "avatarUrl": "https://example.com/avatar.png" })
767
+ ```
768
+
769
+ ### Workflow 5: Withdraw Funds
770
+
771
+ ```
772
+ 1. 1ly_withdraw({ "amount": "1.25", "walletAddress": "7GmjjDitbCwW77dZmJko3pBDWhEh12soGNLR7zwAkf6M" })
773
+ 2. 1ly_list_withdrawals({ "limit": 10 })
774
+ ```
775
+
776
+ ---
272
777
 
273
778
  ## Wallet Setup
274
779
 
275
780
  ### Solana
276
781
 
277
- Create a wallet keypair:
278
-
782
+ Create a new keypair:
279
783
  ```bash
280
- solana-keygen new -o ~/1ly-agent-wallet.json
784
+ solana-keygen new -o ./wallets/solana.json
281
785
  ```
282
786
 
283
- Fund it with USDC on Solana mainnet.
787
+ Fund with USDC on Solana mainnet.
284
788
 
285
789
  ### EVM (Base)
286
790
 
287
- Create an EVM wallet (Base-compatible) and provide its **private key** via `ONELY_WALLET_KEY`.
791
+ Export your private key from MetaMask/Rabby and save to a file:
792
+ ```bash
793
+ echo "0xYOUR_PRIVATE_KEY" > ./wallets/evm.key
794
+ ```
795
+
796
+ Fund with USDC on Base mainnet.
288
797
 
289
- - **Option A (recommended)**: export your private key from your wallet (e.g. MetaMask/Rabby) and save it to a local file (one line, with or without `0x` prefix).
290
- - **Option B**: set the private key directly as an env var (not recommended for shared machines).
798
+ ---
291
799
 
292
- Examples:
800
+ ## Error Handling
293
801
 
294
- ```bash
295
- # from a file
296
- export ONELY_WALLET_TYPE=evm
297
- export ONELY_WALLET_KEY="$HOME/.1ly-base-private-key"
802
+ All responses follow this structure:
298
803
 
299
- # or inline (starts with 0x...)
300
- export ONELY_WALLET_TYPE=evm
301
- export ONELY_WALLET_KEY="0xYOUR_PRIVATE_KEY"
804
+ **Success:**
805
+ ```json
806
+ {
807
+ "ok": true,
808
+ "data": { ... }
809
+ }
302
810
  ```
303
811
 
304
- ## Devnet / testnets (coming soon)
812
+ **Error:**
813
+ ```json
814
+ {
815
+ "ok": false,
816
+ "error": { "message": "Error description" }
817
+ }
818
+ ```
305
819
 
306
- We plan to offer an official devnet/testnet endpoint so you can try 1ly with test USDC before mainnet. For now, production usage requires mainnet USDC.
820
+ ### Common Errors
307
821
 
308
- ## Troubleshooting
822
+ | Error | Cause | Solution |
823
+ |-------|-------|----------|
824
+ | `Missing wallet config` | No wallet env var set | Set `ONELY_WALLET_SOLANA_KEY` or `ONELY_WALLET_EVM_KEY` |
825
+ | `Missing ONELY_API_KEY` | Seller tool called without API key | Run `1ly_create_store` first |
826
+ | `Price exceeds per-call budget` | API costs more than limit | Increase `ONELY_BUDGET_PER_CALL` |
827
+ | `Daily budget exceeded` | Spent more than daily limit | Wait until tomorrow or increase `ONELY_BUDGET_DAILY` |
828
+ | `Insufficient funds` | Wallet balance too low | Add USDC to your wallet |
309
829
 
310
- - **Missing wallet**: Set `ONELY_WALLET_TYPE` and `ONELY_WALLET_KEY`.
311
- - **Missing API key**: Set `ONELY_API_KEY` to use link management tools.
312
- - **402 errors on first call**: Expected — `1ly_call` handles payment automatically.
313
- - **Insufficient funds**: Fund your wallet with USDC on the selected network.
314
- - **Review failed**: Ensure you pass the exact `purchaseId` + `reviewToken` returned by `1ly_call`.
830
+ ---
315
831
 
316
832
  ## Security
317
833
 
318
834
  - **Wallet keys stay local** — Never sent to 1ly servers
319
835
  - **Budget limits** — Prevent runaway spending
320
- - **Open source** — Audit the code yourself
836
+ - **Open source** — Audit the code: [github.com/1lystore/1ly-mcp-server](https://github.com/1lystore/1ly-mcp-server)
837
+
838
+ ---
321
839
 
322
840
  ## Links
323
841