@stigg/typescript-mcp 0.1.0-alpha.9 → 0.1.0-beta.10

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 (123) hide show
  1. package/auth.d.mts.map +1 -1
  2. package/auth.d.ts.map +1 -1
  3. package/code-tool-paths.cjs +8 -0
  4. package/code-tool-paths.cjs.map +1 -0
  5. package/code-tool-paths.d.cts +2 -0
  6. package/code-tool-paths.d.cts.map +1 -0
  7. package/code-tool-types.d.mts.map +1 -1
  8. package/code-tool-types.d.ts.map +1 -1
  9. package/code-tool-worker.d.mts +5 -0
  10. package/code-tool-worker.d.mts.map +1 -0
  11. package/code-tool-worker.d.ts +5 -0
  12. package/code-tool-worker.d.ts.map +1 -0
  13. package/code-tool-worker.js +370 -0
  14. package/code-tool-worker.js.map +1 -0
  15. package/code-tool-worker.mjs +332 -0
  16. package/code-tool-worker.mjs.map +1 -0
  17. package/code-tool.d.mts +8 -2
  18. package/code-tool.d.mts.map +1 -1
  19. package/code-tool.d.ts +8 -2
  20. package/code-tool.d.ts.map +1 -1
  21. package/code-tool.js +266 -37
  22. package/code-tool.js.map +1 -1
  23. package/code-tool.mjs +233 -37
  24. package/code-tool.mjs.map +1 -1
  25. package/docs-search-tool.d.mts +5 -3
  26. package/docs-search-tool.d.mts.map +1 -1
  27. package/docs-search-tool.d.ts +5 -3
  28. package/docs-search-tool.d.ts.map +1 -1
  29. package/docs-search-tool.js +53 -4
  30. package/docs-search-tool.js.map +1 -1
  31. package/docs-search-tool.mjs +52 -4
  32. package/docs-search-tool.mjs.map +1 -1
  33. package/http.d.mts +2 -4
  34. package/http.d.mts.map +1 -1
  35. package/http.d.ts +2 -4
  36. package/http.d.ts.map +1 -1
  37. package/http.js +123 -40
  38. package/http.js.map +1 -1
  39. package/http.mjs +123 -40
  40. package/http.mjs.map +1 -1
  41. package/index.js +13 -12
  42. package/index.js.map +1 -1
  43. package/index.mjs +13 -12
  44. package/index.mjs.map +1 -1
  45. package/instructions.d.mts +5 -0
  46. package/instructions.d.mts.map +1 -0
  47. package/instructions.d.ts +5 -0
  48. package/instructions.d.ts.map +1 -0
  49. package/instructions.js +61 -0
  50. package/instructions.js.map +1 -0
  51. package/instructions.mjs +55 -0
  52. package/instructions.mjs.map +1 -0
  53. package/local-docs-search.d.mts +28 -0
  54. package/local-docs-search.d.mts.map +1 -0
  55. package/local-docs-search.d.ts +28 -0
  56. package/local-docs-search.d.ts.map +1 -0
  57. package/local-docs-search.js +5385 -0
  58. package/local-docs-search.js.map +1 -0
  59. package/local-docs-search.mjs +5345 -0
  60. package/local-docs-search.mjs.map +1 -0
  61. package/logger.d.mts +7 -0
  62. package/logger.d.mts.map +1 -0
  63. package/logger.d.ts +7 -0
  64. package/logger.d.ts.map +1 -0
  65. package/logger.js +29 -0
  66. package/logger.js.map +1 -0
  67. package/logger.mjs +22 -0
  68. package/logger.mjs.map +1 -0
  69. package/methods.d.mts.map +1 -1
  70. package/methods.d.ts.map +1 -1
  71. package/methods.js +312 -42
  72. package/methods.js.map +1 -1
  73. package/methods.mjs +312 -42
  74. package/methods.mjs.map +1 -1
  75. package/options.d.mts +7 -0
  76. package/options.d.mts.map +1 -1
  77. package/options.d.ts +7 -0
  78. package/options.d.ts.map +1 -1
  79. package/options.js +42 -0
  80. package/options.js.map +1 -1
  81. package/options.mjs +42 -0
  82. package/options.mjs.map +1 -1
  83. package/package.json +58 -7
  84. package/server.d.mts +10 -1
  85. package/server.d.mts.map +1 -1
  86. package/server.d.ts +10 -1
  87. package/server.d.ts.map +1 -1
  88. package/server.js +72 -47
  89. package/server.js.map +1 -1
  90. package/server.mjs +72 -47
  91. package/server.mjs.map +1 -1
  92. package/src/code-tool-paths.cts +5 -0
  93. package/src/code-tool-types.ts +1 -0
  94. package/src/code-tool-worker.ts +383 -0
  95. package/src/code-tool.ts +302 -47
  96. package/src/docs-search-tool.ts +81 -11
  97. package/src/http.ts +131 -42
  98. package/src/index.ts +15 -13
  99. package/src/instructions.ts +83 -0
  100. package/src/local-docs-search.ts +6399 -0
  101. package/src/logger.ts +28 -0
  102. package/src/methods.ts +312 -42
  103. package/src/options.ts +56 -0
  104. package/src/server.ts +85 -58
  105. package/src/stdio.ts +6 -2
  106. package/src/types.ts +3 -0
  107. package/src/util.ts +2 -2
  108. package/stdio.d.mts.map +1 -1
  109. package/stdio.d.ts.map +1 -1
  110. package/stdio.js +6 -2
  111. package/stdio.js.map +1 -1
  112. package/stdio.mjs +6 -2
  113. package/stdio.mjs.map +1 -1
  114. package/types.d.mts +6 -0
  115. package/types.d.mts.map +1 -1
  116. package/types.d.ts +6 -0
  117. package/types.d.ts.map +1 -1
  118. package/types.js.map +1 -1
  119. package/types.mjs.map +1 -1
  120. package/util.js +2 -2
  121. package/util.js.map +1 -1
  122. package/util.mjs +2 -2
  123. package/util.mjs.map +1 -1
package/src/logger.ts ADDED
@@ -0,0 +1,28 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { pino, type Level, type Logger } from 'pino';
4
+ import pretty from 'pino-pretty';
5
+
6
+ let _logger: Logger | undefined;
7
+
8
+ export function configureLogger({ level, pretty: usePretty }: { level: Level; pretty: boolean }): void {
9
+ _logger = pino(
10
+ {
11
+ level,
12
+ timestamp: pino.stdTimeFunctions.isoTime,
13
+ formatters: {
14
+ level(label) {
15
+ return { level: label };
16
+ },
17
+ },
18
+ },
19
+ usePretty ? pretty({ colorize: true, levelFirst: true, destination: 2 }) : process.stderr,
20
+ );
21
+ }
22
+
23
+ export function getLogger(): Logger {
24
+ if (!_logger) {
25
+ throw new Error('Logger has not been configured. Call configureLogger() before using the logger.');
26
+ }
27
+ return _logger;
28
+ }
package/src/methods.ts CHANGED
@@ -34,6 +34,12 @@ export const sdkMethods: SdkMethod[] = [
34
34
  httpMethod: 'post',
35
35
  httpPath: '/api/v1/customers/{id}/archive',
36
36
  },
37
+ {
38
+ clientCallName: 'client.v1.customers.checkEntitlement',
39
+ fullyQualifiedName: 'v1.customers.checkEntitlement',
40
+ httpMethod: 'get',
41
+ httpPath: '/api/v1/customers/{id}/entitlements/check',
42
+ },
37
43
  {
38
44
  clientCallName: 'client.v1.customers.import',
39
45
  fullyQualifiedName: 'v1.customers.import',
@@ -52,6 +58,12 @@ export const sdkMethods: SdkMethod[] = [
52
58
  httpMethod: 'post',
53
59
  httpPath: '/api/v1/customers',
54
60
  },
61
+ {
62
+ clientCallName: 'client.v1.customers.retrieveEntitlements',
63
+ fullyQualifiedName: 'v1.customers.retrieveEntitlements',
64
+ httpMethod: 'get',
65
+ httpPath: '/api/v1/customers/{id}/entitlements',
66
+ },
55
67
  {
56
68
  clientCallName: 'client.v1.customers.unarchive',
57
69
  fullyQualifiedName: 'v1.customers.unarchive',
@@ -88,6 +100,36 @@ export const sdkMethods: SdkMethod[] = [
88
100
  httpMethod: 'delete',
89
101
  httpPath: '/api/v1/customers/{id}/promotional-entitlements/{featureId}',
90
102
  },
103
+ {
104
+ clientCallName: 'client.v1.customers.integrations.retrieve',
105
+ fullyQualifiedName: 'v1.customers.integrations.retrieve',
106
+ httpMethod: 'get',
107
+ httpPath: '/api/v1/customers/{id}/integrations/{integrationId}',
108
+ },
109
+ {
110
+ clientCallName: 'client.v1.customers.integrations.update',
111
+ fullyQualifiedName: 'v1.customers.integrations.update',
112
+ httpMethod: 'patch',
113
+ httpPath: '/api/v1/customers/{id}/integrations/{integrationId}',
114
+ },
115
+ {
116
+ clientCallName: 'client.v1.customers.integrations.list',
117
+ fullyQualifiedName: 'v1.customers.integrations.list',
118
+ httpMethod: 'get',
119
+ httpPath: '/api/v1/customers/{id}/integrations',
120
+ },
121
+ {
122
+ clientCallName: 'client.v1.customers.integrations.link',
123
+ fullyQualifiedName: 'v1.customers.integrations.link',
124
+ httpMethod: 'post',
125
+ httpPath: '/api/v1/customers/{id}/integrations',
126
+ },
127
+ {
128
+ clientCallName: 'client.v1.customers.integrations.unlink',
129
+ fullyQualifiedName: 'v1.customers.integrations.unlink',
130
+ httpMethod: 'delete',
131
+ httpPath: '/api/v1/customers/{id}/integrations/{integrationId}',
132
+ },
91
133
  {
92
134
  clientCallName: 'client.v1.subscriptions.retrieve',
93
135
  fullyQualifiedName: 'v1.subscriptions.retrieve',
@@ -215,107 +257,275 @@ export const sdkMethods: SdkMethod[] = [
215
257
  httpPath: '/api/v1/events',
216
258
  },
217
259
  {
218
- clientCallName: 'client.v1.events.features.archiveFeature',
219
- fullyQualifiedName: 'v1.events.features.archiveFeature',
260
+ clientCallName: 'client.v1.credits.getAutoRecharge',
261
+ fullyQualifiedName: 'v1.credits.getAutoRecharge',
262
+ httpMethod: 'get',
263
+ httpPath: '/api/v1/credits/auto-recharge',
264
+ },
265
+ {
266
+ clientCallName: 'client.v1.credits.getUsage',
267
+ fullyQualifiedName: 'v1.credits.getUsage',
268
+ httpMethod: 'get',
269
+ httpPath: '/api/v1/credits/usage',
270
+ },
271
+ {
272
+ clientCallName: 'client.v1.credits.listLedger',
273
+ fullyQualifiedName: 'v1.credits.listLedger',
274
+ httpMethod: 'get',
275
+ httpPath: '/api/v1/credits/ledger',
276
+ },
277
+ {
278
+ clientCallName: 'client.v1.credits.grants.create',
279
+ fullyQualifiedName: 'v1.credits.grants.create',
280
+ httpMethod: 'post',
281
+ httpPath: '/api/v1/credits/grants',
282
+ },
283
+ {
284
+ clientCallName: 'client.v1.credits.grants.list',
285
+ fullyQualifiedName: 'v1.credits.grants.list',
286
+ httpMethod: 'get',
287
+ httpPath: '/api/v1/credits/grants',
288
+ },
289
+ {
290
+ clientCallName: 'client.v1.credits.grants.void',
291
+ fullyQualifiedName: 'v1.credits.grants.void',
292
+ httpMethod: 'post',
293
+ httpPath: '/api/v1/credits/grants/{id}/void',
294
+ },
295
+ {
296
+ clientCallName: 'client.v1.credits.customCurrencies.create',
297
+ fullyQualifiedName: 'v1.credits.customCurrencies.create',
298
+ httpMethod: 'post',
299
+ httpPath: '/api/v1/credits/custom-currencies',
300
+ },
301
+ {
302
+ clientCallName: 'client.v1.credits.customCurrencies.update',
303
+ fullyQualifiedName: 'v1.credits.customCurrencies.update',
304
+ httpMethod: 'patch',
305
+ httpPath: '/api/v1/credits/custom-currencies/{currencyId}',
306
+ },
307
+ {
308
+ clientCallName: 'client.v1.credits.customCurrencies.list',
309
+ fullyQualifiedName: 'v1.credits.customCurrencies.list',
310
+ httpMethod: 'get',
311
+ httpPath: '/api/v1/credits/custom-currencies',
312
+ },
313
+ {
314
+ clientCallName: 'client.v1.credits.customCurrencies.archive',
315
+ fullyQualifiedName: 'v1.credits.customCurrencies.archive',
316
+ httpMethod: 'post',
317
+ httpPath: '/api/v1/credits/custom-currencies/{currencyId}/archive',
318
+ },
319
+ {
320
+ clientCallName: 'client.v1.credits.customCurrencies.listAssociatedEntities',
321
+ fullyQualifiedName: 'v1.credits.customCurrencies.listAssociatedEntities',
322
+ httpMethod: 'get',
323
+ httpPath: '/api/v1/credits/custom-currencies/{currencyId}/associated-entities',
324
+ },
325
+ {
326
+ clientCallName: 'client.v1.credits.customCurrencies.unarchive',
327
+ fullyQualifiedName: 'v1.credits.customCurrencies.unarchive',
328
+ httpMethod: 'post',
329
+ httpPath: '/api/v1/credits/custom-currencies/{currencyId}/unarchive',
330
+ },
331
+ {
332
+ clientCallName: 'client.v1.features.archiveFeature',
333
+ fullyQualifiedName: 'v1.features.archiveFeature',
220
334
  httpMethod: 'post',
221
335
  httpPath: '/api/v1/features/{id}/archive',
222
336
  },
223
337
  {
224
- clientCallName: 'client.v1.events.features.createFeature',
225
- fullyQualifiedName: 'v1.events.features.createFeature',
338
+ clientCallName: 'client.v1.features.createFeature',
339
+ fullyQualifiedName: 'v1.features.createFeature',
226
340
  httpMethod: 'post',
227
341
  httpPath: '/api/v1/features',
228
342
  },
229
343
  {
230
- clientCallName: 'client.v1.events.features.listFeatures',
231
- fullyQualifiedName: 'v1.events.features.listFeatures',
344
+ clientCallName: 'client.v1.features.listFeatures',
345
+ fullyQualifiedName: 'v1.features.listFeatures',
232
346
  httpMethod: 'get',
233
347
  httpPath: '/api/v1/features',
234
348
  },
235
349
  {
236
- clientCallName: 'client.v1.events.features.retrieveFeature',
237
- fullyQualifiedName: 'v1.events.features.retrieveFeature',
350
+ clientCallName: 'client.v1.features.retrieveFeature',
351
+ fullyQualifiedName: 'v1.features.retrieveFeature',
238
352
  httpMethod: 'get',
239
353
  httpPath: '/api/v1/features/{id}',
240
354
  },
241
355
  {
242
- clientCallName: 'client.v1.events.features.unarchiveFeature',
243
- fullyQualifiedName: 'v1.events.features.unarchiveFeature',
356
+ clientCallName: 'client.v1.features.unarchiveFeature',
357
+ fullyQualifiedName: 'v1.features.unarchiveFeature',
244
358
  httpMethod: 'post',
245
359
  httpPath: '/api/v1/features/{id}/unarchive',
246
360
  },
247
361
  {
248
- clientCallName: 'client.v1.events.features.updateFeature',
249
- fullyQualifiedName: 'v1.events.features.updateFeature',
362
+ clientCallName: 'client.v1.features.updateFeature',
363
+ fullyQualifiedName: 'v1.features.updateFeature',
250
364
  httpMethod: 'patch',
251
365
  httpPath: '/api/v1/features/{id}',
252
366
  },
253
367
  {
254
- clientCallName: 'client.v1.events.addons.archiveAddon',
255
- fullyQualifiedName: 'v1.events.addons.archiveAddon',
368
+ clientCallName: 'client.v1.addons.create',
369
+ fullyQualifiedName: 'v1.addons.create',
370
+ httpMethod: 'post',
371
+ httpPath: '/api/v1/addons',
372
+ },
373
+ {
374
+ clientCallName: 'client.v1.addons.retrieve',
375
+ fullyQualifiedName: 'v1.addons.retrieve',
376
+ httpMethod: 'get',
377
+ httpPath: '/api/v1/addons/{id}',
378
+ },
379
+ {
380
+ clientCallName: 'client.v1.addons.update',
381
+ fullyQualifiedName: 'v1.addons.update',
382
+ httpMethod: 'patch',
383
+ httpPath: '/api/v1/addons/{id}',
384
+ },
385
+ {
386
+ clientCallName: 'client.v1.addons.list',
387
+ fullyQualifiedName: 'v1.addons.list',
388
+ httpMethod: 'get',
389
+ httpPath: '/api/v1/addons',
390
+ },
391
+ {
392
+ clientCallName: 'client.v1.addons.archive',
393
+ fullyQualifiedName: 'v1.addons.archive',
256
394
  httpMethod: 'post',
257
395
  httpPath: '/api/v1/addons/{id}/archive',
258
396
  },
259
397
  {
260
- clientCallName: 'client.v1.events.addons.createAddon',
261
- fullyQualifiedName: 'v1.events.addons.createAddon',
398
+ clientCallName: 'client.v1.addons.createDraft',
399
+ fullyQualifiedName: 'v1.addons.createDraft',
262
400
  httpMethod: 'post',
263
- httpPath: '/api/v1/addons',
401
+ httpPath: '/api/v1/addons/{id}/draft',
264
402
  },
265
403
  {
266
- clientCallName: 'client.v1.events.addons.listAddons',
267
- fullyQualifiedName: 'v1.events.addons.listAddons',
404
+ clientCallName: 'client.v1.addons.listCharges',
405
+ fullyQualifiedName: 'v1.addons.listCharges',
268
406
  httpMethod: 'get',
269
- httpPath: '/api/v1/addons',
407
+ httpPath: '/api/v1/addons/{id}/charges',
270
408
  },
271
409
  {
272
- clientCallName: 'client.v1.events.addons.publishAddon',
273
- fullyQualifiedName: 'v1.events.addons.publishAddon',
410
+ clientCallName: 'client.v1.addons.publish',
411
+ fullyQualifiedName: 'v1.addons.publish',
274
412
  httpMethod: 'post',
275
413
  httpPath: '/api/v1/addons/{id}/publish',
276
414
  },
277
415
  {
278
- clientCallName: 'client.v1.events.addons.retrieveAddon',
279
- fullyQualifiedName: 'v1.events.addons.retrieveAddon',
280
- httpMethod: 'get',
281
- httpPath: '/api/v1/addons/{id}',
416
+ clientCallName: 'client.v1.addons.removeDraft',
417
+ fullyQualifiedName: 'v1.addons.removeDraft',
418
+ httpMethod: 'delete',
419
+ httpPath: '/api/v1/addons/{id}/draft',
282
420
  },
283
421
  {
284
- clientCallName: 'client.v1.events.addons.updateAddon',
285
- fullyQualifiedName: 'v1.events.addons.updateAddon',
422
+ clientCallName: 'client.v1.addons.entitlements.create',
423
+ fullyQualifiedName: 'v1.addons.entitlements.create',
424
+ httpMethod: 'post',
425
+ httpPath: '/api/v1/addons/{addonId}/entitlements',
426
+ },
427
+ {
428
+ clientCallName: 'client.v1.addons.entitlements.update',
429
+ fullyQualifiedName: 'v1.addons.entitlements.update',
286
430
  httpMethod: 'patch',
287
- httpPath: '/api/v1/addons/{id}',
431
+ httpPath: '/api/v1/addons/{addonId}/entitlements/{id}',
288
432
  },
289
433
  {
290
- clientCallName: 'client.v1.events.addons.draft.createAddonDraft',
291
- fullyQualifiedName: 'v1.events.addons.draft.createAddonDraft',
292
- httpMethod: 'post',
293
- httpPath: '/api/v1/addons/{id}/draft',
434
+ clientCallName: 'client.v1.addons.entitlements.list',
435
+ fullyQualifiedName: 'v1.addons.entitlements.list',
436
+ httpMethod: 'get',
437
+ httpPath: '/api/v1/addons/{addonId}/entitlements',
294
438
  },
295
439
  {
296
- clientCallName: 'client.v1.events.addons.draft.removeAddonDraft',
297
- fullyQualifiedName: 'v1.events.addons.draft.removeAddonDraft',
440
+ clientCallName: 'client.v1.addons.entitlements.delete',
441
+ fullyQualifiedName: 'v1.addons.entitlements.delete',
298
442
  httpMethod: 'delete',
299
- httpPath: '/api/v1/addons/{id}/draft',
443
+ httpPath: '/api/v1/addons/{addonId}/entitlements/{id}',
300
444
  },
301
445
  {
302
- clientCallName: 'client.v1.events.plans.create',
303
- fullyQualifiedName: 'v1.events.plans.create',
446
+ clientCallName: 'client.v1.plans.create',
447
+ fullyQualifiedName: 'v1.plans.create',
304
448
  httpMethod: 'post',
305
449
  httpPath: '/api/v1/plans',
306
450
  },
307
451
  {
308
- clientCallName: 'client.v1.events.plans.retrieve',
309
- fullyQualifiedName: 'v1.events.plans.retrieve',
452
+ clientCallName: 'client.v1.plans.retrieve',
453
+ fullyQualifiedName: 'v1.plans.retrieve',
310
454
  httpMethod: 'get',
311
455
  httpPath: '/api/v1/plans/{id}',
312
456
  },
313
457
  {
314
- clientCallName: 'client.v1.events.plans.list',
315
- fullyQualifiedName: 'v1.events.plans.list',
458
+ clientCallName: 'client.v1.plans.update',
459
+ fullyQualifiedName: 'v1.plans.update',
460
+ httpMethod: 'patch',
461
+ httpPath: '/api/v1/plans/{id}',
462
+ },
463
+ {
464
+ clientCallName: 'client.v1.plans.list',
465
+ fullyQualifiedName: 'v1.plans.list',
316
466
  httpMethod: 'get',
317
467
  httpPath: '/api/v1/plans',
318
468
  },
469
+ {
470
+ clientCallName: 'client.v1.plans.archive',
471
+ fullyQualifiedName: 'v1.plans.archive',
472
+ httpMethod: 'post',
473
+ httpPath: '/api/v1/plans/{id}/archive',
474
+ },
475
+ {
476
+ clientCallName: 'client.v1.plans.createDraft',
477
+ fullyQualifiedName: 'v1.plans.createDraft',
478
+ httpMethod: 'post',
479
+ httpPath: '/api/v1/plans/{id}/draft',
480
+ },
481
+ {
482
+ clientCallName: 'client.v1.plans.listCharges',
483
+ fullyQualifiedName: 'v1.plans.listCharges',
484
+ httpMethod: 'get',
485
+ httpPath: '/api/v1/plans/{id}/charges',
486
+ },
487
+ {
488
+ clientCallName: 'client.v1.plans.listOverageCharges',
489
+ fullyQualifiedName: 'v1.plans.listOverageCharges',
490
+ httpMethod: 'get',
491
+ httpPath: '/api/v1/plans/{id}/overage-charges',
492
+ },
493
+ {
494
+ clientCallName: 'client.v1.plans.publish',
495
+ fullyQualifiedName: 'v1.plans.publish',
496
+ httpMethod: 'post',
497
+ httpPath: '/api/v1/plans/{id}/publish',
498
+ },
499
+ {
500
+ clientCallName: 'client.v1.plans.removeDraft',
501
+ fullyQualifiedName: 'v1.plans.removeDraft',
502
+ httpMethod: 'delete',
503
+ httpPath: '/api/v1/plans/{id}/draft',
504
+ },
505
+ {
506
+ clientCallName: 'client.v1.plans.entitlements.create',
507
+ fullyQualifiedName: 'v1.plans.entitlements.create',
508
+ httpMethod: 'post',
509
+ httpPath: '/api/v1/plans/{planId}/entitlements',
510
+ },
511
+ {
512
+ clientCallName: 'client.v1.plans.entitlements.update',
513
+ fullyQualifiedName: 'v1.plans.entitlements.update',
514
+ httpMethod: 'patch',
515
+ httpPath: '/api/v1/plans/{planId}/entitlements/{id}',
516
+ },
517
+ {
518
+ clientCallName: 'client.v1.plans.entitlements.list',
519
+ fullyQualifiedName: 'v1.plans.entitlements.list',
520
+ httpMethod: 'get',
521
+ httpPath: '/api/v1/plans/{planId}/entitlements',
522
+ },
523
+ {
524
+ clientCallName: 'client.v1.plans.entitlements.delete',
525
+ fullyQualifiedName: 'v1.plans.entitlements.delete',
526
+ httpMethod: 'delete',
527
+ httpPath: '/api/v1/plans/{planId}/entitlements/{id}',
528
+ },
319
529
  {
320
530
  clientCallName: 'client.v1.usage.history',
321
531
  fullyQualifiedName: 'v1.usage.history',
@@ -364,6 +574,66 @@ export const sdkMethods: SdkMethod[] = [
364
574
  httpMethod: 'patch',
365
575
  httpPath: '/api/v1/products/{id}',
366
576
  },
577
+ {
578
+ clientCallName: 'client.v1Beta.customers.entitlements.check',
579
+ fullyQualifiedName: 'v1Beta.customers.entitlements.check',
580
+ httpMethod: 'get',
581
+ httpPath: '/api/v1-beta/customers/{id}/entitlements/check',
582
+ },
583
+ {
584
+ clientCallName: 'client.v1Beta.customers.entities.retrieve',
585
+ fullyQualifiedName: 'v1Beta.customers.entities.retrieve',
586
+ httpMethod: 'get',
587
+ httpPath: '/api/v1-beta/customers/{id}/entities/{entityId}',
588
+ },
589
+ {
590
+ clientCallName: 'client.v1Beta.customers.entities.list',
591
+ fullyQualifiedName: 'v1Beta.customers.entities.list',
592
+ httpMethod: 'get',
593
+ httpPath: '/api/v1-beta/customers/{id}/entities',
594
+ },
595
+ {
596
+ clientCallName: 'client.v1Beta.customers.entities.archive',
597
+ fullyQualifiedName: 'v1Beta.customers.entities.archive',
598
+ httpMethod: 'post',
599
+ httpPath: '/api/v1-beta/customers/{id}/entities/archive',
600
+ },
601
+ {
602
+ clientCallName: 'client.v1Beta.customers.entities.unarchive',
603
+ fullyQualifiedName: 'v1Beta.customers.entities.unarchive',
604
+ httpMethod: 'post',
605
+ httpPath: '/api/v1-beta/customers/{id}/entities/unarchive',
606
+ },
607
+ {
608
+ clientCallName: 'client.v1Beta.customers.entities.upsert',
609
+ fullyQualifiedName: 'v1Beta.customers.entities.upsert',
610
+ httpMethod: 'put',
611
+ httpPath: '/api/v1-beta/customers/{id}/entities',
612
+ },
613
+ {
614
+ clientCallName: 'client.v1Beta.customers.assignments.list',
615
+ fullyQualifiedName: 'v1Beta.customers.assignments.list',
616
+ httpMethod: 'get',
617
+ httpPath: '/api/v1-beta/customers/{id}/assignments',
618
+ },
619
+ {
620
+ clientCallName: 'client.v1Beta.customers.assignments.upsert',
621
+ fullyQualifiedName: 'v1Beta.customers.assignments.upsert',
622
+ httpMethod: 'put',
623
+ httpPath: '/api/v1-beta/customers/{id}/assignments',
624
+ },
625
+ {
626
+ clientCallName: 'client.v1Beta.entityTypes.list',
627
+ fullyQualifiedName: 'v1Beta.entityTypes.list',
628
+ httpMethod: 'get',
629
+ httpPath: '/api/v1-beta/entity-types',
630
+ },
631
+ {
632
+ clientCallName: 'client.v1Beta.entityTypes.upsert',
633
+ fullyQualifiedName: 'v1Beta.entityTypes.upsert',
634
+ httpMethod: 'put',
635
+ httpPath: '/api/v1-beta/entity-types',
636
+ },
367
637
  ];
368
638
 
369
639
  function allowedMethodsForCodeTool(options: McpOptions | undefined): SdkMethod[] | undefined {
package/src/options.ts CHANGED
@@ -8,19 +8,27 @@ import { readEnv } from './util';
8
8
 
9
9
  export type CLIOptions = McpOptions & {
10
10
  debug: boolean;
11
+ logFormat: 'json' | 'pretty';
11
12
  transport: 'stdio' | 'http';
12
13
  port: number | undefined;
13
14
  socket: string | undefined;
14
15
  };
15
16
 
16
17
  export type McpOptions = {
18
+ includeCodeTool?: boolean | undefined;
17
19
  includeDocsTools?: boolean | undefined;
18
20
  stainlessApiKey?: string | undefined;
21
+ docsSearchMode?: 'stainless-api' | 'local' | undefined;
22
+ docsDir?: string | undefined;
19
23
  codeAllowHttpGets?: boolean | undefined;
20
24
  codeAllowedMethods?: string[] | undefined;
21
25
  codeBlockedMethods?: string[] | undefined;
26
+ codeExecutionMode: McpCodeExecutionMode;
27
+ customInstructionsPath?: string | undefined;
22
28
  };
23
29
 
30
+ export type McpCodeExecutionMode = 'stainless-sandbox' | 'local';
31
+
24
32
  export function parseCLIOptions(): CLIOptions {
25
33
  const opts = yargs(hideBin(process.argv))
26
34
  .option('code-allow-http-gets', {
@@ -40,7 +48,35 @@ export function parseCLIOptions(): CLIOptions {
40
48
  description:
41
49
  'Methods to explicitly block for code tool. Evaluated as regular expressions against method fully qualified names. If all code-allow-* flags are unset, then everything is allowed.',
42
50
  })
51
+ .option('code-execution-mode', {
52
+ type: 'string',
53
+ choices: ['stainless-sandbox', 'local'],
54
+ default: 'stainless-sandbox',
55
+ description:
56
+ "Where to run code execution in code tool; 'stainless-sandbox' will execute code in Stainless-hosted sandboxes whereas 'local' will execute code locally on the MCP server machine.",
57
+ })
58
+ .option('custom-instructions-path', {
59
+ type: 'string',
60
+ description: 'Path to custom instructions for the MCP server',
61
+ })
43
62
  .option('debug', { type: 'boolean', description: 'Enable debug logging' })
63
+ .option('docs-dir', {
64
+ type: 'string',
65
+ description:
66
+ 'Path to a directory of local documentation files (markdown/JSON) to include in local docs search.',
67
+ })
68
+ .option('docs-search-mode', {
69
+ type: 'string',
70
+ choices: ['stainless-api', 'local'],
71
+ default: 'stainless-api',
72
+ description:
73
+ "Where to search documentation; 'stainless-api' uses the Stainless-hosted search API whereas 'local' uses an in-memory search index built from embedded SDK method data and optional local docs files.",
74
+ })
75
+ .option('log-format', {
76
+ type: 'string',
77
+ choices: ['json', 'pretty'],
78
+ description: 'Format for log output; defaults to json unless tty is detected',
79
+ })
44
80
  .option('no-tools', {
45
81
  type: 'string',
46
82
  array: true,
@@ -82,18 +118,29 @@ export function parseCLIOptions(): CLIOptions {
82
118
  : argv.tools?.includes(toolType) ? true
83
119
  : undefined;
84
120
 
121
+ const includeCodeTool = shouldIncludeToolType('code');
85
122
  const includeDocsTools = shouldIncludeToolType('docs');
86
123
 
87
124
  const transport = argv.transport as 'stdio' | 'http';
125
+ const logFormat =
126
+ argv.logFormat ? (argv.logFormat as 'json' | 'pretty')
127
+ : process.stderr.isTTY ? 'pretty'
128
+ : 'json';
88
129
 
89
130
  return {
131
+ ...(includeCodeTool !== undefined && { includeCodeTool }),
90
132
  ...(includeDocsTools !== undefined && { includeDocsTools }),
91
133
  debug: !!argv.debug,
92
134
  stainlessApiKey: argv.stainlessApiKey,
135
+ docsSearchMode: argv.docsSearchMode as 'stainless-api' | 'local' | undefined,
136
+ docsDir: argv.docsDir,
93
137
  codeAllowHttpGets: argv.codeAllowHttpGets,
94
138
  codeAllowedMethods: argv.codeAllowedMethods,
95
139
  codeBlockedMethods: argv.codeBlockedMethods,
140
+ codeExecutionMode: argv.codeExecutionMode as McpCodeExecutionMode,
141
+ customInstructionsPath: argv.customInstructionsPath,
96
142
  transport,
143
+ logFormat,
97
144
  port: argv.port,
98
145
  socket: argv.socket,
99
146
  };
@@ -118,12 +165,21 @@ export function parseQueryOptions(defaultOptions: McpOptions, query: unknown): M
118
165
  const queryObject = typeof query === 'string' ? qs.parse(query) : query;
119
166
  const queryOptions = QueryOptions.parse(queryObject);
120
167
 
168
+ let codeTool: boolean | undefined =
169
+ queryOptions.no_tools && queryOptions.no_tools?.includes('code') ? false
170
+ : queryOptions.tools?.includes('code') ? true
171
+ : defaultOptions.includeCodeTool;
172
+
121
173
  let docsTools: boolean | undefined =
122
174
  queryOptions.no_tools && queryOptions.no_tools?.includes('docs') ? false
123
175
  : queryOptions.tools?.includes('docs') ? true
124
176
  : defaultOptions.includeDocsTools;
125
177
 
126
178
  return {
179
+ ...(codeTool !== undefined && { includeCodeTool: codeTool }),
127
180
  ...(docsTools !== undefined && { includeDocsTools: docsTools }),
181
+ codeExecutionMode: defaultOptions.codeExecutionMode,
182
+ docsSearchMode: defaultOptions.docsSearchMode,
183
+ docsDir: defaultOptions.docsDir,
128
184
  };
129
185
  }