@paylobster/mcp-server 1.0.2 → 1.2.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.
Files changed (53) hide show
  1. package/dist/resources/index.d.ts.map +1 -1
  2. package/dist/resources/index.js +99 -0
  3. package/dist/resources/index.js.map +1 -1
  4. package/dist/server.d.ts.map +1 -1
  5. package/dist/server.js +475 -1
  6. package/dist/server.js.map +1 -1
  7. package/dist/tools/bridge.d.ts +142 -0
  8. package/dist/tools/bridge.d.ts.map +1 -0
  9. package/dist/tools/bridge.js +121 -0
  10. package/dist/tools/bridge.js.map +1 -0
  11. package/dist/tools/cascade.d.ts +59 -0
  12. package/dist/tools/cascade.d.ts.map +1 -0
  13. package/dist/tools/cascade.js +119 -0
  14. package/dist/tools/cascade.js.map +1 -0
  15. package/dist/tools/compliance.d.ts +36 -0
  16. package/dist/tools/compliance.d.ts.map +1 -0
  17. package/dist/tools/compliance.js +57 -0
  18. package/dist/tools/compliance.js.map +1 -0
  19. package/dist/tools/credit.d.ts +46 -0
  20. package/dist/tools/credit.d.ts.map +1 -0
  21. package/dist/tools/credit.js +102 -0
  22. package/dist/tools/credit.js.map +1 -0
  23. package/dist/tools/disputes.d.ts +71 -0
  24. package/dist/tools/disputes.d.ts.map +1 -0
  25. package/dist/tools/disputes.js +121 -0
  26. package/dist/tools/disputes.js.map +1 -0
  27. package/dist/tools/intent.d.ts +78 -0
  28. package/dist/tools/intent.d.ts.map +1 -0
  29. package/dist/tools/intent.js +192 -0
  30. package/dist/tools/intent.js.map +1 -0
  31. package/dist/tools/portfolio.d.ts +44 -0
  32. package/dist/tools/portfolio.d.ts.map +1 -0
  33. package/dist/tools/portfolio.js +166 -0
  34. package/dist/tools/portfolio.js.map +1 -0
  35. package/dist/tools/revenue.d.ts +42 -0
  36. package/dist/tools/revenue.d.ts.map +1 -0
  37. package/dist/tools/revenue.js +67 -0
  38. package/dist/tools/revenue.js.map +1 -0
  39. package/dist/tools/streaming.d.ts +60 -0
  40. package/dist/tools/streaming.d.ts.map +1 -0
  41. package/dist/tools/streaming.js +163 -0
  42. package/dist/tools/streaming.js.map +1 -0
  43. package/dist/tools/swap.d.ts +93 -0
  44. package/dist/tools/swap.d.ts.map +1 -0
  45. package/dist/tools/swap.js +150 -0
  46. package/dist/tools/swap.js.map +1 -0
  47. package/dist/types/index.d.ts +10 -0
  48. package/dist/types/index.d.ts.map +1 -1
  49. package/dist/utils/contracts.d.ts +316 -0
  50. package/dist/utils/contracts.d.ts.map +1 -1
  51. package/dist/utils/contracts.js +205 -5
  52. package/dist/utils/contracts.js.map +1 -1
  53. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAIpD,wBAAsB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,GAAG,CAAC,CAwBtF;AAiBD,wBAAgB,aAAa;;;;;IAqB5B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAMpD,wBAAsB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,GAAG,CAAC,CAiCtF;AA+DD,wBAAgB,aAAa;;;;;IAuC5B"}
@@ -1,9 +1,44 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
2
35
  Object.defineProperty(exports, "__esModule", { value: true });
3
36
  exports.handleResource = handleResource;
4
37
  exports.listResources = listResources;
5
38
  const reputation_1 = require("../tools/reputation");
6
39
  const escrow_1 = require("../tools/escrow");
40
+ const streaming_1 = require("../tools/streaming");
41
+ const disputes_1 = require("../tools/disputes");
7
42
  async function handleResource(uri, client) {
8
43
  const url = new URL(uri);
9
44
  if (url.protocol !== 'paylobster:') {
@@ -19,6 +54,12 @@ async function handleResource(uri, client) {
19
54
  return handleEscrowResource(resourceId, client);
20
55
  case 'reputation':
21
56
  return handleReputationResource(resourceId, client);
57
+ case 'stream':
58
+ return handleStreamResource(resourceId, client);
59
+ case 'dispute':
60
+ return handleDisputeResource(resourceId, client);
61
+ case 'intent':
62
+ return handleIntentResource(resourceId, client);
22
63
  default:
23
64
  throw new Error(`Unknown resource type: ${resourceType}`);
24
65
  }
@@ -35,6 +76,46 @@ async function handleReputationResource(address, client) {
35
76
  // paylobster://reputation/{address} returns reputation data
36
77
  return await (0, reputation_1.getReputation)({ address }, client);
37
78
  }
79
+ async function handleStreamResource(streamId, client) {
80
+ // paylobster://stream/{id} returns stream details
81
+ return await (0, streaming_1.getStream)({ streamId }, client);
82
+ }
83
+ async function handleDisputeResource(disputeId, client) {
84
+ // paylobster://dispute/{id} returns dispute details
85
+ return await (0, disputes_1.getDispute)({ disputeId }, client);
86
+ }
87
+ async function handleIntentResource(intentId, client) {
88
+ // paylobster://intent/{id} returns intent details
89
+ const publicClient = client.getPublicClient();
90
+ const contracts = client.getContracts();
91
+ try {
92
+ const intentIdBigInt = BigInt(intentId);
93
+ const [description, tags, budget, deadline, status, offerCount] = await publicClient.readContract({
94
+ address: contracts.intent,
95
+ abi: (await Promise.resolve().then(() => __importStar(require('../utils/contracts')))).INTENT_ABI,
96
+ functionName: 'getIntent',
97
+ args: [intentIdBigInt],
98
+ });
99
+ const statusMap = {
100
+ 0: 'open',
101
+ 1: 'accepted',
102
+ 2: 'completed',
103
+ 3: 'canceled',
104
+ };
105
+ return {
106
+ intentId,
107
+ description: description,
108
+ tags: tags,
109
+ budget: client.formatUSDC(budget),
110
+ deadline: Number(deadline) * 1000,
111
+ status: statusMap[Number(status)],
112
+ offers: Number(offerCount),
113
+ };
114
+ }
115
+ catch (error) {
116
+ throw new Error(`Failed to fetch intent: ${error.message}`);
117
+ }
118
+ }
38
119
  function listResources() {
39
120
  return [
40
121
  {
@@ -55,6 +136,24 @@ function listResources() {
55
136
  description: 'Get agent reputation metrics',
56
137
  mimeType: 'application/json',
57
138
  },
139
+ {
140
+ uri: 'paylobster://stream/{id}',
141
+ name: 'Stream Details',
142
+ description: 'Get streaming payment status and details',
143
+ mimeType: 'application/json',
144
+ },
145
+ {
146
+ uri: 'paylobster://dispute/{id}',
147
+ name: 'Dispute Details',
148
+ description: 'Get dispute status and evidence',
149
+ mimeType: 'application/json',
150
+ },
151
+ {
152
+ uri: 'paylobster://intent/{id}',
153
+ name: 'Intent Details',
154
+ description: 'Get intent status and offers',
155
+ mimeType: 'application/json',
156
+ },
58
157
  ];
59
158
  }
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AAU,EAAE,CAAC;QACpB,MAAM,IAAI,KAAK,CAAC,2BAA2B,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;IAC9D,CAAC;AACH,CAAC;AAED,SAAgB,aAAa;IAC3B,OAAO;QACL;YACE,GAAG,EAAE,8BAA8B;YACnC,IAAI,EAAE,eAAe;YACrB,WAAW,EAAE,wCAAwC;YACrD,QAAQ,EAAE,kBAAkB;SAC7B;QACD;YACE,GAAG,EAAE,0BAA0B;YAC/B,IAAI,EAAE,gBAAgB;YACtB,WAAW,EAAE,+BAA+B;YAC5C,QAAQ,EAAE,kBAAkB;SAC7B;QACD;YACE,GAAG,EAAE,mCAAmC;YACxC,IAAI,EAAE,iBAAiB;YACvB,WAAW,EAAE,8BAA8B;YAC3C,QAAQ,EAAE,kBAAkB;SAC7B;QACD;YACE,GAAG,EAAE,0BAA0B;YAC/B,IAAI,EAAE,gBAAgB;YACtB,WAAW,EAAE,0CAA0C;YACvD,QAAQ,EAAE,kBAAkB;SAC7B;QACD;YACE,GAAG,EAAE,2BAA2B;YAChC,IAAI,EAAE,iBAAiB;YACvB,WAAW,EAAE,iCAAiC;YAC9C,QAAQ,EAAE,kBAAkB;SAC7B;QACD;YACE,GAAG,EAAE,0BAA0B;YAC/B,IAAI,EAAE,gBAAgB;YACtB,WAAW,EAAE,8BAA8B;YAC3C,QAAQ,EAAE,kBAAkB;SAC7B;KACF,CAAC;AACJ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AA2BpD,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,MAAM,CAAiB;gBAEnB,MAAM,EAAE,gBAAgB;IAkBpC,OAAO,CAAC,aAAa;IAsNf,KAAK;CAKZ"}
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAiGpD,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,MAAM,CAAiB;gBAEnB,MAAM,EAAE,gBAAgB;IAkBpC,OAAO,CAAC,aAAa;IA+rBf,KAAK;CAKZ"}
package/dist/server.js CHANGED
@@ -9,6 +9,16 @@ const search_js_1 = require("./tools/search.js");
9
9
  const escrow_js_1 = require("./tools/escrow.js");
10
10
  const reputation_js_1 = require("./tools/reputation.js");
11
11
  const balance_js_1 = require("./tools/balance.js");
12
+ const streaming_js_1 = require("./tools/streaming.js");
13
+ const disputes_js_1 = require("./tools/disputes.js");
14
+ const credit_js_1 = require("./tools/credit.js");
15
+ const cascade_js_1 = require("./tools/cascade.js");
16
+ const intent_js_1 = require("./tools/intent.js");
17
+ const revenue_js_1 = require("./tools/revenue.js");
18
+ const compliance_js_1 = require("./tools/compliance.js");
19
+ const swap_js_1 = require("./tools/swap.js");
20
+ const bridge_js_1 = require("./tools/bridge.js");
21
+ const portfolio_js_1 = require("./tools/portfolio.js");
12
22
  const index_js_2 = require("./resources/index.js");
13
23
  class PayLobsterMCPServer {
14
24
  server;
@@ -17,7 +27,7 @@ class PayLobsterMCPServer {
17
27
  this.client = new contracts_js_1.ContractClient(config);
18
28
  this.server = new index_js_1.Server({
19
29
  name: '@paylobster/mcp-server',
20
- version: '1.0.0',
30
+ version: '1.2.0',
21
31
  }, {
22
32
  capabilities: {
23
33
  tools: {},
@@ -148,6 +158,345 @@ class PayLobsterMCPServer {
148
158
  properties: {},
149
159
  },
150
160
  },
161
+ {
162
+ name: 'create_streaming_payment',
163
+ description: 'Create a streaming payment to another agent',
164
+ inputSchema: {
165
+ type: 'object',
166
+ properties: {
167
+ to: { type: 'string', description: 'Recipient address' },
168
+ amountPerSecond: { type: 'string', description: 'Amount per second in USDC' },
169
+ duration: { type: 'string', description: 'ISO 8601 duration (e.g., P1D for 1 day)' },
170
+ metadata: { type: 'object' },
171
+ },
172
+ required: ['to', 'amountPerSecond', 'duration'],
173
+ },
174
+ },
175
+ {
176
+ name: 'cancel_stream',
177
+ description: 'Cancel an active stream',
178
+ inputSchema: {
179
+ type: 'object',
180
+ properties: {
181
+ streamId: { type: 'string', description: 'Stream ID' },
182
+ },
183
+ required: ['streamId'],
184
+ },
185
+ },
186
+ {
187
+ name: 'get_stream',
188
+ description: 'Get stream details',
189
+ inputSchema: {
190
+ type: 'object',
191
+ properties: {
192
+ streamId: { type: 'string', description: 'Stream ID' },
193
+ },
194
+ required: ['streamId'],
195
+ },
196
+ },
197
+ {
198
+ name: 'open_dispute',
199
+ description: 'Open a dispute on an escrow',
200
+ inputSchema: {
201
+ type: 'object',
202
+ properties: {
203
+ escrowId: { type: 'string', description: 'Escrow ID to dispute' },
204
+ reason: { type: 'string', description: 'Reason for dispute' },
205
+ evidence: { type: 'string', description: 'Initial evidence (IPFS hash or URL)' },
206
+ },
207
+ required: ['escrowId', 'reason'],
208
+ },
209
+ },
210
+ {
211
+ name: 'submit_evidence',
212
+ description: 'Submit evidence for a dispute',
213
+ inputSchema: {
214
+ type: 'object',
215
+ properties: {
216
+ disputeId: { type: 'string', description: 'Dispute ID' },
217
+ evidence: { type: 'string', description: 'Evidence (IPFS hash or URL)' },
218
+ description: { type: 'string', description: 'Description of evidence' },
219
+ },
220
+ required: ['disputeId', 'evidence', 'description'],
221
+ },
222
+ },
223
+ {
224
+ name: 'get_dispute',
225
+ description: 'Get dispute details',
226
+ inputSchema: {
227
+ type: 'object',
228
+ properties: {
229
+ disputeId: { type: 'string', description: 'Dispute ID' },
230
+ },
231
+ required: ['disputeId'],
232
+ },
233
+ },
234
+ {
235
+ name: 'get_credit_score',
236
+ description: "Get an agent's credit score",
237
+ inputSchema: {
238
+ type: 'object',
239
+ properties: {
240
+ address: { type: 'string', description: 'Agent address' },
241
+ },
242
+ required: ['address'],
243
+ },
244
+ },
245
+ {
246
+ name: 'request_credit_line',
247
+ description: 'Request a credit line',
248
+ inputSchema: {
249
+ type: 'object',
250
+ properties: {
251
+ amount: { type: 'string', description: 'Requested credit line amount in USDC' },
252
+ duration: { type: 'string', description: 'ISO 8601 duration (e.g., P30D for 30 days)' },
253
+ collateral: { type: 'string', description: 'Collateral amount in USDC' },
254
+ },
255
+ required: ['amount', 'duration'],
256
+ },
257
+ },
258
+ {
259
+ name: 'create_cascade',
260
+ description: 'Create cascading multi-agent escrow',
261
+ inputSchema: {
262
+ type: 'object',
263
+ properties: {
264
+ levels: {
265
+ type: 'array',
266
+ items: {
267
+ type: 'object',
268
+ properties: {
269
+ recipient: { type: 'string', description: 'Recipient address' },
270
+ amount: { type: 'string', description: 'Amount in USDC' },
271
+ releaseCondition: { type: 'string', description: 'Condition for release' },
272
+ },
273
+ required: ['recipient', 'amount', 'releaseCondition'],
274
+ },
275
+ description: 'Cascade levels in order',
276
+ },
277
+ metadata: { type: 'object' },
278
+ },
279
+ required: ['levels'],
280
+ },
281
+ },
282
+ {
283
+ name: 'release_cascade_level',
284
+ description: 'Release a cascade level',
285
+ inputSchema: {
286
+ type: 'object',
287
+ properties: {
288
+ cascadeId: { type: 'string', description: 'Cascade ID' },
289
+ level: { type: 'number', description: 'Level to release (0-indexed)' },
290
+ },
291
+ required: ['cascadeId', 'level'],
292
+ },
293
+ },
294
+ {
295
+ name: 'post_intent',
296
+ description: 'Post a service intent to marketplace',
297
+ inputSchema: {
298
+ type: 'object',
299
+ properties: {
300
+ description: { type: 'string', description: 'Service intent description' },
301
+ tags: { type: 'array', items: { type: 'string' }, description: 'Service tags for discovery' },
302
+ budget: { type: 'string', description: 'Maximum budget in USDC' },
303
+ deadline: { type: 'string', description: 'ISO 8601 duration or timestamp' },
304
+ requirements: { type: 'object' },
305
+ },
306
+ required: ['description', 'tags', 'budget', 'deadline'],
307
+ },
308
+ },
309
+ {
310
+ name: 'search_intents',
311
+ description: 'Search intents by tags',
312
+ inputSchema: {
313
+ type: 'object',
314
+ properties: {
315
+ tags: { type: 'array', items: { type: 'string' }, description: 'Filter by tags' },
316
+ minBudget: { type: 'string', description: 'Minimum budget in USDC' },
317
+ maxBudget: { type: 'string', description: 'Maximum budget in USDC' },
318
+ limit: { type: 'number', default: 20 },
319
+ },
320
+ },
321
+ },
322
+ {
323
+ name: 'accept_offer',
324
+ description: 'Accept an offer on your intent',
325
+ inputSchema: {
326
+ type: 'object',
327
+ properties: {
328
+ intentId: { type: 'string', description: 'Intent ID' },
329
+ offerId: { type: 'string', description: 'Offer ID to accept' },
330
+ },
331
+ required: ['intentId', 'offerId'],
332
+ },
333
+ },
334
+ {
335
+ name: 'create_revenue_share',
336
+ description: 'Create revenue sharing agreement',
337
+ inputSchema: {
338
+ type: 'object',
339
+ properties: {
340
+ participants: {
341
+ type: 'array',
342
+ items: {
343
+ type: 'object',
344
+ properties: {
345
+ address: { type: 'string', description: 'Participant address' },
346
+ share: { type: 'number', description: 'Share percentage (0-100)' },
347
+ },
348
+ required: ['address', 'share'],
349
+ },
350
+ description: 'Revenue share participants',
351
+ },
352
+ sourceEscrow: { type: 'string', description: 'Link to source escrow' },
353
+ metadata: { type: 'object' },
354
+ },
355
+ required: ['participants'],
356
+ },
357
+ },
358
+ {
359
+ name: 'check_compliance',
360
+ description: 'Check agent compliance status',
361
+ inputSchema: {
362
+ type: 'object',
363
+ properties: {
364
+ address: { type: 'string', description: 'Agent address to check' },
365
+ checkTypes: { type: 'array', items: { type: 'string' }, description: 'Specific checks to run (kyc, sanctions, risk)' },
366
+ },
367
+ required: ['address'],
368
+ },
369
+ },
370
+ {
371
+ name: 'swap_quote',
372
+ description: 'Get swap quote for Base tokens via 0x API',
373
+ inputSchema: {
374
+ type: 'object',
375
+ properties: {
376
+ sellToken: { type: 'string', description: 'Token address or symbol to sell' },
377
+ buyToken: { type: 'string', description: 'Token address or symbol to buy' },
378
+ sellAmount: { type: 'string', description: 'Amount to sell (in token units)' },
379
+ buyAmount: { type: 'string', description: 'Amount to buy (in token units)' },
380
+ slippagePercentage: { type: 'number', default: 0.01, description: 'Slippage tolerance (0.01 = 1%)' },
381
+ takerAddress: { type: 'string', description: 'Address that will submit the transaction' },
382
+ },
383
+ required: ['sellToken', 'buyToken'],
384
+ },
385
+ },
386
+ {
387
+ name: 'swap_execute',
388
+ description: 'Execute swap (returns unsigned tx)',
389
+ inputSchema: {
390
+ type: 'object',
391
+ properties: {
392
+ sellToken: { type: 'string', description: 'Token address or symbol to sell' },
393
+ buyToken: { type: 'string', description: 'Token address or symbol to buy' },
394
+ sellAmount: { type: 'string', description: 'Amount to sell (in token units)' },
395
+ buyAmount: { type: 'string', description: 'Amount to buy (in token units)' },
396
+ slippagePercentage: { type: 'number', default: 0.01, description: 'Slippage tolerance (0.01 = 1%)' },
397
+ },
398
+ required: ['sellToken', 'buyToken'],
399
+ },
400
+ },
401
+ {
402
+ name: 'swap_tokens',
403
+ description: 'List available tokens on Base',
404
+ inputSchema: {
405
+ type: 'object',
406
+ properties: {
407
+ query: { type: 'string', description: 'Search query to filter tokens' },
408
+ },
409
+ },
410
+ },
411
+ {
412
+ name: 'swap_price',
413
+ description: 'Get token price in USDC',
414
+ inputSchema: {
415
+ type: 'object',
416
+ properties: {
417
+ token: { type: 'string', description: 'Token address or symbol' },
418
+ },
419
+ required: ['token'],
420
+ },
421
+ },
422
+ {
423
+ name: 'bridge_quote',
424
+ description: 'Get cross-chain bridge quote via Li.Fi',
425
+ inputSchema: {
426
+ type: 'object',
427
+ properties: {
428
+ fromChain: { type: ['string', 'number'], description: 'Source chain ID or name' },
429
+ toChain: { type: ['string', 'number'], description: 'Destination chain ID or name' },
430
+ fromToken: { type: 'string', description: 'Source token address' },
431
+ toToken: { type: 'string', description: 'Destination token address' },
432
+ fromAmount: { type: 'string', description: 'Amount to bridge (in token units)' },
433
+ fromAddress: { type: 'string', description: 'Sender address' },
434
+ toAddress: { type: 'string', description: 'Recipient address (defaults to fromAddress)' },
435
+ },
436
+ required: ['fromChain', 'toChain', 'fromToken', 'toToken', 'fromAmount'],
437
+ },
438
+ },
439
+ {
440
+ name: 'bridge_execute',
441
+ description: 'Execute bridge (returns tx data)',
442
+ inputSchema: {
443
+ type: 'object',
444
+ properties: {
445
+ fromChain: { type: ['string', 'number'], description: 'Source chain ID or name' },
446
+ toChain: { type: ['string', 'number'], description: 'Destination chain ID or name' },
447
+ fromToken: { type: 'string', description: 'Source token address' },
448
+ toToken: { type: 'string', description: 'Destination token address' },
449
+ fromAmount: { type: 'string', description: 'Amount to bridge (in token units)' },
450
+ toAddress: { type: 'string', description: 'Recipient address' },
451
+ },
452
+ required: ['fromChain', 'toChain', 'fromToken', 'toToken', 'fromAmount'],
453
+ },
454
+ },
455
+ {
456
+ name: 'bridge_status',
457
+ description: 'Check bridge transaction status',
458
+ inputSchema: {
459
+ type: 'object',
460
+ properties: {
461
+ txHash: { type: 'string', description: 'Transaction hash to check' },
462
+ fromChain: { type: ['string', 'number'], description: 'Source chain ID' },
463
+ toChain: { type: ['string', 'number'], description: 'Destination chain ID' },
464
+ },
465
+ required: ['txHash'],
466
+ },
467
+ },
468
+ {
469
+ name: 'bridge_chains',
470
+ description: 'List supported chains',
471
+ inputSchema: {
472
+ type: 'object',
473
+ properties: {
474
+ query: { type: 'string', description: 'Filter chains by name' },
475
+ },
476
+ },
477
+ },
478
+ {
479
+ name: 'get_portfolio',
480
+ description: 'Get all token balances for an address on Base',
481
+ inputSchema: {
482
+ type: 'object',
483
+ properties: {
484
+ address: { type: 'string', description: 'Ethereum address to get portfolio for' },
485
+ },
486
+ required: ['address'],
487
+ },
488
+ },
489
+ {
490
+ name: 'get_token_price',
491
+ description: 'Get price of any token on Base',
492
+ inputSchema: {
493
+ type: 'object',
494
+ properties: {
495
+ tokenAddress: { type: 'string', description: 'Token contract address on Base' },
496
+ },
497
+ required: ['tokenAddress'],
498
+ },
499
+ },
151
500
  ],
152
501
  }));
153
502
  // Handle tool calls
@@ -194,6 +543,131 @@ class PayLobsterMCPServer {
194
543
  const result = await (0, balance_js_1.getBalance)(params, this.client);
195
544
  return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
196
545
  }
546
+ case 'create_streaming_payment': {
547
+ const params = streaming_js_1.createStreamingPaymentSchema.parse(request.params.arguments);
548
+ const result = await (0, streaming_js_1.createStreamingPayment)(params, this.client);
549
+ return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
550
+ }
551
+ case 'cancel_stream': {
552
+ const params = streaming_js_1.cancelStreamSchema.parse(request.params.arguments);
553
+ const result = await (0, streaming_js_1.cancelStream)(params, this.client);
554
+ return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
555
+ }
556
+ case 'get_stream': {
557
+ const params = streaming_js_1.getStreamSchema.parse(request.params.arguments);
558
+ const result = await (0, streaming_js_1.getStream)(params, this.client);
559
+ return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
560
+ }
561
+ case 'open_dispute': {
562
+ const params = disputes_js_1.openDisputeSchema.parse(request.params.arguments);
563
+ const result = await (0, disputes_js_1.openDispute)(params, this.client);
564
+ return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
565
+ }
566
+ case 'submit_evidence': {
567
+ const params = disputes_js_1.submitEvidenceSchema.parse(request.params.arguments);
568
+ const result = await (0, disputes_js_1.submitEvidence)(params, this.client);
569
+ return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
570
+ }
571
+ case 'get_dispute': {
572
+ const params = disputes_js_1.getDisputeSchema.parse(request.params.arguments);
573
+ const result = await (0, disputes_js_1.getDispute)(params, this.client);
574
+ return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
575
+ }
576
+ case 'get_credit_score': {
577
+ const params = credit_js_1.getCreditScoreSchema.parse(request.params.arguments);
578
+ const result = await (0, credit_js_1.getCreditScore)(params, this.client);
579
+ return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
580
+ }
581
+ case 'request_credit_line': {
582
+ const params = credit_js_1.requestCreditLineSchema.parse(request.params.arguments);
583
+ const result = await (0, credit_js_1.requestCreditLine)(params, this.client);
584
+ return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
585
+ }
586
+ case 'create_cascade': {
587
+ const params = cascade_js_1.createCascadeSchema.parse(request.params.arguments);
588
+ const result = await (0, cascade_js_1.createCascade)(params, this.client);
589
+ return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
590
+ }
591
+ case 'release_cascade_level': {
592
+ const params = cascade_js_1.releaseCascadeLevelSchema.parse(request.params.arguments);
593
+ const result = await (0, cascade_js_1.releaseCascadeLevel)(params, this.client);
594
+ return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
595
+ }
596
+ case 'post_intent': {
597
+ const params = intent_js_1.postIntentSchema.parse(request.params.arguments);
598
+ const result = await (0, intent_js_1.postIntent)(params, this.client);
599
+ return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
600
+ }
601
+ case 'search_intents': {
602
+ const params = intent_js_1.searchIntentsSchema.parse(request.params.arguments);
603
+ const result = await (0, intent_js_1.searchIntents)(params, this.client);
604
+ return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
605
+ }
606
+ case 'accept_offer': {
607
+ const params = intent_js_1.acceptOfferSchema.parse(request.params.arguments);
608
+ const result = await (0, intent_js_1.acceptOffer)(params, this.client);
609
+ return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
610
+ }
611
+ case 'create_revenue_share': {
612
+ const params = revenue_js_1.createRevenueShareSchema.parse(request.params.arguments);
613
+ const result = await (0, revenue_js_1.createRevenueShare)(params, this.client);
614
+ return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
615
+ }
616
+ case 'check_compliance': {
617
+ const params = compliance_js_1.checkComplianceSchema.parse(request.params.arguments);
618
+ const result = await (0, compliance_js_1.checkCompliance)(params, this.client);
619
+ return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
620
+ }
621
+ case 'swap_quote': {
622
+ const params = swap_js_1.swapQuoteSchema.parse(request.params.arguments);
623
+ const result = await (0, swap_js_1.swapQuote)(params, this.client);
624
+ return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
625
+ }
626
+ case 'swap_execute': {
627
+ const params = swap_js_1.swapExecuteSchema.parse(request.params.arguments);
628
+ const result = await (0, swap_js_1.swapExecute)(params, this.client);
629
+ return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
630
+ }
631
+ case 'swap_tokens': {
632
+ const params = swap_js_1.swapTokensSchema.parse(request.params.arguments);
633
+ const result = await (0, swap_js_1.swapTokens)(params, this.client);
634
+ return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
635
+ }
636
+ case 'swap_price': {
637
+ const params = swap_js_1.swapPriceSchema.parse(request.params.arguments);
638
+ const result = await (0, swap_js_1.swapPrice)(params, this.client);
639
+ return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
640
+ }
641
+ case 'bridge_quote': {
642
+ const params = bridge_js_1.bridgeQuoteSchema.parse(request.params.arguments);
643
+ const result = await (0, bridge_js_1.bridgeQuote)(params, this.client);
644
+ return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
645
+ }
646
+ case 'bridge_execute': {
647
+ const params = bridge_js_1.bridgeExecuteSchema.parse(request.params.arguments);
648
+ const result = await (0, bridge_js_1.bridgeExecute)(params, this.client);
649
+ return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
650
+ }
651
+ case 'bridge_status': {
652
+ const params = bridge_js_1.bridgeStatusSchema.parse(request.params.arguments);
653
+ const result = await (0, bridge_js_1.bridgeStatus)(params, this.client);
654
+ return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
655
+ }
656
+ case 'bridge_chains': {
657
+ const params = bridge_js_1.bridgeChainsSchema.parse(request.params.arguments);
658
+ const result = await (0, bridge_js_1.bridgeChains)(params, this.client);
659
+ return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
660
+ }
661
+ case 'get_portfolio': {
662
+ const params = portfolio_js_1.getPortfolioSchema.parse(request.params.arguments);
663
+ const result = await (0, portfolio_js_1.getPortfolio)(params, this.client);
664
+ return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
665
+ }
666
+ case 'get_token_price': {
667
+ const params = portfolio_js_1.getTokenPriceSchema.parse(request.params.arguments);
668
+ const result = await (0, portfolio_js_1.getTokenPrice)(params, this.client);
669
+ return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
670
+ }
197
671
  default:
198
672
  throw new Error(`Unknown tool: ${request.params.name}`);
199
673
  }