@smithery/api 0.65.1 → 0.66.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 (48) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/client.d.mts +9 -3
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +9 -3
  5. package/client.d.ts.map +1 -1
  6. package/client.js +9 -2
  7. package/client.js.map +1 -1
  8. package/client.mjs +9 -2
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/connections/connections.d.mts +25 -10
  12. package/resources/connections/connections.d.mts.map +1 -1
  13. package/resources/connections/connections.d.ts +25 -10
  14. package/resources/connections/connections.d.ts.map +1 -1
  15. package/resources/connections/connections.js +5 -4
  16. package/resources/connections/connections.js.map +1 -1
  17. package/resources/connections/connections.mjs +5 -4
  18. package/resources/connections/connections.mjs.map +1 -1
  19. package/resources/index.d.mts +1 -1
  20. package/resources/index.d.mts.map +1 -1
  21. package/resources/index.d.ts +1 -1
  22. package/resources/index.d.ts.map +1 -1
  23. package/resources/index.js.map +1 -1
  24. package/resources/index.mjs.map +1 -1
  25. package/resources/servers/index.d.mts +1 -1
  26. package/resources/servers/index.d.mts.map +1 -1
  27. package/resources/servers/index.d.ts +1 -1
  28. package/resources/servers/index.d.ts.map +1 -1
  29. package/resources/servers/index.js.map +1 -1
  30. package/resources/servers/index.mjs.map +1 -1
  31. package/resources/servers/servers.d.mts +28 -1
  32. package/resources/servers/servers.d.mts.map +1 -1
  33. package/resources/servers/servers.d.ts +28 -1
  34. package/resources/servers/servers.d.ts.map +1 -1
  35. package/resources/servers/servers.js +18 -0
  36. package/resources/servers/servers.js.map +1 -1
  37. package/resources/servers/servers.mjs +18 -0
  38. package/resources/servers/servers.mjs.map +1 -1
  39. package/src/client.ts +21 -1
  40. package/src/resources/connections/connections.ts +28 -10
  41. package/src/resources/index.ts +2 -0
  42. package/src/resources/servers/index.ts +2 -0
  43. package/src/resources/servers/servers.ts +43 -0
  44. package/src/version.ts +1 -1
  45. package/version.d.mts +1 -1
  46. package/version.d.ts +1 -1
  47. package/version.js +1 -1
  48. package/version.mjs +1 -1
package/src/client.ts CHANGED
@@ -89,6 +89,8 @@ import {
89
89
  ServerListParams,
90
90
  ServerListResponse,
91
91
  ServerListResponsesSmitheryPage,
92
+ ServerTransferParams,
93
+ ServerTransferResponse,
92
94
  ServerUpdateParams,
93
95
  ServerUpdateResponse,
94
96
  Servers,
@@ -112,6 +114,11 @@ export interface ClientOptions {
112
114
  */
113
115
  apiKey?: string | undefined;
114
116
 
117
+ /**
118
+ * Base URL for Smithery Connect REST methods.
119
+ */
120
+ connectBaseURL?: string | null | undefined;
121
+
115
122
  /**
116
123
  * Override the default base URL for the API, e.g., "https://api.example.com/v2/"
117
124
  *
@@ -186,6 +193,7 @@ export interface ClientOptions {
186
193
  */
187
194
  export class Smithery {
188
195
  apiKey: string;
196
+ connectBaseURL: string | null;
189
197
 
190
198
  baseURL: string;
191
199
  maxRetries: number;
@@ -203,6 +211,7 @@ export class Smithery {
203
211
  * API Client for interfacing with the Smithery API.
204
212
  *
205
213
  * @param {string | undefined} [opts.apiKey=process.env['SMITHERY_API_KEY'] ?? undefined]
214
+ * @param {string | null | undefined} [opts.connectBaseURL=process.env['SMITHERY_CONNECT_BASE_URL'] ?? https://smithery.run]
206
215
  * @param {string} [opts.baseURL=process.env['SMITHERY_BASE_URL'] ?? https://api.smithery.ai] - Override the default base URL for the API.
207
216
  * @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
208
217
  * @param {MergedRequestInit} [opts.fetchOptions] - Additional `RequestInit` options to be passed to `fetch` calls.
@@ -214,6 +223,7 @@ export class Smithery {
214
223
  constructor({
215
224
  baseURL = readEnv('SMITHERY_BASE_URL'),
216
225
  apiKey = readEnv('SMITHERY_API_KEY'),
226
+ connectBaseURL = readEnv('SMITHERY_CONNECT_BASE_URL') ?? 'https://smithery.run',
217
227
  ...opts
218
228
  }: ClientOptions = {}) {
219
229
  if (apiKey === undefined) {
@@ -224,6 +234,7 @@ export class Smithery {
224
234
 
225
235
  const options: ClientOptions = {
226
236
  apiKey,
237
+ connectBaseURL,
227
238
  ...opts,
228
239
  baseURL: baseURL || `https://api.smithery.ai`,
229
240
  };
@@ -258,6 +269,7 @@ export class Smithery {
258
269
  this._options = options;
259
270
 
260
271
  this.apiKey = apiKey;
272
+ this.connectBaseURL = connectBaseURL;
261
273
  }
262
274
 
263
275
  /**
@@ -274,6 +286,7 @@ export class Smithery {
274
286
  fetch: this.fetch,
275
287
  fetchOptions: this.fetchOptions,
276
288
  apiKey: this.apiKey,
289
+ connectBaseURL: this.connectBaseURL,
277
290
  ...options,
278
291
  });
279
292
  return client;
@@ -324,7 +337,12 @@ export class Smithery {
324
337
  query: Record<string, unknown> | null | undefined,
325
338
  defaultBaseURL?: string | undefined,
326
339
  ): string {
327
- const baseURL = (!this.#baseURLOverridden() && defaultBaseURL) || this.baseURL;
340
+ const resolvedDefaultBaseURL =
341
+ defaultBaseURL === 'https://smithery.run' ? this.connectBaseURL || defaultBaseURL : defaultBaseURL;
342
+ const baseURL =
343
+ (defaultBaseURL === 'https://smithery.run' && resolvedDefaultBaseURL) ||
344
+ (!this.#baseURLOverridden() && resolvedDefaultBaseURL) ||
345
+ this.baseURL;
328
346
  const url =
329
347
  isAbsoluteURL(path) ?
330
348
  new URL(path)
@@ -879,10 +897,12 @@ export declare namespace Smithery {
879
897
  type ServerListResponse as ServerListResponse,
880
898
  type ServerDeleteResponse as ServerDeleteResponse,
881
899
  type ServerGetResponse as ServerGetResponse,
900
+ type ServerTransferResponse as ServerTransferResponse,
882
901
  type ServerListResponsesSmitheryPage as ServerListResponsesSmitheryPage,
883
902
  type ServerCreateParams as ServerCreateParams,
884
903
  type ServerUpdateParams as ServerUpdateParams,
885
904
  type ServerListParams as ServerListParams,
905
+ type ServerTransferParams as ServerTransferParams,
886
906
  };
887
907
 
888
908
  export {
@@ -126,10 +126,11 @@ export class Connections extends APIResource {
126
126
  }
127
127
 
128
128
  /**
129
- * Create or update an MCP connection with the given ID. mcpUrl is required when
130
- * creating a new connection, but optional when updating. Returns 409 if a
131
- * different mcpUrl is provided, except while the connection is input_required and
132
- * the new URL keeps the same host and path.
129
+ * Create or update an MCP connection with the given ID. `server` is the Smithery
130
+ * registry qualified name; `mcpUrl` is for custom MCP URLs. One of them is
131
+ * required when creating a new HTTP connection, but optional when updating.
132
+ * Returns 409 if a different target URL is provided, except while the connection
133
+ * is input_required and the new URL keeps the same host and path.
133
134
  *
134
135
  * @example
135
136
  * ```ts
@@ -342,8 +343,7 @@ export interface CreateConnectionRequest {
342
343
  headers?: { [key: string]: string };
343
344
 
344
345
  /**
345
- * URL of the MCP server. Required for HTTP connections. Omit for uplink
346
- * connections.
346
+ * URL of a custom MCP server. For Smithery registry servers, prefer `server`.
347
347
  */
348
348
  mcpUrl?: string;
349
349
 
@@ -365,6 +365,12 @@ export interface CreateConnectionRequest {
365
365
  */
366
366
  name?: string;
367
367
 
368
+ /**
369
+ * Smithery registry server qualified name. Use this instead of mcpUrl for registry
370
+ * servers.
371
+ */
372
+ server?: string;
373
+
368
374
  /**
369
375
  * Connection transport. Use `uplink` for a local server paired over Smithery CLI.
370
376
  */
@@ -404,8 +410,7 @@ export interface ConnectionCreateParams {
404
410
  headers?: { [key: string]: string };
405
411
 
406
412
  /**
407
- * URL of the MCP server. Required for HTTP connections. Omit for uplink
408
- * connections.
413
+ * URL of a custom MCP server. For Smithery registry servers, prefer `server`.
409
414
  */
410
415
  mcpUrl?: string;
411
416
 
@@ -427,6 +432,12 @@ export interface ConnectionCreateParams {
427
432
  */
428
433
  name?: string;
429
434
 
435
+ /**
436
+ * Smithery registry server qualified name. Use this instead of mcpUrl for registry
437
+ * servers.
438
+ */
439
+ server?: string;
440
+
430
441
  /**
431
442
  * Connection transport. Use `uplink` for a local server paired over Smithery CLI.
432
443
  */
@@ -497,8 +508,9 @@ export interface ConnectionSetParams {
497
508
  headers?: { [key: string]: string };
498
509
 
499
510
  /**
500
- * Body param: URL of the MCP server. Required when creating a new connection.
501
- * Optional when updating omit to keep the existing URL.
511
+ * Body param: URL of a custom MCP server. For Smithery registry servers, prefer
512
+ * `server`. Required with `server` omitted when creating a new HTTP connection;
513
+ * optional when updating.
502
514
  */
503
515
  mcpUrl?: string;
504
516
 
@@ -518,6 +530,12 @@ export interface ConnectionSetParams {
518
530
  */
519
531
  name?: string;
520
532
 
533
+ /**
534
+ * Body param: Smithery registry server qualified name. Use this instead of mcpUrl
535
+ * for registry servers.
536
+ */
537
+ server?: string;
538
+
521
539
  /**
522
540
  * Body param: Connection transport. Defaults to the existing connection transport
523
541
  * when updating.
@@ -33,9 +33,11 @@ export {
33
33
  type ServerListResponse,
34
34
  type ServerDeleteResponse,
35
35
  type ServerGetResponse,
36
+ type ServerTransferResponse,
36
37
  type ServerCreateParams,
37
38
  type ServerUpdateParams,
38
39
  type ServerListParams,
40
+ type ServerTransferParams,
39
41
  type ServerListResponsesSmitheryPage,
40
42
  } from './servers/servers';
41
43
  export {
@@ -44,8 +44,10 @@ export {
44
44
  type ServerListResponse,
45
45
  type ServerDeleteResponse,
46
46
  type ServerGetResponse,
47
+ type ServerTransferResponse,
47
48
  type ServerCreateParams,
48
49
  type ServerUpdateParams,
49
50
  type ServerListParams,
51
+ type ServerTransferParams,
50
52
  type ServerListResponsesSmitheryPage,
51
53
  } from './servers';
@@ -149,6 +149,29 @@ export class Servers extends APIResource {
149
149
  get(qualifiedName: string, options?: RequestOptions): APIPromise<ServerGetResponse> {
150
150
  return this._client.get(path`/servers/${qualifiedName}`, options);
151
151
  }
152
+
153
+ /**
154
+ * Move a server to another namespace. The caller must have server write access to
155
+ * both the source namespace and the destination namespace.
156
+ *
157
+ * @example
158
+ * ```ts
159
+ * const response = await client.servers.transfer(
160
+ * 'qualifiedName',
161
+ * {
162
+ * targetNamespace: 'my-team',
163
+ * targetOrganizationId: 'org_01H1234567890',
164
+ * },
165
+ * );
166
+ * ```
167
+ */
168
+ transfer(
169
+ qualifiedName: string,
170
+ body: ServerTransferParams,
171
+ options?: RequestOptions,
172
+ ): APIPromise<ServerTransferResponse> {
173
+ return this._client.post(path`/servers/${qualifiedName}/transfer`, { body, ...options });
174
+ }
152
175
  }
153
176
 
154
177
  export type ServerListResponsesSmitheryPage = SmitheryPage<ServerListResponse>;
@@ -413,6 +436,16 @@ export namespace ServerGetResponse {
413
436
  }
414
437
  }
415
438
 
439
+ export interface ServerTransferResponse {
440
+ namespace: string;
441
+
442
+ qualifiedName: string;
443
+
444
+ server: string;
445
+
446
+ success: boolean;
447
+ }
448
+
416
449
  export interface ServerCreateParams {
417
450
  description?: string;
418
451
 
@@ -516,6 +549,14 @@ export interface ServerListParams extends SmitheryPageParams {
516
549
  verified?: '0' | '1' | 'true' | 'false';
517
550
  }
518
551
 
552
+ export interface ServerTransferParams {
553
+ targetNamespace: string;
554
+
555
+ targetOrganizationId: string;
556
+
557
+ targetSlug?: string;
558
+ }
559
+
519
560
  Servers.Releases = Releases;
520
561
  Servers.Logs = Logs;
521
562
  Servers.Secrets = Secrets;
@@ -532,10 +573,12 @@ export declare namespace Servers {
532
573
  type ServerListResponse as ServerListResponse,
533
574
  type ServerDeleteResponse as ServerDeleteResponse,
534
575
  type ServerGetResponse as ServerGetResponse,
576
+ type ServerTransferResponse as ServerTransferResponse,
535
577
  type ServerListResponsesSmitheryPage as ServerListResponsesSmitheryPage,
536
578
  type ServerCreateParams as ServerCreateParams,
537
579
  type ServerUpdateParams as ServerUpdateParams,
538
580
  type ServerListParams as ServerListParams,
581
+ type ServerTransferParams as ServerTransferParams,
539
582
  };
540
583
 
541
584
  export {
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.65.1'; // x-release-please-version
1
+ export const VERSION = '0.66.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.65.1";
1
+ export declare const VERSION = "0.66.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.65.1";
1
+ export declare const VERSION = "0.66.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.65.1'; // x-release-please-version
4
+ exports.VERSION = '0.66.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.65.1'; // x-release-please-version
1
+ export const VERSION = '0.66.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map