Skip to content

Commit e8a3156

Browse files
committed
feat: MCP 11-25
Signed-off-by: John McBride <john@zuplo.com>
1 parent f678b58 commit e8a3156

21 files changed

+2565
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/*
2+
* Copyright (c) 2025 Zuplo
3+
* Copyright (c) 2024 Anthropic, PBC
4+
*
5+
* Licensed under the MIT License (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at:
8+
*
9+
* https://mit-license.org/
10+
*
11+
* The following is a derivative work of github.com/modelcontextprotocol/typescript-sdk
12+
* and is attributed to the original authors under the License.
13+
*/
14+
15+
// Re-export from the 20250618 version as autocomplete schemas haven't changed
16+
export {
17+
CompleteRequestSchema,
18+
CompleteResultSchema,
19+
PromptReferenceSchema,
20+
ResourceTemplateReferenceSchema,
21+
} from "../../20250618/schemas/autocomplete.schema.js";
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
/*
2+
* Copyright (c) 2025 Zuplo
3+
* Copyright (c) 2024 Anthropic, PBC
4+
*
5+
* Licensed under the MIT License (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at:
8+
*
9+
* https://mit-license.org/
10+
*
11+
* The following is a derivative work of github.com/modelcontextprotocol/typescript-sdk
12+
* and is attributed to the original authors under the License.
13+
*/
14+
15+
import { z } from "zod/v4";
16+
17+
/**
18+
* An optionally-sized icon that can be displayed in a user interface.
19+
*/
20+
export const IconSchema = z
21+
.object({
22+
/**
23+
* A standard URI pointing to an icon resource. May be an HTTP/HTTPS URL or a
24+
* `data:` URI with Base64-encoded image data.
25+
*/
26+
src: z.string(),
27+
28+
/**
29+
* Optional MIME type override if the source MIME type is missing or generic.
30+
* For example: `"image/png"`, `"image/jpeg"`, or `"image/svg+xml"`.
31+
*/
32+
mimeType: z.optional(z.string()),
33+
34+
/**
35+
* Optional array of strings that specify sizes at which the icon can be used.
36+
* Each string should be in WxH format (e.g., `"48x48"`, `"96x96"`) or `"any"` for scalable formats like SVG.
37+
*/
38+
sizes: z.optional(z.array(z.string())),
39+
40+
/**
41+
* Optional specifier for the theme this icon is designed for. `light` indicates
42+
* the icon is designed to be used with a light background, and `dark` indicates
43+
* the icon is designed to be used with a dark background.
44+
*/
45+
theme: z.optional(z.enum(["light", "dark"])),
46+
})
47+
.loose();
48+
49+
/**
50+
* Base interface to add `icons` property.
51+
*/
52+
export const IconsSchema = z
53+
.object({
54+
/**
55+
* Optional set of sized icons that the client can display in a user interface.
56+
*/
57+
icons: z.optional(z.array(IconSchema)),
58+
})
59+
.loose();
60+
61+
/**
62+
* Base interface for metadata with name (identifier) and title (display name)
63+
* properties.
64+
*/
65+
export const BaseMetadataSchema = z
66+
.object({
67+
/**
68+
* Intended for programmatic or logical use, but used as a display name in
69+
* past specs or fallback (if title isn't present).
70+
*/
71+
name: z.string(),
72+
73+
/**
74+
* Intended for UI and end-user contexts — optimized to be human-readable
75+
* and easily understood,
76+
* even by those unfamiliar with domain-specific terminology.
77+
*
78+
* If not provided, the name should be used for display (except for Tool,
79+
* where `annotations.title` should be given precedence over using `name`,
80+
* if present).
81+
*/
82+
title: z.optional(z.string()),
83+
})
84+
.loose();
85+
86+
/**
87+
* Optional annotations for the client. The client can use annotations to inform
88+
* how objects are used or displayed
89+
*/
90+
export const AnnotationsSchema = z
91+
.object({
92+
/**
93+
* Describes who the intended customer of this object or data is.
94+
*
95+
* It can include multiple entries to indicate content useful for multiple
96+
* audiences (e.g., `["user", "assistant"]`).
97+
*/
98+
audience: z.optional(z.array(z.enum(["user", "assistant"]))),
99+
100+
/**
101+
* Describes how important this data is for operating the server.
102+
*
103+
* A value of 1 means "most important," and indicates that the data is
104+
* effectively required, while 0 means "least important," and indicates that
105+
* the data is entirely optional.
106+
*/
107+
priority: z.optional(z.number().min(0).max(1)),
108+
109+
/**
110+
* The moment the resource was last modified, as an ISO 8601 formatted string.
111+
*
112+
* Should be an ISO 8601 formatted string (e.g., "2025-01-12T15:00:58Z").
113+
*
114+
* Examples: last activity timestamp in an open file, timestamp when the resource
115+
* was attached, etc.
116+
*/
117+
lastModified: z.optional(z.string()),
118+
})
119+
.loose();
Lines changed: 218 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,218 @@
1+
/*
2+
* Copyright (c) 2025 Zuplo
3+
* Copyright (c) 2024 Anthropic, PBC
4+
*
5+
* Licensed under the MIT License (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at:
8+
*
9+
* https://mit-license.org/
10+
*
11+
* The following is a derivative work of github.com/modelcontextprotocol/typescript-sdk
12+
* and is attributed to the original authors under the License.
13+
*/
14+
15+
import { z } from "zod/v4";
16+
17+
/**
18+
* Capabilities a client may support. Known capabilities are defined here,
19+
* in this schema, but this is not a closed set: any client can define its own,
20+
* additional capabilities.
21+
*/
22+
export const ClientCapabilitiesSchema = z
23+
.object({
24+
/**
25+
* Experimental, non-standard capabilities that the client supports.
26+
*/
27+
experimental: z.optional(z.record(z.string(), z.object({}).loose())),
28+
29+
/**
30+
* Present if the client supports listing roots.
31+
*/
32+
roots: z.optional(
33+
z
34+
.object({
35+
/**
36+
* Whether the client supports notifications for changes to the roots list.
37+
*/
38+
listChanged: z.optional(z.boolean()),
39+
})
40+
.loose()
41+
),
42+
43+
/**
44+
* Present if the client supports sampling from an LLM.
45+
*/
46+
sampling: z.optional(
47+
z
48+
.object({
49+
/**
50+
* Whether the client supports context inclusion via includeContext parameter.
51+
*/
52+
context: z.optional(z.object({}).loose()),
53+
/**
54+
* Whether the client supports tool use via tools and toolChoice parameters.
55+
*/
56+
tools: z.optional(z.object({}).loose()),
57+
})
58+
.loose()
59+
),
60+
61+
/**
62+
* Present if the client supports elicitation from the server.
63+
*/
64+
elicitation: z.optional(
65+
z
66+
.object({
67+
form: z.optional(z.object({}).loose()),
68+
url: z.optional(z.object({}).loose()),
69+
})
70+
.loose()
71+
),
72+
73+
/**
74+
* Present if the client supports task-augmented requests.
75+
*/
76+
tasks: z.optional(
77+
z
78+
.object({
79+
/**
80+
* Whether this client supports tasks/list.
81+
*/
82+
list: z.optional(z.object({}).loose()),
83+
/**
84+
* Whether this client supports tasks/cancel.
85+
*/
86+
cancel: z.optional(z.object({}).loose()),
87+
/**
88+
* Specifies which request types can be augmented with tasks.
89+
*/
90+
requests: z.optional(
91+
z
92+
.object({
93+
sampling: z.optional(
94+
z
95+
.object({
96+
createMessage: z.optional(z.object({}).loose()),
97+
})
98+
.loose()
99+
),
100+
elicitation: z.optional(
101+
z
102+
.object({
103+
create: z.optional(z.object({}).loose()),
104+
})
105+
.loose()
106+
),
107+
})
108+
.loose()
109+
),
110+
})
111+
.loose()
112+
),
113+
})
114+
.loose();
115+
116+
/**
117+
* Capabilities that a server may support. Known capabilities are defined here,
118+
* in this schema, but this is not a closed set: any server can define its own,
119+
* additional capabilities.
120+
*/
121+
export const ServerCapabilitiesSchema = z
122+
.object({
123+
/**
124+
* Experimental, non-standard capabilities that the server supports.
125+
*/
126+
experimental: z.optional(z.record(z.string(), z.object({}).loose())),
127+
128+
/**
129+
* Present if the server supports sending log messages to the client.
130+
*/
131+
logging: z.optional(z.object({}).loose()),
132+
133+
/**
134+
* Present if the server supports argument autocompletion suggestions.
135+
*/
136+
completions: z.optional(z.object({}).loose()),
137+
138+
/**
139+
* Present if the server offers any prompt templates.
140+
*/
141+
prompts: z.optional(
142+
z
143+
.object({
144+
/**
145+
* Whether this server supports notifications for changes to the prompt list.
146+
*/
147+
listChanged: z.optional(z.boolean()),
148+
})
149+
.loose()
150+
),
151+
152+
/**
153+
* Present if the server offers any resources to read.
154+
*/
155+
resources: z.optional(
156+
z
157+
.object({
158+
/**
159+
* Whether this server supports subscribing to resource updates.
160+
*/
161+
subscribe: z.optional(z.boolean()),
162+
/**
163+
* Whether this server supports notifications for changes to the resource list.
164+
*/
165+
listChanged: z.optional(z.boolean()),
166+
})
167+
.loose()
168+
),
169+
170+
/**
171+
* Present if the server offers any tools to call.
172+
*/
173+
tools: z.optional(
174+
z
175+
.object({
176+
/**
177+
* Whether this server supports notifications for changes to the tool list.
178+
*/
179+
listChanged: z.optional(z.boolean()),
180+
})
181+
.loose()
182+
),
183+
184+
/**
185+
* Present if the server supports task-augmented requests.
186+
*/
187+
tasks: z.optional(
188+
z
189+
.object({
190+
/**
191+
* Whether this server supports tasks/list.
192+
*/
193+
list: z.optional(z.object({}).loose()),
194+
/**
195+
* Whether this server supports tasks/cancel.
196+
*/
197+
cancel: z.optional(z.object({}).loose()),
198+
/**
199+
* Specifies which request types can be augmented with tasks.
200+
*/
201+
requests: z.optional(
202+
z
203+
.object({
204+
tools: z.optional(
205+
z
206+
.object({
207+
call: z.optional(z.object({}).loose()),
208+
})
209+
.loose()
210+
),
211+
})
212+
.loose()
213+
),
214+
})
215+
.loose()
216+
),
217+
})
218+
.loose();

0 commit comments

Comments
 (0)