@smithery/sdk 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config.d.ts +1 -1
- package/dist/config.js +4 -1
- package/dist/transport.d.ts +2 -1
- package/dist/transport.js +3 -2
- package/package.json +1 -1
package/dist/config.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function createSmitheryUrl(baseUrl: string, config?: object): URL;
|
|
1
|
+
export declare function createSmitheryUrl(baseUrl: string, config?: object, apiKey?: string): URL;
|
package/dist/config.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export function createSmitheryUrl(baseUrl, config) {
|
|
1
|
+
export function createSmitheryUrl(baseUrl, config, apiKey) {
|
|
2
2
|
const url = new URL(baseUrl);
|
|
3
3
|
if (config) {
|
|
4
4
|
const param = typeof window !== "undefined"
|
|
@@ -6,5 +6,8 @@ export function createSmitheryUrl(baseUrl, config) {
|
|
|
6
6
|
: Buffer.from(JSON.stringify(config)).toString("base64");
|
|
7
7
|
url.searchParams.set("config", param);
|
|
8
8
|
}
|
|
9
|
+
if (apiKey) {
|
|
10
|
+
url.searchParams.set("api_key", apiKey);
|
|
11
|
+
}
|
|
9
12
|
return url;
|
|
10
13
|
}
|
package/dist/transport.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { WebSocketClientTransport } from "@modelcontextprotocol/sdk/client/webso
|
|
|
3
3
|
* Creates a transport to connect to the Smithery server
|
|
4
4
|
* @param smitheryServerUrl The URL of the Smithery server (without trailing slash or protocol)
|
|
5
5
|
* @param config Config to pass to the server
|
|
6
|
+
* @param apiKey Optional API key for authentication
|
|
6
7
|
* @returns Transport
|
|
7
8
|
*/
|
|
8
|
-
export declare function createTransport(smitheryServerUrl: string, config?: object): WebSocketClientTransport;
|
|
9
|
+
export declare function createTransport(smitheryServerUrl: string, config?: object, apiKey?: string): WebSocketClientTransport;
|
package/dist/transport.js
CHANGED
|
@@ -4,8 +4,9 @@ import { createSmitheryUrl } from "./config.js";
|
|
|
4
4
|
* Creates a transport to connect to the Smithery server
|
|
5
5
|
* @param smitheryServerUrl The URL of the Smithery server (without trailing slash or protocol)
|
|
6
6
|
* @param config Config to pass to the server
|
|
7
|
+
* @param apiKey Optional API key for authentication
|
|
7
8
|
* @returns Transport
|
|
8
9
|
*/
|
|
9
|
-
export function createTransport(smitheryServerUrl, config) {
|
|
10
|
-
return new WebSocketClientTransport(createSmitheryUrl(`${smitheryServerUrl}/ws`, config));
|
|
10
|
+
export function createTransport(smitheryServerUrl, config, apiKey) {
|
|
11
|
+
return new WebSocketClientTransport(createSmitheryUrl(`${smitheryServerUrl}/ws`, config, apiKey));
|
|
11
12
|
}
|