@smithery/sdk 0.0.10 → 0.0.11
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/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/registry.d.ts +25 -1
- package/dist/registry.js +17 -1
- package/package.json +2 -3
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
|
3
3
|
import type { RequestOptions } from "@modelcontextprotocol/sdk/shared/protocol.js";
|
|
4
4
|
import type { Transport } from "@modelcontextprotocol/sdk/shared/transport.js";
|
|
5
5
|
import { type CallToolRequest, CallToolResultSchema, type CompatibilityCallToolResultSchema, type ListToolsRequest, type Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
6
|
-
export { createTransport, createStdioConfig, fetchRegistryEntry } from "./registry.js";
|
|
6
|
+
export { createRegistryTransport as createTransport, createStdioConfig, fetchRegistryEntry, } from "./registry.js";
|
|
7
7
|
export { OpenAIChatAdapter } from "./integrations/llm/openai.js";
|
|
8
8
|
export { AnthropicChatAdapter } from "./integrations/llm/anthropic.js";
|
|
9
9
|
interface ClientInfo {
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
|
|
2
2
|
import { InMemoryTransport } from "@modelcontextprotocol/sdk/inMemory.js";
|
|
3
3
|
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
4
4
|
import { CallToolResultSchema, } from "@modelcontextprotocol/sdk/types.js";
|
|
5
|
-
export { createTransport, createStdioConfig, fetchRegistryEntry } from "./registry.js";
|
|
5
|
+
export { createRegistryTransport as createTransport, createStdioConfig, fetchRegistryEntry, } from "./registry.js";
|
|
6
6
|
export { OpenAIChatAdapter } from "./integrations/llm/openai.js";
|
|
7
7
|
export { AnthropicChatAdapter } from "./integrations/llm/anthropic.js";
|
|
8
8
|
/**
|
package/dist/registry.d.ts
CHANGED
|
@@ -1,6 +1,30 @@
|
|
|
1
|
+
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
|
1
2
|
import type { StdioServerParameters } from "@modelcontextprotocol/sdk/client/stdio.js";
|
|
2
3
|
import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
|
|
3
4
|
import { type JSONSchema, type RegistryServer, type StdioConnection } from "./registry-types.js";
|
|
4
5
|
export declare function createStdioConfig(pkg: RegistryServer, variables: JSONSchema): StdioConnection;
|
|
5
6
|
export declare function fetchRegistryEntry(id: string): Promise<RegistryServer>;
|
|
6
|
-
export declare function
|
|
7
|
+
export declare function createRegistryTransport(id: string, variables?: JSONSchema, options?: Partial<StdioServerParameters>): Promise<StdioClientTransport>;
|
|
8
|
+
/**
|
|
9
|
+
* A short cut to create a client that connects to a registry entry and is ready to use
|
|
10
|
+
* @param id ID of the registry entry
|
|
11
|
+
*/
|
|
12
|
+
export declare function createRegistryClient(id: string, variables?: JSONSchema, options?: Partial<StdioServerParameters>): Promise<Client<{
|
|
13
|
+
method: string;
|
|
14
|
+
params?: import("zod").objectOutputType<{
|
|
15
|
+
_meta: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
16
|
+
progressToken: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodNumber]>>;
|
|
17
|
+
}, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{
|
|
18
|
+
progressToken: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodNumber]>>;
|
|
19
|
+
}, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{
|
|
20
|
+
progressToken: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodNumber]>>;
|
|
21
|
+
}, import("zod").ZodTypeAny, "passthrough">>>;
|
|
22
|
+
}, import("zod").ZodTypeAny, "passthrough"> | undefined;
|
|
23
|
+
}, {
|
|
24
|
+
method: string;
|
|
25
|
+
params?: import("zod").objectOutputType<{
|
|
26
|
+
_meta: import("zod").ZodOptional<import("zod").ZodObject<{}, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{}, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>;
|
|
27
|
+
}, import("zod").ZodTypeAny, "passthrough"> | undefined;
|
|
28
|
+
}, import("zod").objectOutputType<{
|
|
29
|
+
_meta: import("zod").ZodOptional<import("zod").ZodObject<{}, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{}, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>;
|
|
30
|
+
}, import("zod").ZodTypeAny, "passthrough">>>;
|
package/dist/registry.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
|
1
2
|
import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
|
|
2
3
|
import { REGISTRY_URL } from "./config.js";
|
|
3
4
|
import { isStdio, } from "./registry-types.js";
|
|
@@ -36,12 +37,27 @@ export async function fetchRegistryEntry(id) {
|
|
|
36
37
|
}
|
|
37
38
|
return await response.json();
|
|
38
39
|
}
|
|
39
|
-
export async function
|
|
40
|
+
export async function createRegistryTransport(id, variables = {}, options = {}) {
|
|
40
41
|
const pkg = await fetchRegistryEntry(id);
|
|
41
42
|
const config = createStdioConfig(pkg, variables);
|
|
42
43
|
const transport = new StdioClientTransport({ ...config, ...options });
|
|
43
44
|
return transport;
|
|
44
45
|
}
|
|
46
|
+
/**
|
|
47
|
+
* A short cut to create a client that connects to a registry entry and is ready to use
|
|
48
|
+
* @param id ID of the registry entry
|
|
49
|
+
*/
|
|
50
|
+
export async function createRegistryClient(id, variables = {}, options = {}) {
|
|
51
|
+
const transport = await createRegistryTransport(id, variables, options);
|
|
52
|
+
const client = new Client({
|
|
53
|
+
name: "mcp-client",
|
|
54
|
+
version: "1.0.0",
|
|
55
|
+
}, {
|
|
56
|
+
capabilities: {},
|
|
57
|
+
});
|
|
58
|
+
await client.connect(transport);
|
|
59
|
+
return client;
|
|
60
|
+
}
|
|
45
61
|
// Example usage:
|
|
46
62
|
/*
|
|
47
63
|
const transport = await createTransport("brave-search", {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smithery/sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.11",
|
|
4
4
|
"description": "Connect language models to Model Context Protocols",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -16,8 +16,7 @@
|
|
|
16
16
|
"build": "tsc",
|
|
17
17
|
"build:all": "npm run build -ws --include-workspace-root",
|
|
18
18
|
"watch": "tsc --watch",
|
|
19
|
-
"
|
|
20
|
-
"format": "npx @biomejs/biome format --write",
|
|
19
|
+
"check": "npx @biomejs/biome check --write --unsafe",
|
|
21
20
|
"bump": "npm version patch -ws --include-workspace-root",
|
|
22
21
|
"link": "npm link -ws --include-workspace-root"
|
|
23
22
|
},
|