@smithery/sdk 4.0.1 → 4.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.
- package/LICENSE +20 -0
- package/README.md +86 -4
- package/dist/index.d.ts +0 -1
- package/dist/index.js +1 -4
- package/dist/types/index.d.ts +69 -0
- package/package.json +1 -5
- package/dist/bundle/config.d.ts +0 -16
- package/dist/bundle/config.js +0 -1
- package/dist/bundle/deploy-payload.d.ts +0 -120
- package/dist/bundle/deploy-payload.js +0 -22
- package/dist/bundle/index.d.ts +0 -7
- package/dist/bundle/index.js +0 -7
- package/dist/bundle/limits.d.ts +0 -7
- package/dist/bundle/limits.js +0 -7
- package/dist/bundle/server-card.d.ts +0 -108
- package/dist/bundle/server-card.js +0 -16
package/LICENSE
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
Copyright (c) 2025 Smithery
|
|
3
|
+
|
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
6
|
+
in the Software without restriction, including without limitation the rights
|
|
7
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
9
|
+
furnished to do so, subject to the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be included in all
|
|
12
|
+
copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
16
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
17
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
18
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
19
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,6 +1,88 @@
|
|
|
1
|
-
# Smithery
|
|
1
|
+
# Smithery SDK
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/@smithery/sdk)
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
TypeScript types for building MCP servers on the Smithery hosted runtime.
|
|
6
|
+
|
|
7
|
+
Docs: https://smithery.ai/docs/build
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install @smithery/sdk
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
The SDK provides types for the Smithery runtime context that your MCP server receives when deployed.
|
|
18
|
+
|
|
19
|
+
```typescript
|
|
20
|
+
import type {
|
|
21
|
+
ServerModule,
|
|
22
|
+
ServerContext,
|
|
23
|
+
Session,
|
|
24
|
+
} from "@smithery/sdk"
|
|
25
|
+
import { z } from "zod"
|
|
26
|
+
|
|
27
|
+
// Define your configuration schema
|
|
28
|
+
export const configSchema = z.object({
|
|
29
|
+
apiKey: z.string(),
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
// Create your server
|
|
33
|
+
export default const createServer = async (context: ServerContext<z.infer<typeof configSchema>>) => {
|
|
34
|
+
const { config, env } = context
|
|
35
|
+
|
|
36
|
+
// Access user configuration
|
|
37
|
+
console.log(config.apiKey)
|
|
38
|
+
|
|
39
|
+
// Access environment variables
|
|
40
|
+
console.log(env.MY_SECRET)
|
|
41
|
+
|
|
42
|
+
// For stateful servers, access session storage
|
|
43
|
+
if ("session" in context) {
|
|
44
|
+
await context.session.set("key", "value")
|
|
45
|
+
const value = await context.session.get("key")
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// Return your MCP server instance
|
|
49
|
+
return new Server({ name: "my-server", version: "1.0.0" }, { capabilities: {} })
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Types
|
|
55
|
+
|
|
56
|
+
### `ServerContext<TConfig>`
|
|
57
|
+
|
|
58
|
+
The context object passed to your server factory function:
|
|
59
|
+
|
|
60
|
+
- `config: TConfig` - User-provided configuration (validated against your `configSchema`)
|
|
61
|
+
- `env: Record<string, string | undefined>` - Environment variables
|
|
62
|
+
- `session?: Session` - Session storage (only for stateful servers)
|
|
63
|
+
|
|
64
|
+
### `Session`
|
|
65
|
+
|
|
66
|
+
Key-value storage scoped to the user session:
|
|
67
|
+
|
|
68
|
+
- `get<T>(key: string): Promise<T | undefined>`
|
|
69
|
+
- `set(key: string, value: unknown): Promise<void>`
|
|
70
|
+
- `delete(key: string): Promise<void>`
|
|
71
|
+
|
|
72
|
+
### `ServerModule<TConfig>`
|
|
73
|
+
|
|
74
|
+
The expected exports from your server entry point:
|
|
75
|
+
|
|
76
|
+
- `default: CreateServerFn<TConfig>` - Factory function that creates your MCP server
|
|
77
|
+
- `configSchema?: z.ZodSchema<TConfig>` - Zod schema for configuration validation
|
|
78
|
+
- `createSandboxServer?: CreateSandboxServerFn` - Optional function for deployment scanning
|
|
79
|
+
- `stateful?: boolean` - Whether the server maintains state between requests (default: `false`)
|
|
80
|
+
|
|
81
|
+
## Documentation
|
|
82
|
+
|
|
83
|
+
For complete documentation, see:
|
|
84
|
+
- [Quickstart Guide](https://smithery.ai/docs/build/quickstart)
|
|
85
|
+
|
|
86
|
+
## License
|
|
87
|
+
|
|
88
|
+
MIT
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
2
|
+
import type { Notification } from "@modelcontextprotocol/sdk/types.js";
|
|
2
3
|
import type { z } from "zod";
|
|
3
4
|
export type Session = {
|
|
4
5
|
id: string;
|
|
@@ -21,6 +22,70 @@ export type SandboxServerContext = {
|
|
|
21
22
|
};
|
|
22
23
|
export type CreateServerFn<TConfig = unknown> = (context: ServerContext<TConfig>) => Server | Promise<Server>;
|
|
23
24
|
export type CreateSandboxServerFn = (context: SandboxServerContext) => Server | Promise<Server>;
|
|
25
|
+
/**
|
|
26
|
+
* OAuth adapter for servers that require user authorization.
|
|
27
|
+
* @unstable This interface is subject to change.
|
|
28
|
+
*/
|
|
29
|
+
export interface AuthAdapter {
|
|
30
|
+
getAuthorizationUrl(args: {
|
|
31
|
+
callbackUrl: string;
|
|
32
|
+
state: string;
|
|
33
|
+
codeChallenge?: string;
|
|
34
|
+
config: unknown;
|
|
35
|
+
}): Promise<{
|
|
36
|
+
authorizationUrl: string;
|
|
37
|
+
}>;
|
|
38
|
+
exchangeCode(args: {
|
|
39
|
+
code: string;
|
|
40
|
+
callbackUrl: string;
|
|
41
|
+
codeVerifier?: string;
|
|
42
|
+
config: unknown;
|
|
43
|
+
}): Promise<{
|
|
44
|
+
accessToken: string;
|
|
45
|
+
refreshToken?: string;
|
|
46
|
+
expiresIn?: number;
|
|
47
|
+
}>;
|
|
48
|
+
refreshToken(args: {
|
|
49
|
+
refreshToken: string;
|
|
50
|
+
config: unknown;
|
|
51
|
+
}): Promise<{
|
|
52
|
+
accessToken: string;
|
|
53
|
+
refreshToken?: string;
|
|
54
|
+
expiresIn?: number;
|
|
55
|
+
}>;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Context passed to handleHttp for stateless servers.
|
|
59
|
+
* @unstable This type is subject to change.
|
|
60
|
+
*/
|
|
61
|
+
export type StatelessHttpContext = {
|
|
62
|
+
env: Record<string, string | undefined>;
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* Context passed to handleHttp for stateful servers.
|
|
66
|
+
* @unstable This type is subject to change.
|
|
67
|
+
*/
|
|
68
|
+
export type StatefulHttpContext = {
|
|
69
|
+
env: Record<string, string | undefined>;
|
|
70
|
+
sessions: {
|
|
71
|
+
/**
|
|
72
|
+
* Send a notification directly to the connected client (via `transport.send()`),
|
|
73
|
+
* bypassing the server's notification handler chain.
|
|
74
|
+
* Use this for webhook → client notification routing.
|
|
75
|
+
*/
|
|
76
|
+
notify(sessionId: string, notification: Notification): Promise<void>;
|
|
77
|
+
/**
|
|
78
|
+
* Inject a raw JSON-RPC message into the server's handler chain for processing.
|
|
79
|
+
* The server's registered request/notification handlers will be invoked.
|
|
80
|
+
*/
|
|
81
|
+
dispatch(sessionId: string, message: unknown): Promise<void>;
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* Handler for non-MCP HTTP requests (e.g. webhook endpoints on subpaths).
|
|
86
|
+
* @unstable This type is subject to change.
|
|
87
|
+
*/
|
|
88
|
+
export type HandleHttpFn = (request: Request, context: StatelessHttpContext | StatefulHttpContext) => Promise<Response>;
|
|
24
89
|
/**
|
|
25
90
|
* ServerModule - expected exports from an MCP server entry point
|
|
26
91
|
*/
|
|
@@ -35,4 +100,8 @@ export interface ServerModule<TConfig = unknown> {
|
|
|
35
100
|
* @default false
|
|
36
101
|
*/
|
|
37
102
|
stateful?: boolean;
|
|
103
|
+
createAuthAdapter?: (context: {
|
|
104
|
+
env: Record<string, unknown>;
|
|
105
|
+
}) => Promise<AuthAdapter>;
|
|
106
|
+
handleHttp?: HandleHttpFn;
|
|
38
107
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smithery/sdk",
|
|
3
|
-
"version": "4.0
|
|
3
|
+
"version": "4.2.0",
|
|
4
4
|
"description": "SDK to develop with Smithery",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -13,10 +13,6 @@
|
|
|
13
13
|
".": {
|
|
14
14
|
"types": "./dist/index.d.ts",
|
|
15
15
|
"default": "./dist/index.js"
|
|
16
|
-
},
|
|
17
|
-
"./bundle": {
|
|
18
|
-
"types": "./dist/bundle/index.d.ts",
|
|
19
|
-
"default": "./dist/bundle/index.js"
|
|
20
16
|
}
|
|
21
17
|
},
|
|
22
18
|
"files": [
|
package/dist/bundle/config.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Config - loaded from smithery.config.ts
|
|
3
|
-
*/
|
|
4
|
-
export interface Config {
|
|
5
|
-
build?: {
|
|
6
|
-
/**
|
|
7
|
-
* Path to the server's entry point.
|
|
8
|
-
* Default: detected from package.json "module" or "main"
|
|
9
|
-
*/
|
|
10
|
-
entry?: string;
|
|
11
|
-
/**
|
|
12
|
-
* Optional esbuild overrides for bundling
|
|
13
|
-
*/
|
|
14
|
-
esbuild?: Record<string, unknown>;
|
|
15
|
-
};
|
|
16
|
-
}
|
package/dist/bundle/config.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
export declare const DeployPayloadSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
3
|
-
type: z.ZodLiteral<"hosted">;
|
|
4
|
-
stateful: z.ZodDefault<z.ZodBoolean>;
|
|
5
|
-
configSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
6
|
-
serverCard: z.ZodOptional<z.ZodObject<{
|
|
7
|
-
serverInfo: z.ZodObject<{
|
|
8
|
-
version: z.ZodString;
|
|
9
|
-
websiteUrl: z.ZodOptional<z.ZodString>;
|
|
10
|
-
description: z.ZodOptional<z.ZodString>;
|
|
11
|
-
icons: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
12
|
-
src: z.ZodString;
|
|
13
|
-
mimeType: z.ZodOptional<z.ZodString>;
|
|
14
|
-
sizes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
15
|
-
theme: z.ZodOptional<z.ZodEnum<{
|
|
16
|
-
light: "light";
|
|
17
|
-
dark: "dark";
|
|
18
|
-
}>>;
|
|
19
|
-
}, z.core.$strip>>>;
|
|
20
|
-
name: z.ZodString;
|
|
21
|
-
title: z.ZodOptional<z.ZodString>;
|
|
22
|
-
}, z.core.$strip>;
|
|
23
|
-
authentication: z.ZodOptional<z.ZodObject<{
|
|
24
|
-
required: z.ZodBoolean;
|
|
25
|
-
schemes: z.ZodArray<z.ZodString>;
|
|
26
|
-
}, z.core.$strip>>;
|
|
27
|
-
tools: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
28
|
-
description: z.ZodOptional<z.ZodString>;
|
|
29
|
-
inputSchema: z.ZodObject<{
|
|
30
|
-
type: z.ZodLiteral<"object">;
|
|
31
|
-
properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodCustom<object, object>>>;
|
|
32
|
-
required: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
33
|
-
}, z.core.$catchall<z.ZodUnknown>>;
|
|
34
|
-
outputSchema: z.ZodOptional<z.ZodObject<{
|
|
35
|
-
type: z.ZodLiteral<"object">;
|
|
36
|
-
properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodCustom<object, object>>>;
|
|
37
|
-
required: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
38
|
-
}, z.core.$catchall<z.ZodUnknown>>>;
|
|
39
|
-
annotations: z.ZodOptional<z.ZodObject<{
|
|
40
|
-
title: z.ZodOptional<z.ZodString>;
|
|
41
|
-
readOnlyHint: z.ZodOptional<z.ZodBoolean>;
|
|
42
|
-
destructiveHint: z.ZodOptional<z.ZodBoolean>;
|
|
43
|
-
idempotentHint: z.ZodOptional<z.ZodBoolean>;
|
|
44
|
-
openWorldHint: z.ZodOptional<z.ZodBoolean>;
|
|
45
|
-
}, z.core.$strip>>;
|
|
46
|
-
execution: z.ZodOptional<z.ZodObject<{
|
|
47
|
-
taskSupport: z.ZodOptional<z.ZodEnum<{
|
|
48
|
-
optional: "optional";
|
|
49
|
-
required: "required";
|
|
50
|
-
forbidden: "forbidden";
|
|
51
|
-
}>>;
|
|
52
|
-
}, z.core.$strip>>;
|
|
53
|
-
_meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
54
|
-
icons: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
55
|
-
src: z.ZodString;
|
|
56
|
-
mimeType: z.ZodOptional<z.ZodString>;
|
|
57
|
-
sizes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
58
|
-
theme: z.ZodOptional<z.ZodEnum<{
|
|
59
|
-
light: "light";
|
|
60
|
-
dark: "dark";
|
|
61
|
-
}>>;
|
|
62
|
-
}, z.core.$strip>>>;
|
|
63
|
-
name: z.ZodString;
|
|
64
|
-
title: z.ZodOptional<z.ZodString>;
|
|
65
|
-
}, z.core.$strip>>>;
|
|
66
|
-
resources: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
67
|
-
uri: z.ZodString;
|
|
68
|
-
description: z.ZodOptional<z.ZodString>;
|
|
69
|
-
mimeType: z.ZodOptional<z.ZodString>;
|
|
70
|
-
annotations: z.ZodOptional<z.ZodObject<{
|
|
71
|
-
audience: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
72
|
-
user: "user";
|
|
73
|
-
assistant: "assistant";
|
|
74
|
-
}>>>;
|
|
75
|
-
priority: z.ZodOptional<z.ZodNumber>;
|
|
76
|
-
lastModified: z.ZodOptional<z.ZodISODateTime>;
|
|
77
|
-
}, z.core.$strip>>;
|
|
78
|
-
_meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
79
|
-
icons: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
80
|
-
src: z.ZodString;
|
|
81
|
-
mimeType: z.ZodOptional<z.ZodString>;
|
|
82
|
-
sizes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
83
|
-
theme: z.ZodOptional<z.ZodEnum<{
|
|
84
|
-
light: "light";
|
|
85
|
-
dark: "dark";
|
|
86
|
-
}>>;
|
|
87
|
-
}, z.core.$strip>>>;
|
|
88
|
-
name: z.ZodString;
|
|
89
|
-
title: z.ZodOptional<z.ZodString>;
|
|
90
|
-
}, z.core.$strip>>>;
|
|
91
|
-
prompts: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
92
|
-
description: z.ZodOptional<z.ZodString>;
|
|
93
|
-
arguments: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
94
|
-
name: z.ZodString;
|
|
95
|
-
description: z.ZodOptional<z.ZodString>;
|
|
96
|
-
required: z.ZodOptional<z.ZodBoolean>;
|
|
97
|
-
}, z.core.$strip>>>;
|
|
98
|
-
_meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
99
|
-
icons: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
100
|
-
src: z.ZodString;
|
|
101
|
-
mimeType: z.ZodOptional<z.ZodString>;
|
|
102
|
-
sizes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
103
|
-
theme: z.ZodOptional<z.ZodEnum<{
|
|
104
|
-
light: "light";
|
|
105
|
-
dark: "dark";
|
|
106
|
-
}>>;
|
|
107
|
-
}, z.core.$strip>>>;
|
|
108
|
-
name: z.ZodString;
|
|
109
|
-
title: z.ZodOptional<z.ZodString>;
|
|
110
|
-
}, z.core.$strip>>>;
|
|
111
|
-
}, z.core.$loose>>;
|
|
112
|
-
source: z.ZodOptional<z.ZodObject<{
|
|
113
|
-
commit: z.ZodOptional<z.ZodString>;
|
|
114
|
-
branch: z.ZodOptional<z.ZodString>;
|
|
115
|
-
}, z.core.$strip>>;
|
|
116
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
117
|
-
type: z.ZodLiteral<"external">;
|
|
118
|
-
upstreamUrl: z.ZodString;
|
|
119
|
-
}, z.core.$strip>], "type">;
|
|
120
|
-
export type DeployPayload = z.infer<typeof DeployPayloadSchema>;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { ServerCardSchema } from "./server-card.js";
|
|
3
|
-
const HostedDeployPayloadSchema = z.object({
|
|
4
|
-
type: z.literal("hosted"),
|
|
5
|
-
stateful: z.boolean().default(false),
|
|
6
|
-
configSchema: z.record(z.string(), z.unknown()).optional(),
|
|
7
|
-
serverCard: ServerCardSchema.optional(),
|
|
8
|
-
source: z
|
|
9
|
-
.object({
|
|
10
|
-
commit: z.string().optional(),
|
|
11
|
-
branch: z.string().optional(),
|
|
12
|
-
})
|
|
13
|
-
.optional(),
|
|
14
|
-
});
|
|
15
|
-
const ExternalDeployPayloadSchema = z.object({
|
|
16
|
-
type: z.literal("external"),
|
|
17
|
-
upstreamUrl: z.string().url(),
|
|
18
|
-
});
|
|
19
|
-
export const DeployPayloadSchema = z.discriminatedUnion("type", [
|
|
20
|
-
HostedDeployPayloadSchema,
|
|
21
|
-
ExternalDeployPayloadSchema,
|
|
22
|
-
]);
|
package/dist/bundle/index.d.ts
DELETED
package/dist/bundle/index.js
DELETED
package/dist/bundle/limits.d.ts
DELETED
package/dist/bundle/limits.js
DELETED
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
export declare const ServerCardSchema: z.ZodObject<{
|
|
3
|
-
serverInfo: z.ZodObject<{
|
|
4
|
-
version: z.ZodString;
|
|
5
|
-
websiteUrl: z.ZodOptional<z.ZodString>;
|
|
6
|
-
description: z.ZodOptional<z.ZodString>;
|
|
7
|
-
icons: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
8
|
-
src: z.ZodString;
|
|
9
|
-
mimeType: z.ZodOptional<z.ZodString>;
|
|
10
|
-
sizes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
11
|
-
theme: z.ZodOptional<z.ZodEnum<{
|
|
12
|
-
light: "light";
|
|
13
|
-
dark: "dark";
|
|
14
|
-
}>>;
|
|
15
|
-
}, z.core.$strip>>>;
|
|
16
|
-
name: z.ZodString;
|
|
17
|
-
title: z.ZodOptional<z.ZodString>;
|
|
18
|
-
}, z.core.$strip>;
|
|
19
|
-
authentication: z.ZodOptional<z.ZodObject<{
|
|
20
|
-
required: z.ZodBoolean;
|
|
21
|
-
schemes: z.ZodArray<z.ZodString>;
|
|
22
|
-
}, z.core.$strip>>;
|
|
23
|
-
tools: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
24
|
-
description: z.ZodOptional<z.ZodString>;
|
|
25
|
-
inputSchema: z.ZodObject<{
|
|
26
|
-
type: z.ZodLiteral<"object">;
|
|
27
|
-
properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodCustom<object, object>>>;
|
|
28
|
-
required: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
29
|
-
}, z.core.$catchall<z.ZodUnknown>>;
|
|
30
|
-
outputSchema: z.ZodOptional<z.ZodObject<{
|
|
31
|
-
type: z.ZodLiteral<"object">;
|
|
32
|
-
properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodCustom<object, object>>>;
|
|
33
|
-
required: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
34
|
-
}, z.core.$catchall<z.ZodUnknown>>>;
|
|
35
|
-
annotations: z.ZodOptional<z.ZodObject<{
|
|
36
|
-
title: z.ZodOptional<z.ZodString>;
|
|
37
|
-
readOnlyHint: z.ZodOptional<z.ZodBoolean>;
|
|
38
|
-
destructiveHint: z.ZodOptional<z.ZodBoolean>;
|
|
39
|
-
idempotentHint: z.ZodOptional<z.ZodBoolean>;
|
|
40
|
-
openWorldHint: z.ZodOptional<z.ZodBoolean>;
|
|
41
|
-
}, z.core.$strip>>;
|
|
42
|
-
execution: z.ZodOptional<z.ZodObject<{
|
|
43
|
-
taskSupport: z.ZodOptional<z.ZodEnum<{
|
|
44
|
-
optional: "optional";
|
|
45
|
-
required: "required";
|
|
46
|
-
forbidden: "forbidden";
|
|
47
|
-
}>>;
|
|
48
|
-
}, z.core.$strip>>;
|
|
49
|
-
_meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
50
|
-
icons: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
51
|
-
src: z.ZodString;
|
|
52
|
-
mimeType: z.ZodOptional<z.ZodString>;
|
|
53
|
-
sizes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
54
|
-
theme: z.ZodOptional<z.ZodEnum<{
|
|
55
|
-
light: "light";
|
|
56
|
-
dark: "dark";
|
|
57
|
-
}>>;
|
|
58
|
-
}, z.core.$strip>>>;
|
|
59
|
-
name: z.ZodString;
|
|
60
|
-
title: z.ZodOptional<z.ZodString>;
|
|
61
|
-
}, z.core.$strip>>>;
|
|
62
|
-
resources: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
63
|
-
uri: z.ZodString;
|
|
64
|
-
description: z.ZodOptional<z.ZodString>;
|
|
65
|
-
mimeType: z.ZodOptional<z.ZodString>;
|
|
66
|
-
annotations: z.ZodOptional<z.ZodObject<{
|
|
67
|
-
audience: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
68
|
-
user: "user";
|
|
69
|
-
assistant: "assistant";
|
|
70
|
-
}>>>;
|
|
71
|
-
priority: z.ZodOptional<z.ZodNumber>;
|
|
72
|
-
lastModified: z.ZodOptional<z.ZodISODateTime>;
|
|
73
|
-
}, z.core.$strip>>;
|
|
74
|
-
_meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
75
|
-
icons: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
76
|
-
src: z.ZodString;
|
|
77
|
-
mimeType: z.ZodOptional<z.ZodString>;
|
|
78
|
-
sizes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
79
|
-
theme: z.ZodOptional<z.ZodEnum<{
|
|
80
|
-
light: "light";
|
|
81
|
-
dark: "dark";
|
|
82
|
-
}>>;
|
|
83
|
-
}, z.core.$strip>>>;
|
|
84
|
-
name: z.ZodString;
|
|
85
|
-
title: z.ZodOptional<z.ZodString>;
|
|
86
|
-
}, z.core.$strip>>>;
|
|
87
|
-
prompts: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
88
|
-
description: z.ZodOptional<z.ZodString>;
|
|
89
|
-
arguments: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
90
|
-
name: z.ZodString;
|
|
91
|
-
description: z.ZodOptional<z.ZodString>;
|
|
92
|
-
required: z.ZodOptional<z.ZodBoolean>;
|
|
93
|
-
}, z.core.$strip>>>;
|
|
94
|
-
_meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
95
|
-
icons: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
96
|
-
src: z.ZodString;
|
|
97
|
-
mimeType: z.ZodOptional<z.ZodString>;
|
|
98
|
-
sizes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
99
|
-
theme: z.ZodOptional<z.ZodEnum<{
|
|
100
|
-
light: "light";
|
|
101
|
-
dark: "dark";
|
|
102
|
-
}>>;
|
|
103
|
-
}, z.core.$strip>>>;
|
|
104
|
-
name: z.ZodString;
|
|
105
|
-
title: z.ZodOptional<z.ZodString>;
|
|
106
|
-
}, z.core.$strip>>>;
|
|
107
|
-
}, z.core.$loose>;
|
|
108
|
-
export type ServerCard = z.infer<typeof ServerCardSchema>;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { ImplementationSchema, PromptSchema, ResourceSchema, ToolSchema, } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
export const ServerCardSchema = z
|
|
4
|
-
.object({
|
|
5
|
-
serverInfo: ImplementationSchema,
|
|
6
|
-
authentication: z
|
|
7
|
-
.object({
|
|
8
|
-
required: z.boolean(),
|
|
9
|
-
schemes: z.array(z.string()),
|
|
10
|
-
})
|
|
11
|
-
.optional(),
|
|
12
|
-
tools: z.array(ToolSchema).optional(),
|
|
13
|
-
resources: z.array(ResourceSchema).optional(),
|
|
14
|
-
prompts: z.array(PromptSchema).optional(),
|
|
15
|
-
})
|
|
16
|
-
.passthrough();
|