Spaces:
Paused
Paused
Upload folder using huggingface_hub (part 21)
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/uriTemplate.d.ts +25 -0
- node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/uriTemplate.d.ts.map +1 -0
- node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/uriTemplate.js +243 -0
- node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/uriTemplate.js.map +1 -0
- node_modules/@modelcontextprotocol/sdk/dist/cjs/spec.types.d.ts +2311 -0
- node_modules/@modelcontextprotocol/sdk/dist/cjs/spec.types.d.ts.map +1 -0
- node_modules/@modelcontextprotocol/sdk/dist/cjs/spec.types.js +27 -0
- node_modules/@modelcontextprotocol/sdk/dist/cjs/spec.types.js.map +1 -0
- node_modules/@modelcontextprotocol/sdk/dist/cjs/types.d.ts +0 -0
- node_modules/@modelcontextprotocol/sdk/dist/cjs/types.d.ts.map +1 -0
- node_modules/@modelcontextprotocol/sdk/dist/cjs/types.js +2105 -0
- node_modules/@modelcontextprotocol/sdk/dist/cjs/types.js.map +1 -0
- node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/ajv-provider.d.ts +53 -0
- node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/ajv-provider.d.ts.map +1 -0
- node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/ajv-provider.js +94 -0
- node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/ajv-provider.js.map +1 -0
- node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/cfworker-provider.d.ts +51 -0
- node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/cfworker-provider.d.ts.map +1 -0
- node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/cfworker-provider.js +69 -0
- node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/cfworker-provider.js.map +1 -0
- node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/index.d.ts +29 -0
- node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/index.d.ts.map +1 -0
- node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/index.js +30 -0
- node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/index.js.map +1 -0
- node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/types.d.ts +65 -0
- node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/types.d.ts.map +1 -0
- node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/types.js +3 -0
- node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/types.js.map +1 -0
- node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth-extensions.d.ts +190 -0
- node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth-extensions.d.ts.map +1 -0
- node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth-extensions.js +269 -0
- node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth-extensions.js.map +1 -0
- node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth.d.ts +451 -0
- node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth.d.ts.map +1 -0
- node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth.js +918 -0
- node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth.js.map +1 -0
- node_modules/@modelcontextprotocol/sdk/dist/esm/client/index.d.ts +591 -0
- node_modules/@modelcontextprotocol/sdk/dist/esm/client/index.d.ts.map +1 -0
- node_modules/@modelcontextprotocol/sdk/dist/esm/client/index.js +624 -0
- node_modules/@modelcontextprotocol/sdk/dist/esm/client/index.js.map +1 -0
- node_modules/@modelcontextprotocol/sdk/dist/esm/client/middleware.d.ts +169 -0
- node_modules/@modelcontextprotocol/sdk/dist/esm/client/middleware.d.ts.map +1 -0
- node_modules/@modelcontextprotocol/sdk/dist/esm/client/middleware.js +245 -0
- node_modules/@modelcontextprotocol/sdk/dist/esm/client/middleware.js.map +1 -0
- node_modules/@modelcontextprotocol/sdk/dist/esm/client/sse.d.ts +81 -0
- node_modules/@modelcontextprotocol/sdk/dist/esm/client/sse.d.ts.map +1 -0
- node_modules/@modelcontextprotocol/sdk/dist/esm/client/sse.js +206 -0
- node_modules/@modelcontextprotocol/sdk/dist/esm/client/sse.js.map +1 -0
- node_modules/@modelcontextprotocol/sdk/dist/esm/client/stdio.d.ts +77 -0
- node_modules/@modelcontextprotocol/sdk/dist/esm/client/stdio.d.ts.map +1 -0
node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/uriTemplate.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
export type Variables = Record<string, string | string[]>;
|
| 2 |
+
export declare class UriTemplate {
|
| 3 |
+
/**
|
| 4 |
+
* Returns true if the given string contains any URI template expressions.
|
| 5 |
+
* A template expression is a sequence of characters enclosed in curly braces,
|
| 6 |
+
* like {foo} or {?bar}.
|
| 7 |
+
*/
|
| 8 |
+
static isTemplate(str: string): boolean;
|
| 9 |
+
private static validateLength;
|
| 10 |
+
private readonly template;
|
| 11 |
+
private readonly parts;
|
| 12 |
+
get variableNames(): string[];
|
| 13 |
+
constructor(template: string);
|
| 14 |
+
toString(): string;
|
| 15 |
+
private parse;
|
| 16 |
+
private getOperator;
|
| 17 |
+
private getNames;
|
| 18 |
+
private encodeValue;
|
| 19 |
+
private expandPart;
|
| 20 |
+
expand(variables: Variables): string;
|
| 21 |
+
private escapeRegExp;
|
| 22 |
+
private partToRegExp;
|
| 23 |
+
match(uri: string): Variables | null;
|
| 24 |
+
}
|
| 25 |
+
//# sourceMappingURL=uriTemplate.d.ts.map
|
node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/uriTemplate.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
// Claude-authored implementation of RFC 6570 URI Templates
|
| 3 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 4 |
+
exports.UriTemplate = void 0;
|
| 5 |
+
const MAX_TEMPLATE_LENGTH = 1000000; // 1MB
|
| 6 |
+
const MAX_VARIABLE_LENGTH = 1000000; // 1MB
|
| 7 |
+
const MAX_TEMPLATE_EXPRESSIONS = 10000;
|
| 8 |
+
const MAX_REGEX_LENGTH = 1000000; // 1MB
|
| 9 |
+
class UriTemplate {
|
| 10 |
+
/**
|
| 11 |
+
* Returns true if the given string contains any URI template expressions.
|
| 12 |
+
* A template expression is a sequence of characters enclosed in curly braces,
|
| 13 |
+
* like {foo} or {?bar}.
|
| 14 |
+
*/
|
| 15 |
+
static isTemplate(str) {
|
| 16 |
+
// Look for any sequence of characters between curly braces
|
| 17 |
+
// that isn't just whitespace
|
| 18 |
+
return /\{[^}\s]+\}/.test(str);
|
| 19 |
+
}
|
| 20 |
+
static validateLength(str, max, context) {
|
| 21 |
+
if (str.length > max) {
|
| 22 |
+
throw new Error(`${context} exceeds maximum length of ${max} characters (got ${str.length})`);
|
| 23 |
+
}
|
| 24 |
+
}
|
| 25 |
+
get variableNames() {
|
| 26 |
+
return this.parts.flatMap(part => (typeof part === 'string' ? [] : part.names));
|
| 27 |
+
}
|
| 28 |
+
constructor(template) {
|
| 29 |
+
UriTemplate.validateLength(template, MAX_TEMPLATE_LENGTH, 'Template');
|
| 30 |
+
this.template = template;
|
| 31 |
+
this.parts = this.parse(template);
|
| 32 |
+
}
|
| 33 |
+
toString() {
|
| 34 |
+
return this.template;
|
| 35 |
+
}
|
| 36 |
+
parse(template) {
|
| 37 |
+
const parts = [];
|
| 38 |
+
let currentText = '';
|
| 39 |
+
let i = 0;
|
| 40 |
+
let expressionCount = 0;
|
| 41 |
+
while (i < template.length) {
|
| 42 |
+
if (template[i] === '{') {
|
| 43 |
+
if (currentText) {
|
| 44 |
+
parts.push(currentText);
|
| 45 |
+
currentText = '';
|
| 46 |
+
}
|
| 47 |
+
const end = template.indexOf('}', i);
|
| 48 |
+
if (end === -1)
|
| 49 |
+
throw new Error('Unclosed template expression');
|
| 50 |
+
expressionCount++;
|
| 51 |
+
if (expressionCount > MAX_TEMPLATE_EXPRESSIONS) {
|
| 52 |
+
throw new Error(`Template contains too many expressions (max ${MAX_TEMPLATE_EXPRESSIONS})`);
|
| 53 |
+
}
|
| 54 |
+
const expr = template.slice(i + 1, end);
|
| 55 |
+
const operator = this.getOperator(expr);
|
| 56 |
+
const exploded = expr.includes('*');
|
| 57 |
+
const names = this.getNames(expr);
|
| 58 |
+
const name = names[0];
|
| 59 |
+
// Validate variable name length
|
| 60 |
+
for (const name of names) {
|
| 61 |
+
UriTemplate.validateLength(name, MAX_VARIABLE_LENGTH, 'Variable name');
|
| 62 |
+
}
|
| 63 |
+
parts.push({ name, operator, names, exploded });
|
| 64 |
+
i = end + 1;
|
| 65 |
+
}
|
| 66 |
+
else {
|
| 67 |
+
currentText += template[i];
|
| 68 |
+
i++;
|
| 69 |
+
}
|
| 70 |
+
}
|
| 71 |
+
if (currentText) {
|
| 72 |
+
parts.push(currentText);
|
| 73 |
+
}
|
| 74 |
+
return parts;
|
| 75 |
+
}
|
| 76 |
+
getOperator(expr) {
|
| 77 |
+
const operators = ['+', '#', '.', '/', '?', '&'];
|
| 78 |
+
return operators.find(op => expr.startsWith(op)) || '';
|
| 79 |
+
}
|
| 80 |
+
getNames(expr) {
|
| 81 |
+
const operator = this.getOperator(expr);
|
| 82 |
+
return expr
|
| 83 |
+
.slice(operator.length)
|
| 84 |
+
.split(',')
|
| 85 |
+
.map(name => name.replace('*', '').trim())
|
| 86 |
+
.filter(name => name.length > 0);
|
| 87 |
+
}
|
| 88 |
+
encodeValue(value, operator) {
|
| 89 |
+
UriTemplate.validateLength(value, MAX_VARIABLE_LENGTH, 'Variable value');
|
| 90 |
+
if (operator === '+' || operator === '#') {
|
| 91 |
+
return encodeURI(value);
|
| 92 |
+
}
|
| 93 |
+
return encodeURIComponent(value);
|
| 94 |
+
}
|
| 95 |
+
expandPart(part, variables) {
|
| 96 |
+
if (part.operator === '?' || part.operator === '&') {
|
| 97 |
+
const pairs = part.names
|
| 98 |
+
.map(name => {
|
| 99 |
+
const value = variables[name];
|
| 100 |
+
if (value === undefined)
|
| 101 |
+
return '';
|
| 102 |
+
const encoded = Array.isArray(value)
|
| 103 |
+
? value.map(v => this.encodeValue(v, part.operator)).join(',')
|
| 104 |
+
: this.encodeValue(value.toString(), part.operator);
|
| 105 |
+
return `${name}=${encoded}`;
|
| 106 |
+
})
|
| 107 |
+
.filter(pair => pair.length > 0);
|
| 108 |
+
if (pairs.length === 0)
|
| 109 |
+
return '';
|
| 110 |
+
const separator = part.operator === '?' ? '?' : '&';
|
| 111 |
+
return separator + pairs.join('&');
|
| 112 |
+
}
|
| 113 |
+
if (part.names.length > 1) {
|
| 114 |
+
const values = part.names.map(name => variables[name]).filter(v => v !== undefined);
|
| 115 |
+
if (values.length === 0)
|
| 116 |
+
return '';
|
| 117 |
+
return values.map(v => (Array.isArray(v) ? v[0] : v)).join(',');
|
| 118 |
+
}
|
| 119 |
+
const value = variables[part.name];
|
| 120 |
+
if (value === undefined)
|
| 121 |
+
return '';
|
| 122 |
+
const values = Array.isArray(value) ? value : [value];
|
| 123 |
+
const encoded = values.map(v => this.encodeValue(v, part.operator));
|
| 124 |
+
switch (part.operator) {
|
| 125 |
+
case '':
|
| 126 |
+
return encoded.join(',');
|
| 127 |
+
case '+':
|
| 128 |
+
return encoded.join(',');
|
| 129 |
+
case '#':
|
| 130 |
+
return '#' + encoded.join(',');
|
| 131 |
+
case '.':
|
| 132 |
+
return '.' + encoded.join('.');
|
| 133 |
+
case '/':
|
| 134 |
+
return '/' + encoded.join('/');
|
| 135 |
+
default:
|
| 136 |
+
return encoded.join(',');
|
| 137 |
+
}
|
| 138 |
+
}
|
| 139 |
+
expand(variables) {
|
| 140 |
+
let result = '';
|
| 141 |
+
let hasQueryParam = false;
|
| 142 |
+
for (const part of this.parts) {
|
| 143 |
+
if (typeof part === 'string') {
|
| 144 |
+
result += part;
|
| 145 |
+
continue;
|
| 146 |
+
}
|
| 147 |
+
const expanded = this.expandPart(part, variables);
|
| 148 |
+
if (!expanded)
|
| 149 |
+
continue;
|
| 150 |
+
// Convert ? to & if we already have a query parameter
|
| 151 |
+
if ((part.operator === '?' || part.operator === '&') && hasQueryParam) {
|
| 152 |
+
result += expanded.replace('?', '&');
|
| 153 |
+
}
|
| 154 |
+
else {
|
| 155 |
+
result += expanded;
|
| 156 |
+
}
|
| 157 |
+
if (part.operator === '?' || part.operator === '&') {
|
| 158 |
+
hasQueryParam = true;
|
| 159 |
+
}
|
| 160 |
+
}
|
| 161 |
+
return result;
|
| 162 |
+
}
|
| 163 |
+
escapeRegExp(str) {
|
| 164 |
+
return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
| 165 |
+
}
|
| 166 |
+
partToRegExp(part) {
|
| 167 |
+
const patterns = [];
|
| 168 |
+
// Validate variable name length for matching
|
| 169 |
+
for (const name of part.names) {
|
| 170 |
+
UriTemplate.validateLength(name, MAX_VARIABLE_LENGTH, 'Variable name');
|
| 171 |
+
}
|
| 172 |
+
if (part.operator === '?' || part.operator === '&') {
|
| 173 |
+
for (let i = 0; i < part.names.length; i++) {
|
| 174 |
+
const name = part.names[i];
|
| 175 |
+
const prefix = i === 0 ? '\\' + part.operator : '&';
|
| 176 |
+
patterns.push({
|
| 177 |
+
pattern: prefix + this.escapeRegExp(name) + '=([^&]+)',
|
| 178 |
+
name
|
| 179 |
+
});
|
| 180 |
+
}
|
| 181 |
+
return patterns;
|
| 182 |
+
}
|
| 183 |
+
let pattern;
|
| 184 |
+
const name = part.name;
|
| 185 |
+
switch (part.operator) {
|
| 186 |
+
case '':
|
| 187 |
+
pattern = part.exploded ? '([^/,]+(?:,[^/,]+)*)' : '([^/,]+)';
|
| 188 |
+
break;
|
| 189 |
+
case '+':
|
| 190 |
+
case '#':
|
| 191 |
+
pattern = '(.+)';
|
| 192 |
+
break;
|
| 193 |
+
case '.':
|
| 194 |
+
pattern = '\\.([^/,]+)';
|
| 195 |
+
break;
|
| 196 |
+
case '/':
|
| 197 |
+
pattern = '/' + (part.exploded ? '([^/,]+(?:,[^/,]+)*)' : '([^/,]+)');
|
| 198 |
+
break;
|
| 199 |
+
default:
|
| 200 |
+
pattern = '([^/]+)';
|
| 201 |
+
}
|
| 202 |
+
patterns.push({ pattern, name });
|
| 203 |
+
return patterns;
|
| 204 |
+
}
|
| 205 |
+
match(uri) {
|
| 206 |
+
UriTemplate.validateLength(uri, MAX_TEMPLATE_LENGTH, 'URI');
|
| 207 |
+
let pattern = '^';
|
| 208 |
+
const names = [];
|
| 209 |
+
for (const part of this.parts) {
|
| 210 |
+
if (typeof part === 'string') {
|
| 211 |
+
pattern += this.escapeRegExp(part);
|
| 212 |
+
}
|
| 213 |
+
else {
|
| 214 |
+
const patterns = this.partToRegExp(part);
|
| 215 |
+
for (const { pattern: partPattern, name } of patterns) {
|
| 216 |
+
pattern += partPattern;
|
| 217 |
+
names.push({ name, exploded: part.exploded });
|
| 218 |
+
}
|
| 219 |
+
}
|
| 220 |
+
}
|
| 221 |
+
pattern += '$';
|
| 222 |
+
UriTemplate.validateLength(pattern, MAX_REGEX_LENGTH, 'Generated regex pattern');
|
| 223 |
+
const regex = new RegExp(pattern);
|
| 224 |
+
const match = uri.match(regex);
|
| 225 |
+
if (!match)
|
| 226 |
+
return null;
|
| 227 |
+
const result = {};
|
| 228 |
+
for (let i = 0; i < names.length; i++) {
|
| 229 |
+
const { name, exploded } = names[i];
|
| 230 |
+
const value = match[i + 1];
|
| 231 |
+
const cleanName = name.replace('*', '');
|
| 232 |
+
if (exploded && value.includes(',')) {
|
| 233 |
+
result[cleanName] = value.split(',');
|
| 234 |
+
}
|
| 235 |
+
else {
|
| 236 |
+
result[cleanName] = value;
|
| 237 |
+
}
|
| 238 |
+
}
|
| 239 |
+
return result;
|
| 240 |
+
}
|
| 241 |
+
}
|
| 242 |
+
exports.UriTemplate = UriTemplate;
|
| 243 |
+
//# sourceMappingURL=uriTemplate.js.map
|
node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/uriTemplate.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"uriTemplate.js","sourceRoot":"","sources":["../../../src/shared/uriTemplate.ts"],"names":[],"mappings":";AAAA,2DAA2D;;;AAI3D,MAAM,mBAAmB,GAAG,OAAO,CAAC,CAAC,MAAM;AAC3C,MAAM,mBAAmB,GAAG,OAAO,CAAC,CAAC,MAAM;AAC3C,MAAM,wBAAwB,GAAG,KAAK,CAAC;AACvC,MAAM,gBAAgB,GAAG,OAAO,CAAC,CAAC,MAAM;AAExC,MAAa,WAAW;IACpB;;;;OAIG;IACH,MAAM,CAAC,UAAU,CAAC,GAAW;QACzB,2DAA2D;QAC3D,6BAA6B;QAC7B,OAAO,aAAa,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACnC,CAAC;IAEO,MAAM,CAAC,cAAc,CAAC,GAAW,EAAE,GAAW,EAAE,OAAe;QACnE,IAAI,GAAG,CAAC,MAAM,GAAG,GAAG,EAAE,CAAC;YACnB,MAAM,IAAI,KAAK,CAAC,GAAG,OAAO,8BAA8B,GAAG,oBAAoB,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC;QAClG,CAAC;IACL,CAAC;IAID,IAAI,aAAa;QACb,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,K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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* This file is automatically generated from the Model Context Protocol specification.
|
| 3 |
+
*
|
| 4 |
+
* Source: https://github.com/modelcontextprotocol/modelcontextprotocol
|
| 5 |
+
* Pulled from: https://raw.githubusercontent.com/modelcontextprotocol/modelcontextprotocol/main/schema/draft/schema.ts
|
| 6 |
+
* Last updated from commit: 35fa160caf287a9c48696e3ae452c0645c713669
|
| 7 |
+
*
|
| 8 |
+
* DO NOT EDIT THIS FILE MANUALLY. Changes will be overwritten by automated updates.
|
| 9 |
+
* To update this file, run: npm run fetch:spec-types
|
| 10 |
+
*/
|
| 11 |
+
/**
|
| 12 |
+
* Refers to any valid JSON-RPC object that can be decoded off the wire, or encoded to be sent.
|
| 13 |
+
*
|
| 14 |
+
* @category JSON-RPC
|
| 15 |
+
*/
|
| 16 |
+
export type JSONRPCMessage = JSONRPCRequest | JSONRPCNotification | JSONRPCResponse;
|
| 17 |
+
/** @internal */
|
| 18 |
+
export declare const LATEST_PROTOCOL_VERSION = "DRAFT-2026-v1";
|
| 19 |
+
/** @internal */
|
| 20 |
+
export declare const JSONRPC_VERSION = "2.0";
|
| 21 |
+
/**
|
| 22 |
+
* A progress token, used to associate progress notifications with the original request.
|
| 23 |
+
*
|
| 24 |
+
* @category Common Types
|
| 25 |
+
*/
|
| 26 |
+
export type ProgressToken = string | number;
|
| 27 |
+
/**
|
| 28 |
+
* An opaque token used to represent a cursor for pagination.
|
| 29 |
+
*
|
| 30 |
+
* @category Common Types
|
| 31 |
+
*/
|
| 32 |
+
export type Cursor = string;
|
| 33 |
+
/**
|
| 34 |
+
* Common params for any task-augmented request.
|
| 35 |
+
*
|
| 36 |
+
* @internal
|
| 37 |
+
*/
|
| 38 |
+
export interface TaskAugmentedRequestParams extends RequestParams {
|
| 39 |
+
/**
|
| 40 |
+
* If specified, the caller is requesting task-augmented execution for this request.
|
| 41 |
+
* The request will return a CreateTaskResult immediately, and the actual result can be
|
| 42 |
+
* retrieved later via tasks/result.
|
| 43 |
+
*
|
| 44 |
+
* Task augmentation is subject to capability negotiation - receivers MUST declare support
|
| 45 |
+
* for task augmentation of specific request types in their capabilities.
|
| 46 |
+
*/
|
| 47 |
+
task?: TaskMetadata;
|
| 48 |
+
}
|
| 49 |
+
/**
|
| 50 |
+
* Common params for any request.
|
| 51 |
+
*
|
| 52 |
+
* @internal
|
| 53 |
+
*/
|
| 54 |
+
export interface RequestParams {
|
| 55 |
+
/**
|
| 56 |
+
* See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage.
|
| 57 |
+
*/
|
| 58 |
+
_meta?: {
|
| 59 |
+
/**
|
| 60 |
+
* If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications.
|
| 61 |
+
*/
|
| 62 |
+
progressToken?: ProgressToken;
|
| 63 |
+
[key: string]: unknown;
|
| 64 |
+
};
|
| 65 |
+
}
|
| 66 |
+
/** @internal */
|
| 67 |
+
export interface Request {
|
| 68 |
+
method: string;
|
| 69 |
+
params?: {
|
| 70 |
+
[key: string]: any;
|
| 71 |
+
};
|
| 72 |
+
}
|
| 73 |
+
/** @internal */
|
| 74 |
+
export interface NotificationParams {
|
| 75 |
+
/**
|
| 76 |
+
* See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage.
|
| 77 |
+
*/
|
| 78 |
+
_meta?: {
|
| 79 |
+
[key: string]: unknown;
|
| 80 |
+
};
|
| 81 |
+
}
|
| 82 |
+
/** @internal */
|
| 83 |
+
export interface Notification {
|
| 84 |
+
method: string;
|
| 85 |
+
params?: {
|
| 86 |
+
[key: string]: any;
|
| 87 |
+
};
|
| 88 |
+
}
|
| 89 |
+
/**
|
| 90 |
+
* @category Common Types
|
| 91 |
+
*/
|
| 92 |
+
export interface Result {
|
| 93 |
+
/**
|
| 94 |
+
* See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage.
|
| 95 |
+
*/
|
| 96 |
+
_meta?: {
|
| 97 |
+
[key: string]: unknown;
|
| 98 |
+
};
|
| 99 |
+
[key: string]: unknown;
|
| 100 |
+
}
|
| 101 |
+
/**
|
| 102 |
+
* @category Common Types
|
| 103 |
+
*/
|
| 104 |
+
export interface Error {
|
| 105 |
+
/**
|
| 106 |
+
* The error type that occurred.
|
| 107 |
+
*/
|
| 108 |
+
code: number;
|
| 109 |
+
/**
|
| 110 |
+
* A short description of the error. The message SHOULD be limited to a concise single sentence.
|
| 111 |
+
*/
|
| 112 |
+
message: string;
|
| 113 |
+
/**
|
| 114 |
+
* Additional information about the error. The value of this member is defined by the sender (e.g. detailed error information, nested errors etc.).
|
| 115 |
+
*/
|
| 116 |
+
data?: unknown;
|
| 117 |
+
}
|
| 118 |
+
/**
|
| 119 |
+
* A uniquely identifying ID for a request in JSON-RPC.
|
| 120 |
+
*
|
| 121 |
+
* @category Common Types
|
| 122 |
+
*/
|
| 123 |
+
export type RequestId = string | number;
|
| 124 |
+
/**
|
| 125 |
+
* A request that expects a response.
|
| 126 |
+
*
|
| 127 |
+
* @category JSON-RPC
|
| 128 |
+
*/
|
| 129 |
+
export interface JSONRPCRequest extends Request {
|
| 130 |
+
jsonrpc: typeof JSONRPC_VERSION;
|
| 131 |
+
id: RequestId;
|
| 132 |
+
}
|
| 133 |
+
/**
|
| 134 |
+
* A notification which does not expect a response.
|
| 135 |
+
*
|
| 136 |
+
* @category JSON-RPC
|
| 137 |
+
*/
|
| 138 |
+
export interface JSONRPCNotification extends Notification {
|
| 139 |
+
jsonrpc: typeof JSONRPC_VERSION;
|
| 140 |
+
}
|
| 141 |
+
/**
|
| 142 |
+
* A successful (non-error) response to a request.
|
| 143 |
+
*
|
| 144 |
+
* @category JSON-RPC
|
| 145 |
+
*/
|
| 146 |
+
export interface JSONRPCResultResponse {
|
| 147 |
+
jsonrpc: typeof JSONRPC_VERSION;
|
| 148 |
+
id: RequestId;
|
| 149 |
+
result: Result;
|
| 150 |
+
}
|
| 151 |
+
/**
|
| 152 |
+
* A response to a request that indicates an error occurred.
|
| 153 |
+
*
|
| 154 |
+
* @category JSON-RPC
|
| 155 |
+
*/
|
| 156 |
+
export interface JSONRPCErrorResponse {
|
| 157 |
+
jsonrpc: typeof JSONRPC_VERSION;
|
| 158 |
+
id?: RequestId;
|
| 159 |
+
error: Error;
|
| 160 |
+
}
|
| 161 |
+
/**
|
| 162 |
+
* A response to a request, containing either the result or error.
|
| 163 |
+
*/
|
| 164 |
+
export type JSONRPCResponse = JSONRPCResultResponse | JSONRPCErrorResponse;
|
| 165 |
+
export declare const PARSE_ERROR = -32700;
|
| 166 |
+
export declare const INVALID_REQUEST = -32600;
|
| 167 |
+
export declare const METHOD_NOT_FOUND = -32601;
|
| 168 |
+
export declare const INVALID_PARAMS = -32602;
|
| 169 |
+
export declare const INTERNAL_ERROR = -32603;
|
| 170 |
+
/** @internal */
|
| 171 |
+
export declare const URL_ELICITATION_REQUIRED = -32042;
|
| 172 |
+
/**
|
| 173 |
+
* An error response that indicates that the server requires the client to provide additional information via an elicitation request.
|
| 174 |
+
*
|
| 175 |
+
* @internal
|
| 176 |
+
*/
|
| 177 |
+
export interface URLElicitationRequiredError extends Omit<JSONRPCErrorResponse, "error"> {
|
| 178 |
+
error: Error & {
|
| 179 |
+
code: typeof URL_ELICITATION_REQUIRED;
|
| 180 |
+
data: {
|
| 181 |
+
elicitations: ElicitRequestURLParams[];
|
| 182 |
+
[key: string]: unknown;
|
| 183 |
+
};
|
| 184 |
+
};
|
| 185 |
+
}
|
| 186 |
+
/**
|
| 187 |
+
* A response that indicates success but carries no data.
|
| 188 |
+
*
|
| 189 |
+
* @category Common Types
|
| 190 |
+
*/
|
| 191 |
+
export type EmptyResult = Result;
|
| 192 |
+
/**
|
| 193 |
+
* Parameters for a `notifications/cancelled` notification.
|
| 194 |
+
*
|
| 195 |
+
* @category `notifications/cancelled`
|
| 196 |
+
*/
|
| 197 |
+
export interface CancelledNotificationParams extends NotificationParams {
|
| 198 |
+
/**
|
| 199 |
+
* The ID of the request to cancel.
|
| 200 |
+
*
|
| 201 |
+
* This MUST correspond to the ID of a request previously issued in the same direction.
|
| 202 |
+
* This MUST be provided for cancelling non-task requests.
|
| 203 |
+
* This MUST NOT be used for cancelling tasks (use the `tasks/cancel` request instead).
|
| 204 |
+
*/
|
| 205 |
+
requestId?: RequestId;
|
| 206 |
+
/**
|
| 207 |
+
* An optional string describing the reason for the cancellation. This MAY be logged or presented to the user.
|
| 208 |
+
*/
|
| 209 |
+
reason?: string;
|
| 210 |
+
}
|
| 211 |
+
/**
|
| 212 |
+
* This notification can be sent by either side to indicate that it is cancelling a previously-issued request.
|
| 213 |
+
*
|
| 214 |
+
* The request SHOULD still be in-flight, but due to communication latency, it is always possible that this notification MAY arrive after the request has already finished.
|
| 215 |
+
*
|
| 216 |
+
* This notification indicates that the result will be unused, so any associated processing SHOULD cease.
|
| 217 |
+
*
|
| 218 |
+
* A client MUST NOT attempt to cancel its `initialize` request.
|
| 219 |
+
*
|
| 220 |
+
* For task cancellation, use the `tasks/cancel` request instead of this notification.
|
| 221 |
+
*
|
| 222 |
+
* @category `notifications/cancelled`
|
| 223 |
+
*/
|
| 224 |
+
export interface CancelledNotification extends JSONRPCNotification {
|
| 225 |
+
method: "notifications/cancelled";
|
| 226 |
+
params: CancelledNotificationParams;
|
| 227 |
+
}
|
| 228 |
+
/**
|
| 229 |
+
* Parameters for an `initialize` request.
|
| 230 |
+
*
|
| 231 |
+
* @category `initialize`
|
| 232 |
+
*/
|
| 233 |
+
export interface InitializeRequestParams extends RequestParams {
|
| 234 |
+
/**
|
| 235 |
+
* The latest version of the Model Context Protocol that the client supports. The client MAY decide to support older versions as well.
|
| 236 |
+
*/
|
| 237 |
+
protocolVersion: string;
|
| 238 |
+
capabilities: ClientCapabilities;
|
| 239 |
+
clientInfo: Implementation;
|
| 240 |
+
}
|
| 241 |
+
/**
|
| 242 |
+
* This request is sent from the client to the server when it first connects, asking it to begin initialization.
|
| 243 |
+
*
|
| 244 |
+
* @category `initialize`
|
| 245 |
+
*/
|
| 246 |
+
export interface InitializeRequest extends JSONRPCRequest {
|
| 247 |
+
method: "initialize";
|
| 248 |
+
params: InitializeRequestParams;
|
| 249 |
+
}
|
| 250 |
+
/**
|
| 251 |
+
* After receiving an initialize request from the client, the server sends this response.
|
| 252 |
+
*
|
| 253 |
+
* @category `initialize`
|
| 254 |
+
*/
|
| 255 |
+
export interface InitializeResult extends Result {
|
| 256 |
+
/**
|
| 257 |
+
* The version of the Model Context Protocol that the server wants to use. This may not match the version that the client requested. If the client cannot support this version, it MUST disconnect.
|
| 258 |
+
*/
|
| 259 |
+
protocolVersion: string;
|
| 260 |
+
capabilities: ServerCapabilities;
|
| 261 |
+
serverInfo: Implementation;
|
| 262 |
+
/**
|
| 263 |
+
* Instructions describing how to use the server and its features.
|
| 264 |
+
*
|
| 265 |
+
* This can be used by clients to improve the LLM's understanding of available tools, resources, etc. It can be thought of like a "hint" to the model. For example, this information MAY be added to the system prompt.
|
| 266 |
+
*/
|
| 267 |
+
instructions?: string;
|
| 268 |
+
}
|
| 269 |
+
/**
|
| 270 |
+
* This notification is sent from the client to the server after initialization has finished.
|
| 271 |
+
*
|
| 272 |
+
* @category `notifications/initialized`
|
| 273 |
+
*/
|
| 274 |
+
export interface InitializedNotification extends JSONRPCNotification {
|
| 275 |
+
method: "notifications/initialized";
|
| 276 |
+
params?: NotificationParams;
|
| 277 |
+
}
|
| 278 |
+
/**
|
| 279 |
+
* Capabilities a client may support. Known capabilities are defined here, in this schema, but this is not a closed set: any client can define its own, additional capabilities.
|
| 280 |
+
*
|
| 281 |
+
* @category `initialize`
|
| 282 |
+
*/
|
| 283 |
+
export interface ClientCapabilities {
|
| 284 |
+
/**
|
| 285 |
+
* Experimental, non-standard capabilities that the client supports.
|
| 286 |
+
*/
|
| 287 |
+
experimental?: {
|
| 288 |
+
[key: string]: object;
|
| 289 |
+
};
|
| 290 |
+
/**
|
| 291 |
+
* Present if the client supports listing roots.
|
| 292 |
+
*/
|
| 293 |
+
roots?: {
|
| 294 |
+
/**
|
| 295 |
+
* Whether the client supports notifications for changes to the roots list.
|
| 296 |
+
*/
|
| 297 |
+
listChanged?: boolean;
|
| 298 |
+
};
|
| 299 |
+
/**
|
| 300 |
+
* Present if the client supports sampling from an LLM.
|
| 301 |
+
*/
|
| 302 |
+
sampling?: {
|
| 303 |
+
/**
|
| 304 |
+
* Whether the client supports context inclusion via includeContext parameter.
|
| 305 |
+
* If not declared, servers SHOULD only use `includeContext: "none"` (or omit it).
|
| 306 |
+
*/
|
| 307 |
+
context?: object;
|
| 308 |
+
/**
|
| 309 |
+
* Whether the client supports tool use via tools and toolChoice parameters.
|
| 310 |
+
*/
|
| 311 |
+
tools?: object;
|
| 312 |
+
};
|
| 313 |
+
/**
|
| 314 |
+
* Present if the client supports elicitation from the server.
|
| 315 |
+
*/
|
| 316 |
+
elicitation?: {
|
| 317 |
+
form?: object;
|
| 318 |
+
url?: object;
|
| 319 |
+
};
|
| 320 |
+
/**
|
| 321 |
+
* Present if the client supports task-augmented requests.
|
| 322 |
+
*/
|
| 323 |
+
tasks?: {
|
| 324 |
+
/**
|
| 325 |
+
* Whether this client supports tasks/list.
|
| 326 |
+
*/
|
| 327 |
+
list?: object;
|
| 328 |
+
/**
|
| 329 |
+
* Whether this client supports tasks/cancel.
|
| 330 |
+
*/
|
| 331 |
+
cancel?: object;
|
| 332 |
+
/**
|
| 333 |
+
* Specifies which request types can be augmented with tasks.
|
| 334 |
+
*/
|
| 335 |
+
requests?: {
|
| 336 |
+
/**
|
| 337 |
+
* Task support for sampling-related requests.
|
| 338 |
+
*/
|
| 339 |
+
sampling?: {
|
| 340 |
+
/**
|
| 341 |
+
* Whether the client supports task-augmented sampling/createMessage requests.
|
| 342 |
+
*/
|
| 343 |
+
createMessage?: object;
|
| 344 |
+
};
|
| 345 |
+
/**
|
| 346 |
+
* Task support for elicitation-related requests.
|
| 347 |
+
*/
|
| 348 |
+
elicitation?: {
|
| 349 |
+
/**
|
| 350 |
+
* Whether the client supports task-augmented elicitation/create requests.
|
| 351 |
+
*/
|
| 352 |
+
create?: object;
|
| 353 |
+
};
|
| 354 |
+
};
|
| 355 |
+
};
|
| 356 |
+
/**
|
| 357 |
+
* Extensions that the client supports. Keys are extension identifiers (vendor-prefix/extension-name).
|
| 358 |
+
*/
|
| 359 |
+
extensions?: {
|
| 360 |
+
[key: string]: object;
|
| 361 |
+
};
|
| 362 |
+
}
|
| 363 |
+
/**
|
| 364 |
+
* Capabilities that a server may support. Known capabilities are defined here, in this schema, but this is not a closed set: any server can define its own, additional capabilities.
|
| 365 |
+
*
|
| 366 |
+
* @category `initialize`
|
| 367 |
+
*/
|
| 368 |
+
export interface ServerCapabilities {
|
| 369 |
+
/**
|
| 370 |
+
* Experimental, non-standard capabilities that the server supports.
|
| 371 |
+
*/
|
| 372 |
+
experimental?: {
|
| 373 |
+
[key: string]: object;
|
| 374 |
+
};
|
| 375 |
+
/**
|
| 376 |
+
* Present if the server supports sending log messages to the client.
|
| 377 |
+
*/
|
| 378 |
+
logging?: object;
|
| 379 |
+
/**
|
| 380 |
+
* Present if the server supports argument autocompletion suggestions.
|
| 381 |
+
*/
|
| 382 |
+
completions?: object;
|
| 383 |
+
/**
|
| 384 |
+
* Present if the server offers any prompt templates.
|
| 385 |
+
*/
|
| 386 |
+
prompts?: {
|
| 387 |
+
/**
|
| 388 |
+
* Whether this server supports notifications for changes to the prompt list.
|
| 389 |
+
*/
|
| 390 |
+
listChanged?: boolean;
|
| 391 |
+
};
|
| 392 |
+
/**
|
| 393 |
+
* Present if the server offers any resources to read.
|
| 394 |
+
*/
|
| 395 |
+
resources?: {
|
| 396 |
+
/**
|
| 397 |
+
* Whether this server supports subscribing to resource updates.
|
| 398 |
+
*/
|
| 399 |
+
subscribe?: boolean;
|
| 400 |
+
/**
|
| 401 |
+
* Whether this server supports notifications for changes to the resource list.
|
| 402 |
+
*/
|
| 403 |
+
listChanged?: boolean;
|
| 404 |
+
};
|
| 405 |
+
/**
|
| 406 |
+
* Present if the server offers any tools to call.
|
| 407 |
+
*/
|
| 408 |
+
tools?: {
|
| 409 |
+
/**
|
| 410 |
+
* Whether this server supports notifications for changes to the tool list.
|
| 411 |
+
*/
|
| 412 |
+
listChanged?: boolean;
|
| 413 |
+
};
|
| 414 |
+
/**
|
| 415 |
+
* Present if the server supports task-augmented requests.
|
| 416 |
+
*/
|
| 417 |
+
tasks?: {
|
| 418 |
+
/**
|
| 419 |
+
* Whether this server supports tasks/list.
|
| 420 |
+
*/
|
| 421 |
+
list?: object;
|
| 422 |
+
/**
|
| 423 |
+
* Whether this server supports tasks/cancel.
|
| 424 |
+
*/
|
| 425 |
+
cancel?: object;
|
| 426 |
+
/**
|
| 427 |
+
* Specifies which request types can be augmented with tasks.
|
| 428 |
+
*/
|
| 429 |
+
requests?: {
|
| 430 |
+
/**
|
| 431 |
+
* Task support for tool-related requests.
|
| 432 |
+
*/
|
| 433 |
+
tools?: {
|
| 434 |
+
/**
|
| 435 |
+
* Whether the server supports task-augmented tools/call requests.
|
| 436 |
+
*/
|
| 437 |
+
call?: object;
|
| 438 |
+
};
|
| 439 |
+
};
|
| 440 |
+
};
|
| 441 |
+
/**
|
| 442 |
+
* Extensions that the server supports. Keys are extension identifiers (vendor-prefix/extension-name).
|
| 443 |
+
*/
|
| 444 |
+
extensions?: {
|
| 445 |
+
[key: string]: object;
|
| 446 |
+
};
|
| 447 |
+
}
|
| 448 |
+
/**
|
| 449 |
+
* An optionally-sized icon that can be displayed in a user interface.
|
| 450 |
+
*
|
| 451 |
+
* @category Common Types
|
| 452 |
+
*/
|
| 453 |
+
export interface Icon {
|
| 454 |
+
/**
|
| 455 |
+
* A standard URI pointing to an icon resource. May be an HTTP/HTTPS URL or a
|
| 456 |
+
* `data:` URI with Base64-encoded image data.
|
| 457 |
+
*
|
| 458 |
+
* Consumers SHOULD takes steps to ensure URLs serving icons are from the
|
| 459 |
+
* same domain as the client/server or a trusted domain.
|
| 460 |
+
*
|
| 461 |
+
* Consumers SHOULD take appropriate precautions when consuming SVGs as they can contain
|
| 462 |
+
* executable JavaScript.
|
| 463 |
+
*
|
| 464 |
+
* @format uri
|
| 465 |
+
*/
|
| 466 |
+
src: string;
|
| 467 |
+
/**
|
| 468 |
+
* Optional MIME type override if the source MIME type is missing or generic.
|
| 469 |
+
* For example: `"image/png"`, `"image/jpeg"`, or `"image/svg+xml"`.
|
| 470 |
+
*/
|
| 471 |
+
mimeType?: string;
|
| 472 |
+
/**
|
| 473 |
+
* Optional array of strings that specify sizes at which the icon can be used.
|
| 474 |
+
* Each string should be in WxH format (e.g., `"48x48"`, `"96x96"`) or `"any"` for scalable formats like SVG.
|
| 475 |
+
*
|
| 476 |
+
* If not provided, the client should assume that the icon can be used at any size.
|
| 477 |
+
*/
|
| 478 |
+
sizes?: string[];
|
| 479 |
+
/**
|
| 480 |
+
* Optional specifier for the theme this icon is designed for. `light` indicates
|
| 481 |
+
* the icon is designed to be used with a light background, and `dark` indicates
|
| 482 |
+
* the icon is designed to be used with a dark background.
|
| 483 |
+
*
|
| 484 |
+
* If not provided, the client should assume the icon can be used with any theme.
|
| 485 |
+
*/
|
| 486 |
+
theme?: "light" | "dark";
|
| 487 |
+
}
|
| 488 |
+
/**
|
| 489 |
+
* Base interface to add `icons` property.
|
| 490 |
+
*
|
| 491 |
+
* @internal
|
| 492 |
+
*/
|
| 493 |
+
export interface Icons {
|
| 494 |
+
/**
|
| 495 |
+
* Optional set of sized icons that the client can display in a user interface.
|
| 496 |
+
*
|
| 497 |
+
* Clients that support rendering icons MUST support at least the following MIME types:
|
| 498 |
+
* - `image/png` - PNG images (safe, universal compatibility)
|
| 499 |
+
* - `image/jpeg` (and `image/jpg`) - JPEG images (safe, universal compatibility)
|
| 500 |
+
*
|
| 501 |
+
* Clients that support rendering icons SHOULD also support:
|
| 502 |
+
* - `image/svg+xml` - SVG images (scalable but requires security precautions)
|
| 503 |
+
* - `image/webp` - WebP images (modern, efficient format)
|
| 504 |
+
*/
|
| 505 |
+
icons?: Icon[];
|
| 506 |
+
}
|
| 507 |
+
/**
|
| 508 |
+
* Base interface for metadata with name (identifier) and title (display name) properties.
|
| 509 |
+
*
|
| 510 |
+
* @internal
|
| 511 |
+
*/
|
| 512 |
+
export interface BaseMetadata {
|
| 513 |
+
/**
|
| 514 |
+
* Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).
|
| 515 |
+
*/
|
| 516 |
+
name: string;
|
| 517 |
+
/**
|
| 518 |
+
* Intended for UI and end-user contexts — optimized to be human-readable and easily understood,
|
| 519 |
+
* even by those unfamiliar with domain-specific terminology.
|
| 520 |
+
*
|
| 521 |
+
* If not provided, the name should be used for display (except for Tool,
|
| 522 |
+
* where `annotations.title` should be given precedence over using `name`,
|
| 523 |
+
* if present).
|
| 524 |
+
*/
|
| 525 |
+
title?: string;
|
| 526 |
+
}
|
| 527 |
+
/**
|
| 528 |
+
* Describes the MCP implementation.
|
| 529 |
+
*
|
| 530 |
+
* @category `initialize`
|
| 531 |
+
*/
|
| 532 |
+
export interface Implementation extends BaseMetadata, Icons {
|
| 533 |
+
version: string;
|
| 534 |
+
/**
|
| 535 |
+
* An optional human-readable description of what this implementation does.
|
| 536 |
+
*
|
| 537 |
+
* This can be used by clients or servers to provide context about their purpose
|
| 538 |
+
* and capabilities. For example, a server might describe the types of resources
|
| 539 |
+
* or tools it provides, while a client might describe its intended use case.
|
| 540 |
+
*/
|
| 541 |
+
description?: string;
|
| 542 |
+
/**
|
| 543 |
+
* An optional URL of the website for this implementation.
|
| 544 |
+
*
|
| 545 |
+
* @format uri
|
| 546 |
+
*/
|
| 547 |
+
websiteUrl?: string;
|
| 548 |
+
}
|
| 549 |
+
/**
|
| 550 |
+
* A ping, issued by either the server or the client, to check that the other party is still alive. The receiver must promptly respond, or else may be disconnected.
|
| 551 |
+
*
|
| 552 |
+
* @category `ping`
|
| 553 |
+
*/
|
| 554 |
+
export interface PingRequest extends JSONRPCRequest {
|
| 555 |
+
method: "ping";
|
| 556 |
+
params?: RequestParams;
|
| 557 |
+
}
|
| 558 |
+
/**
|
| 559 |
+
* Parameters for a `notifications/progress` notification.
|
| 560 |
+
*
|
| 561 |
+
* @category `notifications/progress`
|
| 562 |
+
*/
|
| 563 |
+
export interface ProgressNotificationParams extends NotificationParams {
|
| 564 |
+
/**
|
| 565 |
+
* The progress token which was given in the initial request, used to associate this notification with the request that is proceeding.
|
| 566 |
+
*/
|
| 567 |
+
progressToken: ProgressToken;
|
| 568 |
+
/**
|
| 569 |
+
* The progress thus far. This should increase every time progress is made, even if the total is unknown.
|
| 570 |
+
*
|
| 571 |
+
* @TJS-type number
|
| 572 |
+
*/
|
| 573 |
+
progress: number;
|
| 574 |
+
/**
|
| 575 |
+
* Total number of items to process (or total progress required), if known.
|
| 576 |
+
*
|
| 577 |
+
* @TJS-type number
|
| 578 |
+
*/
|
| 579 |
+
total?: number;
|
| 580 |
+
/**
|
| 581 |
+
* An optional message describing the current progress.
|
| 582 |
+
*/
|
| 583 |
+
message?: string;
|
| 584 |
+
}
|
| 585 |
+
/**
|
| 586 |
+
* An out-of-band notification used to inform the receiver of a progress update for a long-running request.
|
| 587 |
+
*
|
| 588 |
+
* @category `notifications/progress`
|
| 589 |
+
*/
|
| 590 |
+
export interface ProgressNotification extends JSONRPCNotification {
|
| 591 |
+
method: "notifications/progress";
|
| 592 |
+
params: ProgressNotificationParams;
|
| 593 |
+
}
|
| 594 |
+
/**
|
| 595 |
+
* Common parameters for paginated requests.
|
| 596 |
+
*
|
| 597 |
+
* @internal
|
| 598 |
+
*/
|
| 599 |
+
export interface PaginatedRequestParams extends RequestParams {
|
| 600 |
+
/**
|
| 601 |
+
* An opaque token representing the current pagination position.
|
| 602 |
+
* If provided, the server should return results starting after this cursor.
|
| 603 |
+
*/
|
| 604 |
+
cursor?: Cursor;
|
| 605 |
+
}
|
| 606 |
+
/** @internal */
|
| 607 |
+
export interface PaginatedRequest extends JSONRPCRequest {
|
| 608 |
+
params?: PaginatedRequestParams;
|
| 609 |
+
}
|
| 610 |
+
/** @internal */
|
| 611 |
+
export interface PaginatedResult extends Result {
|
| 612 |
+
/**
|
| 613 |
+
* An opaque token representing the pagination position after the last returned result.
|
| 614 |
+
* If present, there may be more results available.
|
| 615 |
+
*/
|
| 616 |
+
nextCursor?: Cursor;
|
| 617 |
+
}
|
| 618 |
+
/**
|
| 619 |
+
* Sent from the client to request a list of resources the server has.
|
| 620 |
+
*
|
| 621 |
+
* @category `resources/list`
|
| 622 |
+
*/
|
| 623 |
+
export interface ListResourcesRequest extends PaginatedRequest {
|
| 624 |
+
method: "resources/list";
|
| 625 |
+
}
|
| 626 |
+
/**
|
| 627 |
+
* The server's response to a resources/list request from the client.
|
| 628 |
+
*
|
| 629 |
+
* @category `resources/list`
|
| 630 |
+
*/
|
| 631 |
+
export interface ListResourcesResult extends PaginatedResult {
|
| 632 |
+
resources: Resource[];
|
| 633 |
+
}
|
| 634 |
+
/**
|
| 635 |
+
* Sent from the client to request a list of resource templates the server has.
|
| 636 |
+
*
|
| 637 |
+
* @category `resources/templates/list`
|
| 638 |
+
*/
|
| 639 |
+
export interface ListResourceTemplatesRequest extends PaginatedRequest {
|
| 640 |
+
method: "resources/templates/list";
|
| 641 |
+
}
|
| 642 |
+
/**
|
| 643 |
+
* The server's response to a resources/templates/list request from the client.
|
| 644 |
+
*
|
| 645 |
+
* @category `resources/templates/list`
|
| 646 |
+
*/
|
| 647 |
+
export interface ListResourceTemplatesResult extends PaginatedResult {
|
| 648 |
+
resourceTemplates: ResourceTemplate[];
|
| 649 |
+
}
|
| 650 |
+
/**
|
| 651 |
+
* Common parameters when working with resources.
|
| 652 |
+
*
|
| 653 |
+
* @internal
|
| 654 |
+
*/
|
| 655 |
+
export interface ResourceRequestParams extends RequestParams {
|
| 656 |
+
/**
|
| 657 |
+
* The URI of the resource. The URI can use any protocol; it is up to the server how to interpret it.
|
| 658 |
+
*
|
| 659 |
+
* @format uri
|
| 660 |
+
*/
|
| 661 |
+
uri: string;
|
| 662 |
+
}
|
| 663 |
+
/**
|
| 664 |
+
* Parameters for a `resources/read` request.
|
| 665 |
+
*
|
| 666 |
+
* @category `resources/read`
|
| 667 |
+
*/
|
| 668 |
+
export interface ReadResourceRequestParams extends ResourceRequestParams {
|
| 669 |
+
}
|
| 670 |
+
/**
|
| 671 |
+
* Sent from the client to the server, to read a specific resource URI.
|
| 672 |
+
*
|
| 673 |
+
* @category `resources/read`
|
| 674 |
+
*/
|
| 675 |
+
export interface ReadResourceRequest extends JSONRPCRequest {
|
| 676 |
+
method: "resources/read";
|
| 677 |
+
params: ReadResourceRequestParams;
|
| 678 |
+
}
|
| 679 |
+
/**
|
| 680 |
+
* The server's response to a resources/read request from the client.
|
| 681 |
+
*
|
| 682 |
+
* @category `resources/read`
|
| 683 |
+
*/
|
| 684 |
+
export interface ReadResourceResult extends Result {
|
| 685 |
+
contents: (TextResourceContents | BlobResourceContents)[];
|
| 686 |
+
}
|
| 687 |
+
/**
|
| 688 |
+
* An optional notification from the server to the client, informing it that the list of resources it can read from has changed. This may be issued by servers without any previous subscription from the client.
|
| 689 |
+
*
|
| 690 |
+
* @category `notifications/resources/list_changed`
|
| 691 |
+
*/
|
| 692 |
+
export interface ResourceListChangedNotification extends JSONRPCNotification {
|
| 693 |
+
method: "notifications/resources/list_changed";
|
| 694 |
+
params?: NotificationParams;
|
| 695 |
+
}
|
| 696 |
+
/**
|
| 697 |
+
* Parameters for a `resources/subscribe` request.
|
| 698 |
+
*
|
| 699 |
+
* @category `resources/subscribe`
|
| 700 |
+
*/
|
| 701 |
+
export interface SubscribeRequestParams extends ResourceRequestParams {
|
| 702 |
+
}
|
| 703 |
+
/**
|
| 704 |
+
* Sent from the client to request resources/updated notifications from the server whenever a particular resource changes.
|
| 705 |
+
*
|
| 706 |
+
* @category `resources/subscribe`
|
| 707 |
+
*/
|
| 708 |
+
export interface SubscribeRequest extends JSONRPCRequest {
|
| 709 |
+
method: "resources/subscribe";
|
| 710 |
+
params: SubscribeRequestParams;
|
| 711 |
+
}
|
| 712 |
+
/**
|
| 713 |
+
* Parameters for a `resources/unsubscribe` request.
|
| 714 |
+
*
|
| 715 |
+
* @category `resources/unsubscribe`
|
| 716 |
+
*/
|
| 717 |
+
export interface UnsubscribeRequestParams extends ResourceRequestParams {
|
| 718 |
+
}
|
| 719 |
+
/**
|
| 720 |
+
* Sent from the client to request cancellation of resources/updated notifications from the server. This should follow a previous resources/subscribe request.
|
| 721 |
+
*
|
| 722 |
+
* @category `resources/unsubscribe`
|
| 723 |
+
*/
|
| 724 |
+
export interface UnsubscribeRequest extends JSONRPCRequest {
|
| 725 |
+
method: "resources/unsubscribe";
|
| 726 |
+
params: UnsubscribeRequestParams;
|
| 727 |
+
}
|
| 728 |
+
/**
|
| 729 |
+
* Parameters for a `notifications/resources/updated` notification.
|
| 730 |
+
*
|
| 731 |
+
* @category `notifications/resources/updated`
|
| 732 |
+
*/
|
| 733 |
+
export interface ResourceUpdatedNotificationParams extends NotificationParams {
|
| 734 |
+
/**
|
| 735 |
+
* The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to.
|
| 736 |
+
*
|
| 737 |
+
* @format uri
|
| 738 |
+
*/
|
| 739 |
+
uri: string;
|
| 740 |
+
}
|
| 741 |
+
/**
|
| 742 |
+
* A notification from the server to the client, informing it that a resource has changed and may need to be read again. This should only be sent if the client previously sent a resources/subscribe request.
|
| 743 |
+
*
|
| 744 |
+
* @category `notifications/resources/updated`
|
| 745 |
+
*/
|
| 746 |
+
export interface ResourceUpdatedNotification extends JSONRPCNotification {
|
| 747 |
+
method: "notifications/resources/updated";
|
| 748 |
+
params: ResourceUpdatedNotificationParams;
|
| 749 |
+
}
|
| 750 |
+
/**
|
| 751 |
+
* A known resource that the server is capable of reading.
|
| 752 |
+
*
|
| 753 |
+
* @category `resources/list`
|
| 754 |
+
*/
|
| 755 |
+
export interface Resource extends BaseMetadata, Icons {
|
| 756 |
+
/**
|
| 757 |
+
* The URI of this resource.
|
| 758 |
+
*
|
| 759 |
+
* @format uri
|
| 760 |
+
*/
|
| 761 |
+
uri: string;
|
| 762 |
+
/**
|
| 763 |
+
* A description of what this resource represents.
|
| 764 |
+
*
|
| 765 |
+
* This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model.
|
| 766 |
+
*/
|
| 767 |
+
description?: string;
|
| 768 |
+
/**
|
| 769 |
+
* The MIME type of this resource, if known.
|
| 770 |
+
*/
|
| 771 |
+
mimeType?: string;
|
| 772 |
+
/**
|
| 773 |
+
* Optional annotations for the client.
|
| 774 |
+
*/
|
| 775 |
+
annotations?: Annotations;
|
| 776 |
+
/**
|
| 777 |
+
* The size of the raw resource content, in bytes (i.e., before base64 encoding or any tokenization), if known.
|
| 778 |
+
*
|
| 779 |
+
* This can be used by Hosts to display file sizes and estimate context window usage.
|
| 780 |
+
*/
|
| 781 |
+
size?: number;
|
| 782 |
+
/**
|
| 783 |
+
* See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage.
|
| 784 |
+
*/
|
| 785 |
+
_meta?: {
|
| 786 |
+
[key: string]: unknown;
|
| 787 |
+
};
|
| 788 |
+
}
|
| 789 |
+
/**
|
| 790 |
+
* A template description for resources available on the server.
|
| 791 |
+
*
|
| 792 |
+
* @category `resources/templates/list`
|
| 793 |
+
*/
|
| 794 |
+
export interface ResourceTemplate extends BaseMetadata, Icons {
|
| 795 |
+
/**
|
| 796 |
+
* A URI template (according to RFC 6570) that can be used to construct resource URIs.
|
| 797 |
+
*
|
| 798 |
+
* @format uri-template
|
| 799 |
+
*/
|
| 800 |
+
uriTemplate: string;
|
| 801 |
+
/**
|
| 802 |
+
* A description of what this template is for.
|
| 803 |
+
*
|
| 804 |
+
* This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model.
|
| 805 |
+
*/
|
| 806 |
+
description?: string;
|
| 807 |
+
/**
|
| 808 |
+
* The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type.
|
| 809 |
+
*/
|
| 810 |
+
mimeType?: string;
|
| 811 |
+
/**
|
| 812 |
+
* Optional annotations for the client.
|
| 813 |
+
*/
|
| 814 |
+
annotations?: Annotations;
|
| 815 |
+
/**
|
| 816 |
+
* See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage.
|
| 817 |
+
*/
|
| 818 |
+
_meta?: {
|
| 819 |
+
[key: string]: unknown;
|
| 820 |
+
};
|
| 821 |
+
}
|
| 822 |
+
/**
|
| 823 |
+
* The contents of a specific resource or sub-resource.
|
| 824 |
+
*
|
| 825 |
+
* @internal
|
| 826 |
+
*/
|
| 827 |
+
export interface ResourceContents {
|
| 828 |
+
/**
|
| 829 |
+
* The URI of this resource.
|
| 830 |
+
*
|
| 831 |
+
* @format uri
|
| 832 |
+
*/
|
| 833 |
+
uri: string;
|
| 834 |
+
/**
|
| 835 |
+
* The MIME type of this resource, if known.
|
| 836 |
+
*/
|
| 837 |
+
mimeType?: string;
|
| 838 |
+
/**
|
| 839 |
+
* See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage.
|
| 840 |
+
*/
|
| 841 |
+
_meta?: {
|
| 842 |
+
[key: string]: unknown;
|
| 843 |
+
};
|
| 844 |
+
}
|
| 845 |
+
/**
|
| 846 |
+
* @category Content
|
| 847 |
+
*/
|
| 848 |
+
export interface TextResourceContents extends ResourceContents {
|
| 849 |
+
/**
|
| 850 |
+
* The text of the item. This must only be set if the item can actually be represented as text (not binary data).
|
| 851 |
+
*/
|
| 852 |
+
text: string;
|
| 853 |
+
}
|
| 854 |
+
/**
|
| 855 |
+
* @category Content
|
| 856 |
+
*/
|
| 857 |
+
export interface BlobResourceContents extends ResourceContents {
|
| 858 |
+
/**
|
| 859 |
+
* A base64-encoded string representing the binary data of the item.
|
| 860 |
+
*
|
| 861 |
+
* @format byte
|
| 862 |
+
*/
|
| 863 |
+
blob: string;
|
| 864 |
+
}
|
| 865 |
+
/**
|
| 866 |
+
* Sent from the client to request a list of prompts and prompt templates the server has.
|
| 867 |
+
*
|
| 868 |
+
* @category `prompts/list`
|
| 869 |
+
*/
|
| 870 |
+
export interface ListPromptsRequest extends PaginatedRequest {
|
| 871 |
+
method: "prompts/list";
|
| 872 |
+
}
|
| 873 |
+
/**
|
| 874 |
+
* The server's response to a prompts/list request from the client.
|
| 875 |
+
*
|
| 876 |
+
* @category `prompts/list`
|
| 877 |
+
*/
|
| 878 |
+
export interface ListPromptsResult extends PaginatedResult {
|
| 879 |
+
prompts: Prompt[];
|
| 880 |
+
}
|
| 881 |
+
/**
|
| 882 |
+
* Parameters for a `prompts/get` request.
|
| 883 |
+
*
|
| 884 |
+
* @category `prompts/get`
|
| 885 |
+
*/
|
| 886 |
+
export interface GetPromptRequestParams extends RequestParams {
|
| 887 |
+
/**
|
| 888 |
+
* The name of the prompt or prompt template.
|
| 889 |
+
*/
|
| 890 |
+
name: string;
|
| 891 |
+
/**
|
| 892 |
+
* Arguments to use for templating the prompt.
|
| 893 |
+
*/
|
| 894 |
+
arguments?: {
|
| 895 |
+
[key: string]: string;
|
| 896 |
+
};
|
| 897 |
+
}
|
| 898 |
+
/**
|
| 899 |
+
* Used by the client to get a prompt provided by the server.
|
| 900 |
+
*
|
| 901 |
+
* @category `prompts/get`
|
| 902 |
+
*/
|
| 903 |
+
export interface GetPromptRequest extends JSONRPCRequest {
|
| 904 |
+
method: "prompts/get";
|
| 905 |
+
params: GetPromptRequestParams;
|
| 906 |
+
}
|
| 907 |
+
/**
|
| 908 |
+
* The server's response to a prompts/get request from the client.
|
| 909 |
+
*
|
| 910 |
+
* @category `prompts/get`
|
| 911 |
+
*/
|
| 912 |
+
export interface GetPromptResult extends Result {
|
| 913 |
+
/**
|
| 914 |
+
* An optional description for the prompt.
|
| 915 |
+
*/
|
| 916 |
+
description?: string;
|
| 917 |
+
messages: PromptMessage[];
|
| 918 |
+
}
|
| 919 |
+
/**
|
| 920 |
+
* A prompt or prompt template that the server offers.
|
| 921 |
+
*
|
| 922 |
+
* @category `prompts/list`
|
| 923 |
+
*/
|
| 924 |
+
export interface Prompt extends BaseMetadata, Icons {
|
| 925 |
+
/**
|
| 926 |
+
* An optional description of what this prompt provides
|
| 927 |
+
*/
|
| 928 |
+
description?: string;
|
| 929 |
+
/**
|
| 930 |
+
* A list of arguments to use for templating the prompt.
|
| 931 |
+
*/
|
| 932 |
+
arguments?: PromptArgument[];
|
| 933 |
+
/**
|
| 934 |
+
* See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage.
|
| 935 |
+
*/
|
| 936 |
+
_meta?: {
|
| 937 |
+
[key: string]: unknown;
|
| 938 |
+
};
|
| 939 |
+
}
|
| 940 |
+
/**
|
| 941 |
+
* Describes an argument that a prompt can accept.
|
| 942 |
+
*
|
| 943 |
+
* @category `prompts/list`
|
| 944 |
+
*/
|
| 945 |
+
export interface PromptArgument extends BaseMetadata {
|
| 946 |
+
/**
|
| 947 |
+
* A human-readable description of the argument.
|
| 948 |
+
*/
|
| 949 |
+
description?: string;
|
| 950 |
+
/**
|
| 951 |
+
* Whether this argument must be provided.
|
| 952 |
+
*/
|
| 953 |
+
required?: boolean;
|
| 954 |
+
}
|
| 955 |
+
/**
|
| 956 |
+
* The sender or recipient of messages and data in a conversation.
|
| 957 |
+
*
|
| 958 |
+
* @category Common Types
|
| 959 |
+
*/
|
| 960 |
+
export type Role = "user" | "assistant";
|
| 961 |
+
/**
|
| 962 |
+
* Describes a message returned as part of a prompt.
|
| 963 |
+
*
|
| 964 |
+
* This is similar to `SamplingMessage`, but also supports the embedding of
|
| 965 |
+
* resources from the MCP server.
|
| 966 |
+
*
|
| 967 |
+
* @category `prompts/get`
|
| 968 |
+
*/
|
| 969 |
+
export interface PromptMessage {
|
| 970 |
+
role: Role;
|
| 971 |
+
content: ContentBlock;
|
| 972 |
+
}
|
| 973 |
+
/**
|
| 974 |
+
* A resource that the server is capable of reading, included in a prompt or tool call result.
|
| 975 |
+
*
|
| 976 |
+
* Note: resource links returned by tools are not guaranteed to appear in the results of `resources/list` requests.
|
| 977 |
+
*
|
| 978 |
+
* @category Content
|
| 979 |
+
*/
|
| 980 |
+
export interface ResourceLink extends Resource {
|
| 981 |
+
type: "resource_link";
|
| 982 |
+
}
|
| 983 |
+
/**
|
| 984 |
+
* The contents of a resource, embedded into a prompt or tool call result.
|
| 985 |
+
*
|
| 986 |
+
* It is up to the client how best to render embedded resources for the benefit
|
| 987 |
+
* of the LLM and/or the user.
|
| 988 |
+
*
|
| 989 |
+
* @category Content
|
| 990 |
+
*/
|
| 991 |
+
export interface EmbeddedResource {
|
| 992 |
+
type: "resource";
|
| 993 |
+
resource: TextResourceContents | BlobResourceContents;
|
| 994 |
+
/**
|
| 995 |
+
* Optional annotations for the client.
|
| 996 |
+
*/
|
| 997 |
+
annotations?: Annotations;
|
| 998 |
+
/**
|
| 999 |
+
* See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage.
|
| 1000 |
+
*/
|
| 1001 |
+
_meta?: {
|
| 1002 |
+
[key: string]: unknown;
|
| 1003 |
+
};
|
| 1004 |
+
}
|
| 1005 |
+
/**
|
| 1006 |
+
* An optional notification from the server to the client, informing it that the list of prompts it offers has changed. This may be issued by servers without any previous subscription from the client.
|
| 1007 |
+
*
|
| 1008 |
+
* @category `notifications/prompts/list_changed`
|
| 1009 |
+
*/
|
| 1010 |
+
export interface PromptListChangedNotification extends JSONRPCNotification {
|
| 1011 |
+
method: "notifications/prompts/list_changed";
|
| 1012 |
+
params?: NotificationParams;
|
| 1013 |
+
}
|
| 1014 |
+
/**
|
| 1015 |
+
* Sent from the client to request a list of tools the server has.
|
| 1016 |
+
*
|
| 1017 |
+
* @category `tools/list`
|
| 1018 |
+
*/
|
| 1019 |
+
export interface ListToolsRequest extends PaginatedRequest {
|
| 1020 |
+
method: "tools/list";
|
| 1021 |
+
}
|
| 1022 |
+
/**
|
| 1023 |
+
* The server's response to a tools/list request from the client.
|
| 1024 |
+
*
|
| 1025 |
+
* @category `tools/list`
|
| 1026 |
+
*/
|
| 1027 |
+
export interface ListToolsResult extends PaginatedResult {
|
| 1028 |
+
tools: Tool[];
|
| 1029 |
+
}
|
| 1030 |
+
/**
|
| 1031 |
+
* The server's response to a tool call.
|
| 1032 |
+
*
|
| 1033 |
+
* @category `tools/call`
|
| 1034 |
+
*/
|
| 1035 |
+
export interface CallToolResult extends Result {
|
| 1036 |
+
/**
|
| 1037 |
+
* A list of content objects that represent the unstructured result of the tool call.
|
| 1038 |
+
*/
|
| 1039 |
+
content: ContentBlock[];
|
| 1040 |
+
/**
|
| 1041 |
+
* An optional JSON object that represents the structured result of the tool call.
|
| 1042 |
+
*/
|
| 1043 |
+
structuredContent?: {
|
| 1044 |
+
[key: string]: unknown;
|
| 1045 |
+
};
|
| 1046 |
+
/**
|
| 1047 |
+
* Whether the tool call ended in an error.
|
| 1048 |
+
*
|
| 1049 |
+
* If not set, this is assumed to be false (the call was successful).
|
| 1050 |
+
*
|
| 1051 |
+
* Any errors that originate from the tool SHOULD be reported inside the result
|
| 1052 |
+
* object, with `isError` set to true, _not_ as an MCP protocol-level error
|
| 1053 |
+
* response. Otherwise, the LLM would not be able to see that an error occurred
|
| 1054 |
+
* and self-correct.
|
| 1055 |
+
*
|
| 1056 |
+
* However, any errors in _finding_ the tool, an error indicating that the
|
| 1057 |
+
* server does not support tool calls, or any other exceptional conditions,
|
| 1058 |
+
* should be reported as an MCP error response.
|
| 1059 |
+
*/
|
| 1060 |
+
isError?: boolean;
|
| 1061 |
+
}
|
| 1062 |
+
/**
|
| 1063 |
+
* Parameters for a `tools/call` request.
|
| 1064 |
+
*
|
| 1065 |
+
* @category `tools/call`
|
| 1066 |
+
*/
|
| 1067 |
+
export interface CallToolRequestParams extends TaskAugmentedRequestParams {
|
| 1068 |
+
/**
|
| 1069 |
+
* The name of the tool.
|
| 1070 |
+
*/
|
| 1071 |
+
name: string;
|
| 1072 |
+
/**
|
| 1073 |
+
* Arguments to use for the tool call.
|
| 1074 |
+
*/
|
| 1075 |
+
arguments?: {
|
| 1076 |
+
[key: string]: unknown;
|
| 1077 |
+
};
|
| 1078 |
+
}
|
| 1079 |
+
/**
|
| 1080 |
+
* Used by the client to invoke a tool provided by the server.
|
| 1081 |
+
*
|
| 1082 |
+
* @category `tools/call`
|
| 1083 |
+
*/
|
| 1084 |
+
export interface CallToolRequest extends JSONRPCRequest {
|
| 1085 |
+
method: "tools/call";
|
| 1086 |
+
params: CallToolRequestParams;
|
| 1087 |
+
}
|
| 1088 |
+
/**
|
| 1089 |
+
* An optional notification from the server to the client, informing it that the list of tools it offers has changed. This may be issued by servers without any previous subscription from the client.
|
| 1090 |
+
*
|
| 1091 |
+
* @category `notifications/tools/list_changed`
|
| 1092 |
+
*/
|
| 1093 |
+
export interface ToolListChangedNotification extends JSONRPCNotification {
|
| 1094 |
+
method: "notifications/tools/list_changed";
|
| 1095 |
+
params?: NotificationParams;
|
| 1096 |
+
}
|
| 1097 |
+
/**
|
| 1098 |
+
* Additional properties describing a Tool to clients.
|
| 1099 |
+
*
|
| 1100 |
+
* NOTE: all properties in ToolAnnotations are **hints**.
|
| 1101 |
+
* They are not guaranteed to provide a faithful description of
|
| 1102 |
+
* tool behavior (including descriptive properties like `title`).
|
| 1103 |
+
*
|
| 1104 |
+
* Clients should never make tool use decisions based on ToolAnnotations
|
| 1105 |
+
* received from untrusted servers.
|
| 1106 |
+
*
|
| 1107 |
+
* @category `tools/list`
|
| 1108 |
+
*/
|
| 1109 |
+
export interface ToolAnnotations {
|
| 1110 |
+
/**
|
| 1111 |
+
* A human-readable title for the tool.
|
| 1112 |
+
*/
|
| 1113 |
+
title?: string;
|
| 1114 |
+
/**
|
| 1115 |
+
* If true, the tool does not modify its environment.
|
| 1116 |
+
*
|
| 1117 |
+
* Default: false
|
| 1118 |
+
*/
|
| 1119 |
+
readOnlyHint?: boolean;
|
| 1120 |
+
/**
|
| 1121 |
+
* If true, the tool may perform destructive updates to its environment.
|
| 1122 |
+
* If false, the tool performs only additive updates.
|
| 1123 |
+
*
|
| 1124 |
+
* (This property is meaningful only when `readOnlyHint == false`)
|
| 1125 |
+
*
|
| 1126 |
+
* Default: true
|
| 1127 |
+
*/
|
| 1128 |
+
destructiveHint?: boolean;
|
| 1129 |
+
/**
|
| 1130 |
+
* If true, calling the tool repeatedly with the same arguments
|
| 1131 |
+
* will have no additional effect on its environment.
|
| 1132 |
+
*
|
| 1133 |
+
* (This property is meaningful only when `readOnlyHint == false`)
|
| 1134 |
+
*
|
| 1135 |
+
* Default: false
|
| 1136 |
+
*/
|
| 1137 |
+
idempotentHint?: boolean;
|
| 1138 |
+
/**
|
| 1139 |
+
* If true, this tool may interact with an "open world" of external
|
| 1140 |
+
* entities. If false, the tool's domain of interaction is closed.
|
| 1141 |
+
* For example, the world of a web search tool is open, whereas that
|
| 1142 |
+
* of a memory tool is not.
|
| 1143 |
+
*
|
| 1144 |
+
* Default: true
|
| 1145 |
+
*/
|
| 1146 |
+
openWorldHint?: boolean;
|
| 1147 |
+
}
|
| 1148 |
+
/**
|
| 1149 |
+
* Execution-related properties for a tool.
|
| 1150 |
+
*
|
| 1151 |
+
* @category `tools/list`
|
| 1152 |
+
*/
|
| 1153 |
+
export interface ToolExecution {
|
| 1154 |
+
/**
|
| 1155 |
+
* Indicates whether this tool supports task-augmented execution.
|
| 1156 |
+
* This allows clients to handle long-running operations through polling
|
| 1157 |
+
* the task system.
|
| 1158 |
+
*
|
| 1159 |
+
* - "forbidden": Tool does not support task-augmented execution (default when absent)
|
| 1160 |
+
* - "optional": Tool may support task-augmented execution
|
| 1161 |
+
* - "required": Tool requires task-augmented execution
|
| 1162 |
+
*
|
| 1163 |
+
* Default: "forbidden"
|
| 1164 |
+
*/
|
| 1165 |
+
taskSupport?: "forbidden" | "optional" | "required";
|
| 1166 |
+
}
|
| 1167 |
+
/**
|
| 1168 |
+
* Definition for a tool the client can call.
|
| 1169 |
+
*
|
| 1170 |
+
* @category `tools/list`
|
| 1171 |
+
*/
|
| 1172 |
+
export interface Tool extends BaseMetadata, Icons {
|
| 1173 |
+
/**
|
| 1174 |
+
* A human-readable description of the tool.
|
| 1175 |
+
*
|
| 1176 |
+
* This can be used by clients to improve the LLM's understanding of available tools. It can be thought of like a "hint" to the model.
|
| 1177 |
+
*/
|
| 1178 |
+
description?: string;
|
| 1179 |
+
/**
|
| 1180 |
+
* A JSON Schema object defining the expected parameters for the tool.
|
| 1181 |
+
*/
|
| 1182 |
+
inputSchema: {
|
| 1183 |
+
$schema?: string;
|
| 1184 |
+
type: "object";
|
| 1185 |
+
properties?: {
|
| 1186 |
+
[key: string]: object;
|
| 1187 |
+
};
|
| 1188 |
+
required?: string[];
|
| 1189 |
+
};
|
| 1190 |
+
/**
|
| 1191 |
+
* Execution-related properties for this tool.
|
| 1192 |
+
*/
|
| 1193 |
+
execution?: ToolExecution;
|
| 1194 |
+
/**
|
| 1195 |
+
* An optional JSON Schema object defining the structure of the tool's output returned in
|
| 1196 |
+
* the structuredContent field of a CallToolResult.
|
| 1197 |
+
*
|
| 1198 |
+
* Defaults to JSON Schema 2020-12 when no explicit $schema is provided.
|
| 1199 |
+
* Currently restricted to type: "object" at the root level.
|
| 1200 |
+
*/
|
| 1201 |
+
outputSchema?: {
|
| 1202 |
+
$schema?: string;
|
| 1203 |
+
type: "object";
|
| 1204 |
+
properties?: {
|
| 1205 |
+
[key: string]: object;
|
| 1206 |
+
};
|
| 1207 |
+
required?: string[];
|
| 1208 |
+
};
|
| 1209 |
+
/**
|
| 1210 |
+
* Optional additional tool information.
|
| 1211 |
+
*
|
| 1212 |
+
* Display name precedence order is: title, annotations.title, then name.
|
| 1213 |
+
*/
|
| 1214 |
+
annotations?: ToolAnnotations;
|
| 1215 |
+
/**
|
| 1216 |
+
* See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage.
|
| 1217 |
+
*/
|
| 1218 |
+
_meta?: {
|
| 1219 |
+
[key: string]: unknown;
|
| 1220 |
+
};
|
| 1221 |
+
}
|
| 1222 |
+
/**
|
| 1223 |
+
* The status of a task.
|
| 1224 |
+
*
|
| 1225 |
+
* @category `tasks`
|
| 1226 |
+
*/
|
| 1227 |
+
export type TaskStatus = "working" | "input_required" | "completed" | "failed" | "cancelled";
|
| 1228 |
+
/**
|
| 1229 |
+
* Metadata for augmenting a request with task execution.
|
| 1230 |
+
* Include this in the `task` field of the request parameters.
|
| 1231 |
+
*
|
| 1232 |
+
* @category `tasks`
|
| 1233 |
+
*/
|
| 1234 |
+
export interface TaskMetadata {
|
| 1235 |
+
/**
|
| 1236 |
+
* Requested duration in milliseconds to retain task from creation.
|
| 1237 |
+
*/
|
| 1238 |
+
ttl?: number;
|
| 1239 |
+
}
|
| 1240 |
+
/**
|
| 1241 |
+
* Metadata for associating messages with a task.
|
| 1242 |
+
* Include this in the `_meta` field under the key `io.modelcontextprotocol/related-task`.
|
| 1243 |
+
*
|
| 1244 |
+
* @category `tasks`
|
| 1245 |
+
*/
|
| 1246 |
+
export interface RelatedTaskMetadata {
|
| 1247 |
+
/**
|
| 1248 |
+
* The task identifier this message is associated with.
|
| 1249 |
+
*/
|
| 1250 |
+
taskId: string;
|
| 1251 |
+
}
|
| 1252 |
+
/**
|
| 1253 |
+
* Data associated with a task.
|
| 1254 |
+
*
|
| 1255 |
+
* @category `tasks`
|
| 1256 |
+
*/
|
| 1257 |
+
export interface Task {
|
| 1258 |
+
/**
|
| 1259 |
+
* The task identifier.
|
| 1260 |
+
*/
|
| 1261 |
+
taskId: string;
|
| 1262 |
+
/**
|
| 1263 |
+
* Current task state.
|
| 1264 |
+
*/
|
| 1265 |
+
status: TaskStatus;
|
| 1266 |
+
/**
|
| 1267 |
+
* Optional human-readable message describing the current task state.
|
| 1268 |
+
* This can provide context for any status, including:
|
| 1269 |
+
* - Reasons for "cancelled" status
|
| 1270 |
+
* - Summaries for "completed" status
|
| 1271 |
+
* - Diagnostic information for "failed" status (e.g., error details, what went wrong)
|
| 1272 |
+
*/
|
| 1273 |
+
statusMessage?: string;
|
| 1274 |
+
/**
|
| 1275 |
+
* ISO 8601 timestamp when the task was created.
|
| 1276 |
+
*/
|
| 1277 |
+
createdAt: string;
|
| 1278 |
+
/**
|
| 1279 |
+
* ISO 8601 timestamp when the task was last updated.
|
| 1280 |
+
*/
|
| 1281 |
+
lastUpdatedAt: string;
|
| 1282 |
+
/**
|
| 1283 |
+
* Actual retention duration from creation in milliseconds, null for unlimited.
|
| 1284 |
+
*/
|
| 1285 |
+
ttl: number | null;
|
| 1286 |
+
/**
|
| 1287 |
+
* Suggested polling interval in milliseconds.
|
| 1288 |
+
*/
|
| 1289 |
+
pollInterval?: number;
|
| 1290 |
+
}
|
| 1291 |
+
/**
|
| 1292 |
+
* A response to a task-augmented request.
|
| 1293 |
+
*
|
| 1294 |
+
* @category `tasks`
|
| 1295 |
+
*/
|
| 1296 |
+
export interface CreateTaskResult extends Result {
|
| 1297 |
+
task: Task;
|
| 1298 |
+
}
|
| 1299 |
+
/**
|
| 1300 |
+
* A request to retrieve the state of a task.
|
| 1301 |
+
*
|
| 1302 |
+
* @category `tasks/get`
|
| 1303 |
+
*/
|
| 1304 |
+
export interface GetTaskRequest extends JSONRPCRequest {
|
| 1305 |
+
method: "tasks/get";
|
| 1306 |
+
params: {
|
| 1307 |
+
/**
|
| 1308 |
+
* The task identifier to query.
|
| 1309 |
+
*/
|
| 1310 |
+
taskId: string;
|
| 1311 |
+
};
|
| 1312 |
+
}
|
| 1313 |
+
/**
|
| 1314 |
+
* The response to a tasks/get request.
|
| 1315 |
+
*
|
| 1316 |
+
* @category `tasks/get`
|
| 1317 |
+
*/
|
| 1318 |
+
export type GetTaskResult = Result & Task;
|
| 1319 |
+
/**
|
| 1320 |
+
* A request to retrieve the result of a completed task.
|
| 1321 |
+
*
|
| 1322 |
+
* @category `tasks/result`
|
| 1323 |
+
*/
|
| 1324 |
+
export interface GetTaskPayloadRequest extends JSONRPCRequest {
|
| 1325 |
+
method: "tasks/result";
|
| 1326 |
+
params: {
|
| 1327 |
+
/**
|
| 1328 |
+
* The task identifier to retrieve results for.
|
| 1329 |
+
*/
|
| 1330 |
+
taskId: string;
|
| 1331 |
+
};
|
| 1332 |
+
}
|
| 1333 |
+
/**
|
| 1334 |
+
* The response to a tasks/result request.
|
| 1335 |
+
* The structure matches the result type of the original request.
|
| 1336 |
+
* For example, a tools/call task would return the CallToolResult structure.
|
| 1337 |
+
*
|
| 1338 |
+
* @category `tasks/result`
|
| 1339 |
+
*/
|
| 1340 |
+
export interface GetTaskPayloadResult extends Result {
|
| 1341 |
+
[key: string]: unknown;
|
| 1342 |
+
}
|
| 1343 |
+
/**
|
| 1344 |
+
* A request to cancel a task.
|
| 1345 |
+
*
|
| 1346 |
+
* @category `tasks/cancel`
|
| 1347 |
+
*/
|
| 1348 |
+
export interface CancelTaskRequest extends JSONRPCRequest {
|
| 1349 |
+
method: "tasks/cancel";
|
| 1350 |
+
params: {
|
| 1351 |
+
/**
|
| 1352 |
+
* The task identifier to cancel.
|
| 1353 |
+
*/
|
| 1354 |
+
taskId: string;
|
| 1355 |
+
};
|
| 1356 |
+
}
|
| 1357 |
+
/**
|
| 1358 |
+
* The response to a tasks/cancel request.
|
| 1359 |
+
*
|
| 1360 |
+
* @category `tasks/cancel`
|
| 1361 |
+
*/
|
| 1362 |
+
export type CancelTaskResult = Result & Task;
|
| 1363 |
+
/**
|
| 1364 |
+
* A request to retrieve a list of tasks.
|
| 1365 |
+
*
|
| 1366 |
+
* @category `tasks/list`
|
| 1367 |
+
*/
|
| 1368 |
+
export interface ListTasksRequest extends PaginatedRequest {
|
| 1369 |
+
method: "tasks/list";
|
| 1370 |
+
}
|
| 1371 |
+
/**
|
| 1372 |
+
* The response to a tasks/list request.
|
| 1373 |
+
*
|
| 1374 |
+
* @category `tasks/list`
|
| 1375 |
+
*/
|
| 1376 |
+
export interface ListTasksResult extends PaginatedResult {
|
| 1377 |
+
tasks: Task[];
|
| 1378 |
+
}
|
| 1379 |
+
/**
|
| 1380 |
+
* Parameters for a `notifications/tasks/status` notification.
|
| 1381 |
+
*
|
| 1382 |
+
* @category `notifications/tasks/status`
|
| 1383 |
+
*/
|
| 1384 |
+
export type TaskStatusNotificationParams = NotificationParams & Task;
|
| 1385 |
+
/**
|
| 1386 |
+
* An optional notification from the receiver to the requestor, informing them that a task's status has changed. Receivers are not required to send these notifications.
|
| 1387 |
+
*
|
| 1388 |
+
* @category `notifications/tasks/status`
|
| 1389 |
+
*/
|
| 1390 |
+
export interface TaskStatusNotification extends JSONRPCNotification {
|
| 1391 |
+
method: "notifications/tasks/status";
|
| 1392 |
+
params: TaskStatusNotificationParams;
|
| 1393 |
+
}
|
| 1394 |
+
/**
|
| 1395 |
+
* Parameters for a `logging/setLevel` request.
|
| 1396 |
+
*
|
| 1397 |
+
* @category `logging/setLevel`
|
| 1398 |
+
*/
|
| 1399 |
+
export interface SetLevelRequestParams extends RequestParams {
|
| 1400 |
+
/**
|
| 1401 |
+
* The level of logging that the client wants to receive from the server. The server should send all logs at this level and higher (i.e., more severe) to the client as notifications/message.
|
| 1402 |
+
*/
|
| 1403 |
+
level: LoggingLevel;
|
| 1404 |
+
}
|
| 1405 |
+
/**
|
| 1406 |
+
* A request from the client to the server, to enable or adjust logging.
|
| 1407 |
+
*
|
| 1408 |
+
* @category `logging/setLevel`
|
| 1409 |
+
*/
|
| 1410 |
+
export interface SetLevelRequest extends JSONRPCRequest {
|
| 1411 |
+
method: "logging/setLevel";
|
| 1412 |
+
params: SetLevelRequestParams;
|
| 1413 |
+
}
|
| 1414 |
+
/**
|
| 1415 |
+
* Parameters for a `notifications/message` notification.
|
| 1416 |
+
*
|
| 1417 |
+
* @category `notifications/message`
|
| 1418 |
+
*/
|
| 1419 |
+
export interface LoggingMessageNotificationParams extends NotificationParams {
|
| 1420 |
+
/**
|
| 1421 |
+
* The severity of this log message.
|
| 1422 |
+
*/
|
| 1423 |
+
level: LoggingLevel;
|
| 1424 |
+
/**
|
| 1425 |
+
* An optional name of the logger issuing this message.
|
| 1426 |
+
*/
|
| 1427 |
+
logger?: string;
|
| 1428 |
+
/**
|
| 1429 |
+
* The data to be logged, such as a string message or an object. Any JSON serializable type is allowed here.
|
| 1430 |
+
*/
|
| 1431 |
+
data: unknown;
|
| 1432 |
+
}
|
| 1433 |
+
/**
|
| 1434 |
+
* JSONRPCNotification of a log message passed from server to client. If no logging/setLevel request has been sent from the client, the server MAY decide which messages to send automatically.
|
| 1435 |
+
*
|
| 1436 |
+
* @category `notifications/message`
|
| 1437 |
+
*/
|
| 1438 |
+
export interface LoggingMessageNotification extends JSONRPCNotification {
|
| 1439 |
+
method: "notifications/message";
|
| 1440 |
+
params: LoggingMessageNotificationParams;
|
| 1441 |
+
}
|
| 1442 |
+
/**
|
| 1443 |
+
* The severity of a log message.
|
| 1444 |
+
*
|
| 1445 |
+
* These map to syslog message severities, as specified in RFC-5424:
|
| 1446 |
+
* https://datatracker.ietf.org/doc/html/rfc5424#section-6.2.1
|
| 1447 |
+
*
|
| 1448 |
+
* @category Common Types
|
| 1449 |
+
*/
|
| 1450 |
+
export type LoggingLevel = "debug" | "info" | "notice" | "warning" | "error" | "critical" | "alert" | "emergency";
|
| 1451 |
+
/**
|
| 1452 |
+
* Parameters for a `sampling/createMessage` request.
|
| 1453 |
+
*
|
| 1454 |
+
* @category `sampling/createMessage`
|
| 1455 |
+
*/
|
| 1456 |
+
export interface CreateMessageRequestParams extends TaskAugmentedRequestParams {
|
| 1457 |
+
messages: SamplingMessage[];
|
| 1458 |
+
/**
|
| 1459 |
+
* The server's preferences for which model to select. The client MAY ignore these preferences.
|
| 1460 |
+
*/
|
| 1461 |
+
modelPreferences?: ModelPreferences;
|
| 1462 |
+
/**
|
| 1463 |
+
* An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt.
|
| 1464 |
+
*/
|
| 1465 |
+
systemPrompt?: string;
|
| 1466 |
+
/**
|
| 1467 |
+
* A request to include context from one or more MCP servers (including the caller), to be attached to the prompt.
|
| 1468 |
+
* The client MAY ignore this request.
|
| 1469 |
+
*
|
| 1470 |
+
* Default is "none". Values "thisServer" and "allServers" are soft-deprecated. Servers SHOULD only use these values if the client
|
| 1471 |
+
* declares ClientCapabilities.sampling.context. These values may be removed in future spec releases.
|
| 1472 |
+
*/
|
| 1473 |
+
includeContext?: "none" | "thisServer" | "allServers";
|
| 1474 |
+
/**
|
| 1475 |
+
* @TJS-type number
|
| 1476 |
+
*/
|
| 1477 |
+
temperature?: number;
|
| 1478 |
+
/**
|
| 1479 |
+
* The requested maximum number of tokens to sample (to prevent runaway completions).
|
| 1480 |
+
*
|
| 1481 |
+
* The client MAY choose to sample fewer tokens than the requested maximum.
|
| 1482 |
+
*/
|
| 1483 |
+
maxTokens: number;
|
| 1484 |
+
stopSequences?: string[];
|
| 1485 |
+
/**
|
| 1486 |
+
* Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific.
|
| 1487 |
+
*/
|
| 1488 |
+
metadata?: object;
|
| 1489 |
+
/**
|
| 1490 |
+
* Tools that the model may use during generation.
|
| 1491 |
+
* The client MUST return an error if this field is provided but ClientCapabilities.sampling.tools is not declared.
|
| 1492 |
+
*/
|
| 1493 |
+
tools?: Tool[];
|
| 1494 |
+
/**
|
| 1495 |
+
* Controls how the model uses tools.
|
| 1496 |
+
* The client MUST return an error if this field is provided but ClientCapabilities.sampling.tools is not declared.
|
| 1497 |
+
* Default is `{ mode: "auto" }`.
|
| 1498 |
+
*/
|
| 1499 |
+
toolChoice?: ToolChoice;
|
| 1500 |
+
}
|
| 1501 |
+
/**
|
| 1502 |
+
* Controls tool selection behavior for sampling requests.
|
| 1503 |
+
*
|
| 1504 |
+
* @category `sampling/createMessage`
|
| 1505 |
+
*/
|
| 1506 |
+
export interface ToolChoice {
|
| 1507 |
+
/**
|
| 1508 |
+
* Controls the tool use ability of the model:
|
| 1509 |
+
* - "auto": Model decides whether to use tools (default)
|
| 1510 |
+
* - "required": Model MUST use at least one tool before completing
|
| 1511 |
+
* - "none": Model MUST NOT use any tools
|
| 1512 |
+
*/
|
| 1513 |
+
mode?: "auto" | "required" | "none";
|
| 1514 |
+
}
|
| 1515 |
+
/**
|
| 1516 |
+
* A request from the server to sample an LLM via the client. The client has full discretion over which model to select. The client should also inform the user before beginning sampling, to allow them to inspect the request (human in the loop) and decide whether to approve it.
|
| 1517 |
+
*
|
| 1518 |
+
* @category `sampling/createMessage`
|
| 1519 |
+
*/
|
| 1520 |
+
export interface CreateMessageRequest extends JSONRPCRequest {
|
| 1521 |
+
method: "sampling/createMessage";
|
| 1522 |
+
params: CreateMessageRequestParams;
|
| 1523 |
+
}
|
| 1524 |
+
/**
|
| 1525 |
+
* The client's response to a sampling/createMessage request from the server.
|
| 1526 |
+
* The client should inform the user before returning the sampled message, to allow them
|
| 1527 |
+
* to inspect the response (human in the loop) and decide whether to allow the server to see it.
|
| 1528 |
+
*
|
| 1529 |
+
* @category `sampling/createMessage`
|
| 1530 |
+
*/
|
| 1531 |
+
export interface CreateMessageResult extends Result, SamplingMessage {
|
| 1532 |
+
/**
|
| 1533 |
+
* The name of the model that generated the message.
|
| 1534 |
+
*/
|
| 1535 |
+
model: string;
|
| 1536 |
+
/**
|
| 1537 |
+
* The reason why sampling stopped, if known.
|
| 1538 |
+
*
|
| 1539 |
+
* Standard values:
|
| 1540 |
+
* - "endTurn": Natural end of the assistant's turn
|
| 1541 |
+
* - "stopSequence": A stop sequence was encountered
|
| 1542 |
+
* - "maxTokens": Maximum token limit was reached
|
| 1543 |
+
* - "toolUse": The model wants to use one or more tools
|
| 1544 |
+
*
|
| 1545 |
+
* This field is an open string to allow for provider-specific stop reasons.
|
| 1546 |
+
*/
|
| 1547 |
+
stopReason?: "endTurn" | "stopSequence" | "maxTokens" | "toolUse" | string;
|
| 1548 |
+
}
|
| 1549 |
+
/**
|
| 1550 |
+
* Describes a message issued to or received from an LLM API.
|
| 1551 |
+
*
|
| 1552 |
+
* @category `sampling/createMessage`
|
| 1553 |
+
*/
|
| 1554 |
+
export interface SamplingMessage {
|
| 1555 |
+
role: Role;
|
| 1556 |
+
content: SamplingMessageContentBlock | SamplingMessageContentBlock[];
|
| 1557 |
+
/**
|
| 1558 |
+
* See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage.
|
| 1559 |
+
*/
|
| 1560 |
+
_meta?: {
|
| 1561 |
+
[key: string]: unknown;
|
| 1562 |
+
};
|
| 1563 |
+
}
|
| 1564 |
+
export type SamplingMessageContentBlock = TextContent | ImageContent | AudioContent | ToolUseContent | ToolResultContent;
|
| 1565 |
+
/**
|
| 1566 |
+
* Optional annotations for the client. The client can use annotations to inform how objects are used or displayed
|
| 1567 |
+
*
|
| 1568 |
+
* @category Common Types
|
| 1569 |
+
*/
|
| 1570 |
+
export interface Annotations {
|
| 1571 |
+
/**
|
| 1572 |
+
* Describes who the intended audience of this object or data is.
|
| 1573 |
+
*
|
| 1574 |
+
* It can include multiple entries to indicate content useful for multiple audiences (e.g., `["user", "assistant"]`).
|
| 1575 |
+
*/
|
| 1576 |
+
audience?: Role[];
|
| 1577 |
+
/**
|
| 1578 |
+
* Describes how important this data is for operating the server.
|
| 1579 |
+
*
|
| 1580 |
+
* A value of 1 means "most important," and indicates that the data is
|
| 1581 |
+
* effectively required, while 0 means "least important," and indicates that
|
| 1582 |
+
* the data is entirely optional.
|
| 1583 |
+
*
|
| 1584 |
+
* @TJS-type number
|
| 1585 |
+
* @minimum 0
|
| 1586 |
+
* @maximum 1
|
| 1587 |
+
*/
|
| 1588 |
+
priority?: number;
|
| 1589 |
+
/**
|
| 1590 |
+
* The moment the resource was last modified, as an ISO 8601 formatted string.
|
| 1591 |
+
*
|
| 1592 |
+
* Should be an ISO 8601 formatted string (e.g., "2025-01-12T15:00:58Z").
|
| 1593 |
+
*
|
| 1594 |
+
* Examples: last activity timestamp in an open file, timestamp when the resource
|
| 1595 |
+
* was attached, etc.
|
| 1596 |
+
*/
|
| 1597 |
+
lastModified?: string;
|
| 1598 |
+
}
|
| 1599 |
+
/**
|
| 1600 |
+
* @category Content
|
| 1601 |
+
*/
|
| 1602 |
+
export type ContentBlock = TextContent | ImageContent | AudioContent | ResourceLink | EmbeddedResource;
|
| 1603 |
+
/**
|
| 1604 |
+
* Text provided to or from an LLM.
|
| 1605 |
+
*
|
| 1606 |
+
* @category Content
|
| 1607 |
+
*/
|
| 1608 |
+
export interface TextContent {
|
| 1609 |
+
type: "text";
|
| 1610 |
+
/**
|
| 1611 |
+
* The text content of the message.
|
| 1612 |
+
*/
|
| 1613 |
+
text: string;
|
| 1614 |
+
/**
|
| 1615 |
+
* Optional annotations for the client.
|
| 1616 |
+
*/
|
| 1617 |
+
annotations?: Annotations;
|
| 1618 |
+
/**
|
| 1619 |
+
* See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage.
|
| 1620 |
+
*/
|
| 1621 |
+
_meta?: {
|
| 1622 |
+
[key: string]: unknown;
|
| 1623 |
+
};
|
| 1624 |
+
}
|
| 1625 |
+
/**
|
| 1626 |
+
* An image provided to or from an LLM.
|
| 1627 |
+
*
|
| 1628 |
+
* @category Content
|
| 1629 |
+
*/
|
| 1630 |
+
export interface ImageContent {
|
| 1631 |
+
type: "image";
|
| 1632 |
+
/**
|
| 1633 |
+
* The base64-encoded image data.
|
| 1634 |
+
*
|
| 1635 |
+
* @format byte
|
| 1636 |
+
*/
|
| 1637 |
+
data: string;
|
| 1638 |
+
/**
|
| 1639 |
+
* The MIME type of the image. Different providers may support different image types.
|
| 1640 |
+
*/
|
| 1641 |
+
mimeType: string;
|
| 1642 |
+
/**
|
| 1643 |
+
* Optional annotations for the client.
|
| 1644 |
+
*/
|
| 1645 |
+
annotations?: Annotations;
|
| 1646 |
+
/**
|
| 1647 |
+
* See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage.
|
| 1648 |
+
*/
|
| 1649 |
+
_meta?: {
|
| 1650 |
+
[key: string]: unknown;
|
| 1651 |
+
};
|
| 1652 |
+
}
|
| 1653 |
+
/**
|
| 1654 |
+
* Audio provided to or from an LLM.
|
| 1655 |
+
*
|
| 1656 |
+
* @category Content
|
| 1657 |
+
*/
|
| 1658 |
+
export interface AudioContent {
|
| 1659 |
+
type: "audio";
|
| 1660 |
+
/**
|
| 1661 |
+
* The base64-encoded audio data.
|
| 1662 |
+
*
|
| 1663 |
+
* @format byte
|
| 1664 |
+
*/
|
| 1665 |
+
data: string;
|
| 1666 |
+
/**
|
| 1667 |
+
* The MIME type of the audio. Different providers may support different audio types.
|
| 1668 |
+
*/
|
| 1669 |
+
mimeType: string;
|
| 1670 |
+
/**
|
| 1671 |
+
* Optional annotations for the client.
|
| 1672 |
+
*/
|
| 1673 |
+
annotations?: Annotations;
|
| 1674 |
+
/**
|
| 1675 |
+
* See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage.
|
| 1676 |
+
*/
|
| 1677 |
+
_meta?: {
|
| 1678 |
+
[key: string]: unknown;
|
| 1679 |
+
};
|
| 1680 |
+
}
|
| 1681 |
+
/**
|
| 1682 |
+
* A request from the assistant to call a tool.
|
| 1683 |
+
*
|
| 1684 |
+
* @category `sampling/createMessage`
|
| 1685 |
+
*/
|
| 1686 |
+
export interface ToolUseContent {
|
| 1687 |
+
type: "tool_use";
|
| 1688 |
+
/**
|
| 1689 |
+
* A unique identifier for this tool use.
|
| 1690 |
+
*
|
| 1691 |
+
* This ID is used to match tool results to their corresponding tool uses.
|
| 1692 |
+
*/
|
| 1693 |
+
id: string;
|
| 1694 |
+
/**
|
| 1695 |
+
* The name of the tool to call.
|
| 1696 |
+
*/
|
| 1697 |
+
name: string;
|
| 1698 |
+
/**
|
| 1699 |
+
* The arguments to pass to the tool, conforming to the tool's input schema.
|
| 1700 |
+
*/
|
| 1701 |
+
input: {
|
| 1702 |
+
[key: string]: unknown;
|
| 1703 |
+
};
|
| 1704 |
+
/**
|
| 1705 |
+
* Optional metadata about the tool use. Clients SHOULD preserve this field when
|
| 1706 |
+
* including tool uses in subsequent sampling requests to enable caching optimizations.
|
| 1707 |
+
*
|
| 1708 |
+
* See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage.
|
| 1709 |
+
*/
|
| 1710 |
+
_meta?: {
|
| 1711 |
+
[key: string]: unknown;
|
| 1712 |
+
};
|
| 1713 |
+
}
|
| 1714 |
+
/**
|
| 1715 |
+
* The result of a tool use, provided by the user back to the assistant.
|
| 1716 |
+
*
|
| 1717 |
+
* @category `sampling/createMessage`
|
| 1718 |
+
*/
|
| 1719 |
+
export interface ToolResultContent {
|
| 1720 |
+
type: "tool_result";
|
| 1721 |
+
/**
|
| 1722 |
+
* The ID of the tool use this result corresponds to.
|
| 1723 |
+
*
|
| 1724 |
+
* This MUST match the ID from a previous ToolUseContent.
|
| 1725 |
+
*/
|
| 1726 |
+
toolUseId: string;
|
| 1727 |
+
/**
|
| 1728 |
+
* The unstructured result content of the tool use.
|
| 1729 |
+
*
|
| 1730 |
+
* This has the same format as CallToolResult.content and can include text, images,
|
| 1731 |
+
* audio, resource links, and embedded resources.
|
| 1732 |
+
*/
|
| 1733 |
+
content: ContentBlock[];
|
| 1734 |
+
/**
|
| 1735 |
+
* An optional structured result object.
|
| 1736 |
+
*
|
| 1737 |
+
* If the tool defined an outputSchema, this SHOULD conform to that schema.
|
| 1738 |
+
*/
|
| 1739 |
+
structuredContent?: {
|
| 1740 |
+
[key: string]: unknown;
|
| 1741 |
+
};
|
| 1742 |
+
/**
|
| 1743 |
+
* Whether the tool use resulted in an error.
|
| 1744 |
+
*
|
| 1745 |
+
* If true, the content typically describes the error that occurred.
|
| 1746 |
+
* Default: false
|
| 1747 |
+
*/
|
| 1748 |
+
isError?: boolean;
|
| 1749 |
+
/**
|
| 1750 |
+
* Optional metadata about the tool result. Clients SHOULD preserve this field when
|
| 1751 |
+
* including tool results in subsequent sampling requests to enable caching optimizations.
|
| 1752 |
+
*
|
| 1753 |
+
* See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage.
|
| 1754 |
+
*/
|
| 1755 |
+
_meta?: {
|
| 1756 |
+
[key: string]: unknown;
|
| 1757 |
+
};
|
| 1758 |
+
}
|
| 1759 |
+
/**
|
| 1760 |
+
* The server's preferences for model selection, requested of the client during sampling.
|
| 1761 |
+
*
|
| 1762 |
+
* Because LLMs can vary along multiple dimensions, choosing the "best" model is
|
| 1763 |
+
* rarely straightforward. Different models excel in different areas—some are
|
| 1764 |
+
* faster but less capable, others are more capable but more expensive, and so
|
| 1765 |
+
* on. This interface allows servers to express their priorities across multiple
|
| 1766 |
+
* dimensions to help clients make an appropriate selection for their use case.
|
| 1767 |
+
*
|
| 1768 |
+
* These preferences are always advisory. The client MAY ignore them. It is also
|
| 1769 |
+
* up to the client to decide how to interpret these preferences and how to
|
| 1770 |
+
* balance them against other considerations.
|
| 1771 |
+
*
|
| 1772 |
+
* @category `sampling/createMessage`
|
| 1773 |
+
*/
|
| 1774 |
+
export interface ModelPreferences {
|
| 1775 |
+
/**
|
| 1776 |
+
* Optional hints to use for model selection.
|
| 1777 |
+
*
|
| 1778 |
+
* If multiple hints are specified, the client MUST evaluate them in order
|
| 1779 |
+
* (such that the first match is taken).
|
| 1780 |
+
*
|
| 1781 |
+
* The client SHOULD prioritize these hints over the numeric priorities, but
|
| 1782 |
+
* MAY still use the priorities to select from ambiguous matches.
|
| 1783 |
+
*/
|
| 1784 |
+
hints?: ModelHint[];
|
| 1785 |
+
/**
|
| 1786 |
+
* How much to prioritize cost when selecting a model. A value of 0 means cost
|
| 1787 |
+
* is not important, while a value of 1 means cost is the most important
|
| 1788 |
+
* factor.
|
| 1789 |
+
*
|
| 1790 |
+
* @TJS-type number
|
| 1791 |
+
* @minimum 0
|
| 1792 |
+
* @maximum 1
|
| 1793 |
+
*/
|
| 1794 |
+
costPriority?: number;
|
| 1795 |
+
/**
|
| 1796 |
+
* How much to prioritize sampling speed (latency) when selecting a model. A
|
| 1797 |
+
* value of 0 means speed is not important, while a value of 1 means speed is
|
| 1798 |
+
* the most important factor.
|
| 1799 |
+
*
|
| 1800 |
+
* @TJS-type number
|
| 1801 |
+
* @minimum 0
|
| 1802 |
+
* @maximum 1
|
| 1803 |
+
*/
|
| 1804 |
+
speedPriority?: number;
|
| 1805 |
+
/**
|
| 1806 |
+
* How much to prioritize intelligence and capabilities when selecting a
|
| 1807 |
+
* model. A value of 0 means intelligence is not important, while a value of 1
|
| 1808 |
+
* means intelligence is the most important factor.
|
| 1809 |
+
*
|
| 1810 |
+
* @TJS-type number
|
| 1811 |
+
* @minimum 0
|
| 1812 |
+
* @maximum 1
|
| 1813 |
+
*/
|
| 1814 |
+
intelligencePriority?: number;
|
| 1815 |
+
}
|
| 1816 |
+
/**
|
| 1817 |
+
* Hints to use for model selection.
|
| 1818 |
+
*
|
| 1819 |
+
* Keys not declared here are currently left unspecified by the spec and are up
|
| 1820 |
+
* to the client to interpret.
|
| 1821 |
+
*
|
| 1822 |
+
* @category `sampling/createMessage`
|
| 1823 |
+
*/
|
| 1824 |
+
export interface ModelHint {
|
| 1825 |
+
/**
|
| 1826 |
+
* A hint for a model name.
|
| 1827 |
+
*
|
| 1828 |
+
* The client SHOULD treat this as a substring of a model name; for example:
|
| 1829 |
+
* - `claude-3-5-sonnet` should match `claude-3-5-sonnet-20241022`
|
| 1830 |
+
* - `sonnet` should match `claude-3-5-sonnet-20241022`, `claude-3-sonnet-20240229`, etc.
|
| 1831 |
+
* - `claude` should match any Claude model
|
| 1832 |
+
*
|
| 1833 |
+
* The client MAY also map the string to a different provider's model name or a different model family, as long as it fills a similar niche; for example:
|
| 1834 |
+
* - `gemini-1.5-flash` could match `claude-3-haiku-20240307`
|
| 1835 |
+
*/
|
| 1836 |
+
name?: string;
|
| 1837 |
+
}
|
| 1838 |
+
/**
|
| 1839 |
+
* Parameters for a `completion/complete` request.
|
| 1840 |
+
*
|
| 1841 |
+
* @category `completion/complete`
|
| 1842 |
+
*/
|
| 1843 |
+
export interface CompleteRequestParams extends RequestParams {
|
| 1844 |
+
ref: PromptReference | ResourceTemplateReference;
|
| 1845 |
+
/**
|
| 1846 |
+
* The argument's information
|
| 1847 |
+
*/
|
| 1848 |
+
argument: {
|
| 1849 |
+
/**
|
| 1850 |
+
* The name of the argument
|
| 1851 |
+
*/
|
| 1852 |
+
name: string;
|
| 1853 |
+
/**
|
| 1854 |
+
* The value of the argument to use for completion matching.
|
| 1855 |
+
*/
|
| 1856 |
+
value: string;
|
| 1857 |
+
};
|
| 1858 |
+
/**
|
| 1859 |
+
* Additional, optional context for completions
|
| 1860 |
+
*/
|
| 1861 |
+
context?: {
|
| 1862 |
+
/**
|
| 1863 |
+
* Previously-resolved variables in a URI template or prompt.
|
| 1864 |
+
*/
|
| 1865 |
+
arguments?: {
|
| 1866 |
+
[key: string]: string;
|
| 1867 |
+
};
|
| 1868 |
+
};
|
| 1869 |
+
}
|
| 1870 |
+
/**
|
| 1871 |
+
* A request from the client to the server, to ask for completion options.
|
| 1872 |
+
*
|
| 1873 |
+
* @category `completion/complete`
|
| 1874 |
+
*/
|
| 1875 |
+
export interface CompleteRequest extends JSONRPCRequest {
|
| 1876 |
+
method: "completion/complete";
|
| 1877 |
+
params: CompleteRequestParams;
|
| 1878 |
+
}
|
| 1879 |
+
/**
|
| 1880 |
+
* The server's response to a completion/complete request
|
| 1881 |
+
*
|
| 1882 |
+
* @category `completion/complete`
|
| 1883 |
+
*/
|
| 1884 |
+
export interface CompleteResult extends Result {
|
| 1885 |
+
completion: {
|
| 1886 |
+
/**
|
| 1887 |
+
* An array of completion values. Must not exceed 100 items.
|
| 1888 |
+
*/
|
| 1889 |
+
values: string[];
|
| 1890 |
+
/**
|
| 1891 |
+
* The total number of completion options available. This can exceed the number of values actually sent in the response.
|
| 1892 |
+
*/
|
| 1893 |
+
total?: number;
|
| 1894 |
+
/**
|
| 1895 |
+
* Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown.
|
| 1896 |
+
*/
|
| 1897 |
+
hasMore?: boolean;
|
| 1898 |
+
};
|
| 1899 |
+
}
|
| 1900 |
+
/**
|
| 1901 |
+
* A reference to a resource or resource template definition.
|
| 1902 |
+
*
|
| 1903 |
+
* @category `completion/complete`
|
| 1904 |
+
*/
|
| 1905 |
+
export interface ResourceTemplateReference {
|
| 1906 |
+
type: "ref/resource";
|
| 1907 |
+
/**
|
| 1908 |
+
* The URI or URI template of the resource.
|
| 1909 |
+
*
|
| 1910 |
+
* @format uri-template
|
| 1911 |
+
*/
|
| 1912 |
+
uri: string;
|
| 1913 |
+
}
|
| 1914 |
+
/**
|
| 1915 |
+
* Identifies a prompt.
|
| 1916 |
+
*
|
| 1917 |
+
* @category `completion/complete`
|
| 1918 |
+
*/
|
| 1919 |
+
export interface PromptReference extends BaseMetadata {
|
| 1920 |
+
type: "ref/prompt";
|
| 1921 |
+
}
|
| 1922 |
+
/**
|
| 1923 |
+
* Sent from the server to request a list of root URIs from the client. Roots allow
|
| 1924 |
+
* servers to ask for specific directories or files to operate on. A common example
|
| 1925 |
+
* for roots is providing a set of repositories or directories a server should operate
|
| 1926 |
+
* on.
|
| 1927 |
+
*
|
| 1928 |
+
* This request is typically used when the server needs to understand the file system
|
| 1929 |
+
* structure or access specific locations that the client has permission to read from.
|
| 1930 |
+
*
|
| 1931 |
+
* @category `roots/list`
|
| 1932 |
+
*/
|
| 1933 |
+
export interface ListRootsRequest extends JSONRPCRequest {
|
| 1934 |
+
method: "roots/list";
|
| 1935 |
+
params?: RequestParams;
|
| 1936 |
+
}
|
| 1937 |
+
/**
|
| 1938 |
+
* The client's response to a roots/list request from the server.
|
| 1939 |
+
* This result contains an array of Root objects, each representing a root directory
|
| 1940 |
+
* or file that the server can operate on.
|
| 1941 |
+
*
|
| 1942 |
+
* @category `roots/list`
|
| 1943 |
+
*/
|
| 1944 |
+
export interface ListRootsResult extends Result {
|
| 1945 |
+
roots: Root[];
|
| 1946 |
+
}
|
| 1947 |
+
/**
|
| 1948 |
+
* Represents a root directory or file that the server can operate on.
|
| 1949 |
+
*
|
| 1950 |
+
* @category `roots/list`
|
| 1951 |
+
*/
|
| 1952 |
+
export interface Root {
|
| 1953 |
+
/**
|
| 1954 |
+
* The URI identifying the root. This *must* start with file:// for now.
|
| 1955 |
+
* This restriction may be relaxed in future versions of the protocol to allow
|
| 1956 |
+
* other URI schemes.
|
| 1957 |
+
*
|
| 1958 |
+
* @format uri
|
| 1959 |
+
*/
|
| 1960 |
+
uri: string;
|
| 1961 |
+
/**
|
| 1962 |
+
* An optional name for the root. This can be used to provide a human-readable
|
| 1963 |
+
* identifier for the root, which may be useful for display purposes or for
|
| 1964 |
+
* referencing the root in other parts of the application.
|
| 1965 |
+
*/
|
| 1966 |
+
name?: string;
|
| 1967 |
+
/**
|
| 1968 |
+
* See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage.
|
| 1969 |
+
*/
|
| 1970 |
+
_meta?: {
|
| 1971 |
+
[key: string]: unknown;
|
| 1972 |
+
};
|
| 1973 |
+
}
|
| 1974 |
+
/**
|
| 1975 |
+
* A notification from the client to the server, informing it that the list of roots has changed.
|
| 1976 |
+
* This notification should be sent whenever the client adds, removes, or modifies any root.
|
| 1977 |
+
* The server should then request an updated list of roots using the ListRootsRequest.
|
| 1978 |
+
*
|
| 1979 |
+
* @category `notifications/roots/list_changed`
|
| 1980 |
+
*/
|
| 1981 |
+
export interface RootsListChangedNotification extends JSONRPCNotification {
|
| 1982 |
+
method: "notifications/roots/list_changed";
|
| 1983 |
+
params?: NotificationParams;
|
| 1984 |
+
}
|
| 1985 |
+
/**
|
| 1986 |
+
* The parameters for a request to elicit non-sensitive information from the user via a form in the client.
|
| 1987 |
+
*
|
| 1988 |
+
* @category `elicitation/create`
|
| 1989 |
+
*/
|
| 1990 |
+
export interface ElicitRequestFormParams extends TaskAugmentedRequestParams {
|
| 1991 |
+
/**
|
| 1992 |
+
* The elicitation mode.
|
| 1993 |
+
*/
|
| 1994 |
+
mode?: "form";
|
| 1995 |
+
/**
|
| 1996 |
+
* The message to present to the user describing what information is being requested.
|
| 1997 |
+
*/
|
| 1998 |
+
message: string;
|
| 1999 |
+
/**
|
| 2000 |
+
* A restricted subset of JSON Schema.
|
| 2001 |
+
* Only top-level properties are allowed, without nesting.
|
| 2002 |
+
*/
|
| 2003 |
+
requestedSchema: {
|
| 2004 |
+
$schema?: string;
|
| 2005 |
+
type: "object";
|
| 2006 |
+
properties: {
|
| 2007 |
+
[key: string]: PrimitiveSchemaDefinition;
|
| 2008 |
+
};
|
| 2009 |
+
required?: string[];
|
| 2010 |
+
};
|
| 2011 |
+
}
|
| 2012 |
+
/**
|
| 2013 |
+
* The parameters for a request to elicit information from the user via a URL in the client.
|
| 2014 |
+
*
|
| 2015 |
+
* @category `elicitation/create`
|
| 2016 |
+
*/
|
| 2017 |
+
export interface ElicitRequestURLParams extends TaskAugmentedRequestParams {
|
| 2018 |
+
/**
|
| 2019 |
+
* The elicitation mode.
|
| 2020 |
+
*/
|
| 2021 |
+
mode: "url";
|
| 2022 |
+
/**
|
| 2023 |
+
* The message to present to the user explaining why the interaction is needed.
|
| 2024 |
+
*/
|
| 2025 |
+
message: string;
|
| 2026 |
+
/**
|
| 2027 |
+
* The ID of the elicitation, which must be unique within the context of the server.
|
| 2028 |
+
* The client MUST treat this ID as an opaque value.
|
| 2029 |
+
*/
|
| 2030 |
+
elicitationId: string;
|
| 2031 |
+
/**
|
| 2032 |
+
* The URL that the user should navigate to.
|
| 2033 |
+
*
|
| 2034 |
+
* @format uri
|
| 2035 |
+
*/
|
| 2036 |
+
url: string;
|
| 2037 |
+
}
|
| 2038 |
+
/**
|
| 2039 |
+
* The parameters for a request to elicit additional information from the user via the client.
|
| 2040 |
+
*
|
| 2041 |
+
* @category `elicitation/create`
|
| 2042 |
+
*/
|
| 2043 |
+
export type ElicitRequestParams = ElicitRequestFormParams | ElicitRequestURLParams;
|
| 2044 |
+
/**
|
| 2045 |
+
* A request from the server to elicit additional information from the user via the client.
|
| 2046 |
+
*
|
| 2047 |
+
* @category `elicitation/create`
|
| 2048 |
+
*/
|
| 2049 |
+
export interface ElicitRequest extends JSONRPCRequest {
|
| 2050 |
+
method: "elicitation/create";
|
| 2051 |
+
params: ElicitRequestParams;
|
| 2052 |
+
}
|
| 2053 |
+
/**
|
| 2054 |
+
* Restricted schema definitions that only allow primitive types
|
| 2055 |
+
* without nested objects or arrays.
|
| 2056 |
+
*
|
| 2057 |
+
* @category `elicitation/create`
|
| 2058 |
+
*/
|
| 2059 |
+
export type PrimitiveSchemaDefinition = StringSchema | NumberSchema | BooleanSchema | EnumSchema;
|
| 2060 |
+
/**
|
| 2061 |
+
* @category `elicitation/create`
|
| 2062 |
+
*/
|
| 2063 |
+
export interface StringSchema {
|
| 2064 |
+
type: "string";
|
| 2065 |
+
title?: string;
|
| 2066 |
+
description?: string;
|
| 2067 |
+
minLength?: number;
|
| 2068 |
+
maxLength?: number;
|
| 2069 |
+
format?: "email" | "uri" | "date" | "date-time";
|
| 2070 |
+
default?: string;
|
| 2071 |
+
}
|
| 2072 |
+
/**
|
| 2073 |
+
* @category `elicitation/create`
|
| 2074 |
+
*/
|
| 2075 |
+
export interface NumberSchema {
|
| 2076 |
+
type: "number" | "integer";
|
| 2077 |
+
title?: string;
|
| 2078 |
+
description?: string;
|
| 2079 |
+
minimum?: number;
|
| 2080 |
+
maximum?: number;
|
| 2081 |
+
default?: number;
|
| 2082 |
+
}
|
| 2083 |
+
/**
|
| 2084 |
+
* @category `elicitation/create`
|
| 2085 |
+
*/
|
| 2086 |
+
export interface BooleanSchema {
|
| 2087 |
+
type: "boolean";
|
| 2088 |
+
title?: string;
|
| 2089 |
+
description?: string;
|
| 2090 |
+
default?: boolean;
|
| 2091 |
+
}
|
| 2092 |
+
/**
|
| 2093 |
+
* Schema for single-selection enumeration without display titles for options.
|
| 2094 |
+
*
|
| 2095 |
+
* @category `elicitation/create`
|
| 2096 |
+
*/
|
| 2097 |
+
export interface UntitledSingleSelectEnumSchema {
|
| 2098 |
+
type: "string";
|
| 2099 |
+
/**
|
| 2100 |
+
* Optional title for the enum field.
|
| 2101 |
+
*/
|
| 2102 |
+
title?: string;
|
| 2103 |
+
/**
|
| 2104 |
+
* Optional description for the enum field.
|
| 2105 |
+
*/
|
| 2106 |
+
description?: string;
|
| 2107 |
+
/**
|
| 2108 |
+
* Array of enum values to choose from.
|
| 2109 |
+
*/
|
| 2110 |
+
enum: string[];
|
| 2111 |
+
/**
|
| 2112 |
+
* Optional default value.
|
| 2113 |
+
*/
|
| 2114 |
+
default?: string;
|
| 2115 |
+
}
|
| 2116 |
+
/**
|
| 2117 |
+
* Schema for single-selection enumeration with display titles for each option.
|
| 2118 |
+
*
|
| 2119 |
+
* @category `elicitation/create`
|
| 2120 |
+
*/
|
| 2121 |
+
export interface TitledSingleSelectEnumSchema {
|
| 2122 |
+
type: "string";
|
| 2123 |
+
/**
|
| 2124 |
+
* Optional title for the enum field.
|
| 2125 |
+
*/
|
| 2126 |
+
title?: string;
|
| 2127 |
+
/**
|
| 2128 |
+
* Optional description for the enum field.
|
| 2129 |
+
*/
|
| 2130 |
+
description?: string;
|
| 2131 |
+
/**
|
| 2132 |
+
* Array of enum options with values and display labels.
|
| 2133 |
+
*/
|
| 2134 |
+
oneOf: Array<{
|
| 2135 |
+
/**
|
| 2136 |
+
* The enum value.
|
| 2137 |
+
*/
|
| 2138 |
+
const: string;
|
| 2139 |
+
/**
|
| 2140 |
+
* Display label for this option.
|
| 2141 |
+
*/
|
| 2142 |
+
title: string;
|
| 2143 |
+
}>;
|
| 2144 |
+
/**
|
| 2145 |
+
* Optional default value.
|
| 2146 |
+
*/
|
| 2147 |
+
default?: string;
|
| 2148 |
+
}
|
| 2149 |
+
/**
|
| 2150 |
+
* @category `elicitation/create`
|
| 2151 |
+
*/
|
| 2152 |
+
export type SingleSelectEnumSchema = UntitledSingleSelectEnumSchema | TitledSingleSelectEnumSchema;
|
| 2153 |
+
/**
|
| 2154 |
+
* Schema for multiple-selection enumeration without display titles for options.
|
| 2155 |
+
*
|
| 2156 |
+
* @category `elicitation/create`
|
| 2157 |
+
*/
|
| 2158 |
+
export interface UntitledMultiSelectEnumSchema {
|
| 2159 |
+
type: "array";
|
| 2160 |
+
/**
|
| 2161 |
+
* Optional title for the enum field.
|
| 2162 |
+
*/
|
| 2163 |
+
title?: string;
|
| 2164 |
+
/**
|
| 2165 |
+
* Optional description for the enum field.
|
| 2166 |
+
*/
|
| 2167 |
+
description?: string;
|
| 2168 |
+
/**
|
| 2169 |
+
* Minimum number of items to select.
|
| 2170 |
+
*/
|
| 2171 |
+
minItems?: number;
|
| 2172 |
+
/**
|
| 2173 |
+
* Maximum number of items to select.
|
| 2174 |
+
*/
|
| 2175 |
+
maxItems?: number;
|
| 2176 |
+
/**
|
| 2177 |
+
* Schema for the array items.
|
| 2178 |
+
*/
|
| 2179 |
+
items: {
|
| 2180 |
+
type: "string";
|
| 2181 |
+
/**
|
| 2182 |
+
* Array of enum values to choose from.
|
| 2183 |
+
*/
|
| 2184 |
+
enum: string[];
|
| 2185 |
+
};
|
| 2186 |
+
/**
|
| 2187 |
+
* Optional default value.
|
| 2188 |
+
*/
|
| 2189 |
+
default?: string[];
|
| 2190 |
+
}
|
| 2191 |
+
/**
|
| 2192 |
+
* Schema for multiple-selection enumeration with display titles for each option.
|
| 2193 |
+
*
|
| 2194 |
+
* @category `elicitation/create`
|
| 2195 |
+
*/
|
| 2196 |
+
export interface TitledMultiSelectEnumSchema {
|
| 2197 |
+
type: "array";
|
| 2198 |
+
/**
|
| 2199 |
+
* Optional title for the enum field.
|
| 2200 |
+
*/
|
| 2201 |
+
title?: string;
|
| 2202 |
+
/**
|
| 2203 |
+
* Optional description for the enum field.
|
| 2204 |
+
*/
|
| 2205 |
+
description?: string;
|
| 2206 |
+
/**
|
| 2207 |
+
* Minimum number of items to select.
|
| 2208 |
+
*/
|
| 2209 |
+
minItems?: number;
|
| 2210 |
+
/**
|
| 2211 |
+
* Maximum number of items to select.
|
| 2212 |
+
*/
|
| 2213 |
+
maxItems?: number;
|
| 2214 |
+
/**
|
| 2215 |
+
* Schema for array items with enum options and display labels.
|
| 2216 |
+
*/
|
| 2217 |
+
items: {
|
| 2218 |
+
/**
|
| 2219 |
+
* Array of enum options with values and display labels.
|
| 2220 |
+
*/
|
| 2221 |
+
anyOf: Array<{
|
| 2222 |
+
/**
|
| 2223 |
+
* The constant enum value.
|
| 2224 |
+
*/
|
| 2225 |
+
const: string;
|
| 2226 |
+
/**
|
| 2227 |
+
* Display title for this option.
|
| 2228 |
+
*/
|
| 2229 |
+
title: string;
|
| 2230 |
+
}>;
|
| 2231 |
+
};
|
| 2232 |
+
/**
|
| 2233 |
+
* Optional default value.
|
| 2234 |
+
*/
|
| 2235 |
+
default?: string[];
|
| 2236 |
+
}
|
| 2237 |
+
/**
|
| 2238 |
+
* @category `elicitation/create`
|
| 2239 |
+
*/
|
| 2240 |
+
export type MultiSelectEnumSchema = UntitledMultiSelectEnumSchema | TitledMultiSelectEnumSchema;
|
| 2241 |
+
/**
|
| 2242 |
+
* Use TitledSingleSelectEnumSchema instead.
|
| 2243 |
+
* This interface will be removed in a future version.
|
| 2244 |
+
*
|
| 2245 |
+
* @category `elicitation/create`
|
| 2246 |
+
*/
|
| 2247 |
+
export interface LegacyTitledEnumSchema {
|
| 2248 |
+
type: "string";
|
| 2249 |
+
title?: string;
|
| 2250 |
+
description?: string;
|
| 2251 |
+
enum: string[];
|
| 2252 |
+
/**
|
| 2253 |
+
* (Legacy) Display names for enum values.
|
| 2254 |
+
* Non-standard according to JSON schema 2020-12.
|
| 2255 |
+
*/
|
| 2256 |
+
enumNames?: string[];
|
| 2257 |
+
default?: string;
|
| 2258 |
+
}
|
| 2259 |
+
/**
|
| 2260 |
+
* @category `elicitation/create`
|
| 2261 |
+
*/
|
| 2262 |
+
export type EnumSchema = SingleSelectEnumSchema | MultiSelectEnumSchema | LegacyTitledEnumSchema;
|
| 2263 |
+
/**
|
| 2264 |
+
* The client's response to an elicitation request.
|
| 2265 |
+
*
|
| 2266 |
+
* @category `elicitation/create`
|
| 2267 |
+
*/
|
| 2268 |
+
export interface ElicitResult extends Result {
|
| 2269 |
+
/**
|
| 2270 |
+
* The user action in response to the elicitation.
|
| 2271 |
+
* - "accept": User submitted the form/confirmed the action
|
| 2272 |
+
* - "decline": User explicitly decline the action
|
| 2273 |
+
* - "cancel": User dismissed without making an explicit choice
|
| 2274 |
+
*/
|
| 2275 |
+
action: "accept" | "decline" | "cancel";
|
| 2276 |
+
/**
|
| 2277 |
+
* The submitted form data, only present when action is "accept" and mode was "form".
|
| 2278 |
+
* Contains values matching the requested schema.
|
| 2279 |
+
* Omitted for out-of-band mode responses.
|
| 2280 |
+
*/
|
| 2281 |
+
content?: {
|
| 2282 |
+
[key: string]: string | number | boolean | string[];
|
| 2283 |
+
};
|
| 2284 |
+
}
|
| 2285 |
+
/**
|
| 2286 |
+
* An optional notification from the server to the client, informing it of a completion of a out-of-band elicitation request.
|
| 2287 |
+
*
|
| 2288 |
+
* @category `notifications/elicitation/complete`
|
| 2289 |
+
*/
|
| 2290 |
+
export interface ElicitationCompleteNotification extends JSONRPCNotification {
|
| 2291 |
+
method: "notifications/elicitation/complete";
|
| 2292 |
+
params: {
|
| 2293 |
+
/**
|
| 2294 |
+
* The ID of the elicitation that completed.
|
| 2295 |
+
*/
|
| 2296 |
+
elicitationId: string;
|
| 2297 |
+
};
|
| 2298 |
+
}
|
| 2299 |
+
/** @internal */
|
| 2300 |
+
export type ClientRequest = PingRequest | InitializeRequest | CompleteRequest | SetLevelRequest | GetPromptRequest | ListPromptsRequest | ListResourcesRequest | ListResourceTemplatesRequest | ReadResourceRequest | SubscribeRequest | UnsubscribeRequest | CallToolRequest | ListToolsRequest | GetTaskRequest | GetTaskPayloadRequest | ListTasksRequest | CancelTaskRequest;
|
| 2301 |
+
/** @internal */
|
| 2302 |
+
export type ClientNotification = CancelledNotification | ProgressNotification | InitializedNotification | RootsListChangedNotification | TaskStatusNotification;
|
| 2303 |
+
/** @internal */
|
| 2304 |
+
export type ClientResult = EmptyResult | CreateMessageResult | ListRootsResult | ElicitResult | GetTaskResult | GetTaskPayloadResult | ListTasksResult | CancelTaskResult;
|
| 2305 |
+
/** @internal */
|
| 2306 |
+
export type ServerRequest = PingRequest | CreateMessageRequest | ListRootsRequest | ElicitRequest | GetTaskRequest | GetTaskPayloadRequest | ListTasksRequest | CancelTaskRequest;
|
| 2307 |
+
/** @internal */
|
| 2308 |
+
export type ServerNotification = CancelledNotification | ProgressNotification | LoggingMessageNotification | ResourceUpdatedNotification | ResourceListChangedNotification | ToolListChangedNotification | PromptListChangedNotification | ElicitationCompleteNotification | TaskStatusNotification;
|
| 2309 |
+
/** @internal */
|
| 2310 |
+
export type ServerResult = EmptyResult | InitializeResult | CompleteResult | GetPromptResult | ListPromptsResult | ListResourceTemplatesResult | ListResourcesResult | ReadResourceResult | CallToolResult | ListToolsResult | GetTaskResult | GetTaskPayloadResult | ListTasksResult | CancelTaskResult;
|
| 2311 |
+
//# sourceMappingURL=spec.types.d.ts.map
|
node_modules/@modelcontextprotocol/sdk/dist/cjs/spec.types.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"spec.types.d.ts","sourceRoot":"","sources":["../../src/spec.types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH;;;;GAIG;AACH,MAAM,MAAM,cAAc,GACtB,cAAc,GACd,mBAAmB,GACnB,eAAe,CAAC;AAEpB,gBAAgB;AAChB,eAAO,MAAM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AAc,GACd,qBAAqB,GACrB,gBAAgB,GAChB,iBAAiB,CAAC;AAEtB,gBAAgB;AAChB,MAAM,MAAM,kBAAkB,GAC1B,qBAAqB,GACrB,oBAAoB,GACpB,uBAAuB,GACvB,4BAA4B,GAC5B,sBAAsB,CAAC;AAE3B,gBAAgB;AAChB,MAAM,MAAM,YAAY,GACpB,WAAW,GACX,mBAAmB,GACnB,eAAe,GACf,YAAY,GACZ,aAAa,GACb,oBAAoB,GACpB,eAAe,GACf,gBAAgB,CAAC;AAGrB,gBAAgB;AAChB,MAAM,MAAM,aAAa,GACrB,WAAW,GACX,oBAAoB,GACpB,gBAAgB,GAChB,aAAa,GACb,cAAc,GACd,qBAAqB,GACrB,gBAAgB,GAChB,iBAAiB,CAAC;AAEtB,gBAAgB;AAChB,MAAM,MAAM,kBAAkB,GAC1B,qBAAqB,GACrB,oBAAoB,GACpB,0BAA0B,GAC1B,2BAA2B,GAC3B,+BAA+B,GAC/B,2BAA2B,GAC3B,6BAA6B,GAC7B,+BAA+B,GAC/B,sBAAsB,CAAC;AAE3B,gBAAgB;AAChB,MAAM,MAAM,YAAY,GACpB,WAAW,GACX,gBAAgB,GAChB,cAAc,GACd,eAAe,GACf,iBAAiB,GACjB,2BAA2B,GAC3B,mBAAmB,GACnB,kBAAkB,GAClB,cAAc,GACd,eAAe,GACf,aAAa,GACb,oBAAoB,GACpB,eAAe,GACf,gBAAgB,CAAC"}
|
node_modules/@modelcontextprotocol/sdk/dist/cjs/spec.types.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
/**
|
| 3 |
+
* This file is automatically generated from the Model Context Protocol specification.
|
| 4 |
+
*
|
| 5 |
+
* Source: https://github.com/modelcontextprotocol/modelcontextprotocol
|
| 6 |
+
* Pulled from: https://raw.githubusercontent.com/modelcontextprotocol/modelcontextprotocol/main/schema/draft/schema.ts
|
| 7 |
+
* Last updated from commit: 35fa160caf287a9c48696e3ae452c0645c713669
|
| 8 |
+
*
|
| 9 |
+
* DO NOT EDIT THIS FILE MANUALLY. Changes will be overwritten by automated updates.
|
| 10 |
+
* To update this file, run: npm run fetch:spec-types
|
| 11 |
+
*/ /* JSON-RPC types */
|
| 12 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 13 |
+
exports.URL_ELICITATION_REQUIRED = exports.INTERNAL_ERROR = exports.INVALID_PARAMS = exports.METHOD_NOT_FOUND = exports.INVALID_REQUEST = exports.PARSE_ERROR = exports.JSONRPC_VERSION = exports.LATEST_PROTOCOL_VERSION = void 0;
|
| 14 |
+
/** @internal */
|
| 15 |
+
exports.LATEST_PROTOCOL_VERSION = "DRAFT-2026-v1";
|
| 16 |
+
/** @internal */
|
| 17 |
+
exports.JSONRPC_VERSION = "2.0";
|
| 18 |
+
// Standard JSON-RPC error codes
|
| 19 |
+
exports.PARSE_ERROR = -32700;
|
| 20 |
+
exports.INVALID_REQUEST = -32600;
|
| 21 |
+
exports.METHOD_NOT_FOUND = -32601;
|
| 22 |
+
exports.INVALID_PARAMS = -32602;
|
| 23 |
+
exports.INTERNAL_ERROR = -32603;
|
| 24 |
+
// Implementation-specific JSON-RPC error codes [-32000, -32099]
|
| 25 |
+
/** @internal */
|
| 26 |
+
exports.URL_ELICITATION_REQUIRED = -32042;
|
| 27 |
+
//# sourceMappingURL=spec.types.js.map
|
node_modules/@modelcontextprotocol/sdk/dist/cjs/spec.types.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"spec.types.js","sourceRoot":"","sources":["../../src/spec.types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG,CAAA,oBAAoB;;;AAYvB,gBAAgB;AACH,QAAA,uBAAuB,GAAG,eAAe,CAAC;AACvD,gBAAgB;AACH,QAAA,eAAe,GAAG,KAAK,CAAC;AA4JrC,gCAAgC;AACnB,QAAA,WAAW,GAAG,CAAC,KAAK,CAAC;AACrB,QAAA,eAAe,GAAG,CAAC,KAAK,CAAC;AACzB,QAAA,gBAAgB,GAAG,CAAC,KAAK,CAAC;AAC1B,QAAA,cAAc,GAAG,CAAC,KAAK,CAAC;AACxB,QAAA,cAAc,GAAG,CAAC,KAAK,CAAC;AAErC,gEAAgE;AAChE,gBAAgB;AACH,QAAA,wBAAwB,GAAG,CAAC,KAAK,CAAC"}
|
node_modules/@modelcontextprotocol/sdk/dist/cjs/types.d.ts
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
node_modules/@modelcontextprotocol/sdk/dist/cjs/types.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAElD,eAAO,MAAM,uBAAuB,eAAe,CAAC;AACpD,eAAO,MAAM,mCAAmC,eAAe,CAAC;AAChE,eAAO,MAAM,2BAA2B,UAAoF,CAAC;AAE7H,eAAO,MAAM,qBAAqB,yCAAyC,CAAC;AAG5E,eAAO,MAAM,eAAe,QAAQ,CAAC;AAErC;;GAEG;AACH,KAAK,iBAAiB,CAAC,CAAC,IAAI,CAAC,SAAS,MAAM,GAAG,CAAC,CAAC,SAAS,MAAM,CAAC,GAAG;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;AAO7H;;GAEG;AACH,eAAO,MAAM,mBAAmB,iDAA0C,CAAC;AAE3E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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
| 3 |
+
if (k2 === undefined) k2 = k;
|
| 4 |
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
| 5 |
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
| 6 |
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
| 7 |
+
}
|
| 8 |
+
Object.defineProperty(o, k2, desc);
|
| 9 |
+
}) : (function(o, m, k, k2) {
|
| 10 |
+
if (k2 === undefined) k2 = k;
|
| 11 |
+
o[k2] = m[k];
|
| 12 |
+
}));
|
| 13 |
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
| 14 |
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
| 15 |
+
}) : function(o, v) {
|
| 16 |
+
o["default"] = v;
|
| 17 |
+
});
|
| 18 |
+
var __importStar = (this && this.__importStar) || function (mod) {
|
| 19 |
+
if (mod && mod.__esModule) return mod;
|
| 20 |
+
var result = {};
|
| 21 |
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
| 22 |
+
__setModuleDefault(result, mod);
|
| 23 |
+
return result;
|
| 24 |
+
};
|
| 25 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 26 |
+
exports.ProgressNotificationParamsSchema = exports.ProgressSchema = exports.PingRequestSchema = exports.isInitializedNotification = exports.InitializedNotificationSchema = exports.InitializeResultSchema = exports.ServerCapabilitiesSchema = exports.isInitializeRequest = exports.InitializeRequestSchema = exports.InitializeRequestParamsSchema = exports.ClientCapabilitiesSchema = exports.ServerTasksCapabilitySchema = exports.ClientTasksCapabilitySchema = exports.ImplementationSchema = exports.BaseMetadataSchema = exports.IconsSchema = exports.IconSchema = exports.CancelledNotificationSchema = exports.CancelledNotificationParamsSchema = exports.EmptyResultSchema = exports.JSONRPCResponseSchema = exports.JSONRPCMessageSchema = exports.isJSONRPCError = exports.isJSONRPCErrorResponse = exports.JSONRPCErrorSchema = exports.JSONRPCErrorResponseSchema = exports.ErrorCode = exports.isJSONRPCResponse = exports.isJSONRPCResultResponse = exports.JSONRPCResultResponseSchema = exports.isJSONRPCNotification = exports.JSONRPCNotificationSchema = exports.isJSONRPCRequest = exports.JSONRPCRequestSchema = exports.RequestIdSchema = exports.ResultSchema = exports.NotificationSchema = exports.RequestSchema = exports.isTaskAugmentedRequestParams = exports.TaskAugmentedRequestParamsSchema = exports.RelatedTaskMetadataSchema = exports.TaskMetadataSchema = exports.TaskCreationParamsSchema = exports.CursorSchema = exports.ProgressTokenSchema = exports.JSONRPC_VERSION = exports.RELATED_TASK_META_KEY = exports.SUPPORTED_PROTOCOL_VERSIONS = exports.DEFAULT_NEGOTIATED_PROTOCOL_VERSION = exports.LATEST_PROTOCOL_VERSION = void 0;
|
| 27 |
+
exports.EmbeddedResourceSchema = exports.ToolUseContentSchema = exports.AudioContentSchema = exports.ImageContentSchema = exports.TextContentSchema = exports.GetPromptRequestSchema = exports.GetPromptRequestParamsSchema = exports.ListPromptsResultSchema = exports.ListPromptsRequestSchema = exports.PromptSchema = exports.PromptArgumentSchema = exports.ResourceUpdatedNotificationSchema = exports.ResourceUpdatedNotificationParamsSchema = exports.UnsubscribeRequestSchema = exports.UnsubscribeRequestParamsSchema = exports.SubscribeRequestSchema = exports.SubscribeRequestParamsSchema = exports.ResourceListChangedNotificationSchema = exports.ReadResourceResultSchema = exports.ReadResourceRequestSchema = exports.ReadResourceRequestParamsSchema = exports.ResourceRequestParamsSchema = exports.ListResourceTemplatesResultSchema = exports.ListResourceTemplatesRequestSchema = exports.ListResourcesResultSchema = exports.ListResourcesRequestSchema = exports.ResourceTemplateSchema = exports.ResourceSchema = exports.AnnotationsSchema = exports.RoleSchema = exports.BlobResourceContentsSchema = exports.TextResourceContentsSchema = exports.ResourceContentsSchema = exports.CancelTaskResultSchema = exports.CancelTaskRequestSchema = exports.ListTasksResultSchema = exports.ListTasksRequestSchema = exports.GetTaskPayloadResultSchema = exports.GetTaskPayloadRequestSchema = exports.GetTaskResultSchema = exports.GetTaskRequestSchema = exports.TaskStatusNotificationSchema = exports.TaskStatusNotificationParamsSchema = exports.CreateTaskResultSchema = exports.TaskSchema = exports.TaskStatusSchema = exports.PaginatedResultSchema = exports.PaginatedRequestSchema = exports.PaginatedRequestParamsSchema = exports.ProgressNotificationSchema = void 0;
|
| 28 |
+
exports.ElicitationCompleteNotificationSchema = exports.ElicitationCompleteNotificationParamsSchema = exports.ElicitRequestSchema = exports.ElicitRequestParamsSchema = exports.ElicitRequestURLParamsSchema = exports.ElicitRequestFormParamsSchema = exports.PrimitiveSchemaDefinitionSchema = exports.EnumSchemaSchema = exports.MultiSelectEnumSchemaSchema = exports.TitledMultiSelectEnumSchemaSchema = exports.UntitledMultiSelectEnumSchemaSchema = exports.SingleSelectEnumSchemaSchema = exports.LegacyTitledEnumSchemaSchema = exports.TitledSingleSelectEnumSchemaSchema = exports.UntitledSingleSelectEnumSchemaSchema = exports.NumberSchemaSchema = exports.StringSchemaSchema = exports.BooleanSchemaSchema = exports.CreateMessageResultWithToolsSchema = exports.CreateMessageResultSchema = exports.CreateMessageRequestSchema = exports.CreateMessageRequestParamsSchema = exports.SamplingMessageSchema = exports.SamplingMessageContentBlockSchema = exports.SamplingContentSchema = exports.ToolResultContentSchema = exports.ToolChoiceSchema = exports.ModelPreferencesSchema = exports.ModelHintSchema = exports.LoggingMessageNotificationSchema = exports.LoggingMessageNotificationParamsSchema = exports.SetLevelRequestSchema = exports.SetLevelRequestParamsSchema = exports.LoggingLevelSchema = exports.ListChangedOptionsBaseSchema = exports.ToolListChangedNotificationSchema = exports.CallToolRequestSchema = exports.CallToolRequestParamsSchema = exports.CompatibilityCallToolResultSchema = exports.CallToolResultSchema = exports.ListToolsResultSchema = exports.ListToolsRequestSchema = exports.ToolSchema = exports.ToolExecutionSchema = exports.ToolAnnotationsSchema = exports.PromptListChangedNotificationSchema = exports.GetPromptResultSchema = exports.PromptMessageSchema = exports.ContentBlockSchema = exports.ResourceLinkSchema = void 0;
|
| 29 |
+
exports.UrlElicitationRequiredError = exports.McpError = exports.ServerResultSchema = exports.ServerNotificationSchema = exports.ServerRequestSchema = exports.ClientResultSchema = exports.ClientNotificationSchema = exports.ClientRequestSchema = exports.RootsListChangedNotificationSchema = exports.ListRootsResultSchema = exports.ListRootsRequestSchema = exports.RootSchema = exports.CompleteResultSchema = exports.CompleteRequestSchema = exports.CompleteRequestParamsSchema = exports.PromptReferenceSchema = exports.ResourceReferenceSchema = exports.ResourceTemplateReferenceSchema = exports.ElicitResultSchema = void 0;
|
| 30 |
+
exports.assertCompleteRequestPrompt = assertCompleteRequestPrompt;
|
| 31 |
+
exports.assertCompleteRequestResourceTemplate = assertCompleteRequestResourceTemplate;
|
| 32 |
+
const z = __importStar(require("zod/v4"));
|
| 33 |
+
exports.LATEST_PROTOCOL_VERSION = '2025-11-25';
|
| 34 |
+
exports.DEFAULT_NEGOTIATED_PROTOCOL_VERSION = '2025-03-26';
|
| 35 |
+
exports.SUPPORTED_PROTOCOL_VERSIONS = [exports.LATEST_PROTOCOL_VERSION, '2025-06-18', '2025-03-26', '2024-11-05', '2024-10-07'];
|
| 36 |
+
exports.RELATED_TASK_META_KEY = 'io.modelcontextprotocol/related-task';
|
| 37 |
+
/* JSON-RPC types */
|
| 38 |
+
exports.JSONRPC_VERSION = '2.0';
|
| 39 |
+
/**
|
| 40 |
+
* Assert 'object' type schema.
|
| 41 |
+
*
|
| 42 |
+
* @internal
|
| 43 |
+
*/
|
| 44 |
+
const AssertObjectSchema = z.custom((v) => v !== null && (typeof v === 'object' || typeof v === 'function'));
|
| 45 |
+
/**
|
| 46 |
+
* A progress token, used to associate progress notifications with the original request.
|
| 47 |
+
*/
|
| 48 |
+
exports.ProgressTokenSchema = z.union([z.string(), z.number().int()]);
|
| 49 |
+
/**
|
| 50 |
+
* An opaque token used to represent a cursor for pagination.
|
| 51 |
+
*/
|
| 52 |
+
exports.CursorSchema = z.string();
|
| 53 |
+
/**
|
| 54 |
+
* Task creation parameters, used to ask that the server create a task to represent a request.
|
| 55 |
+
*/
|
| 56 |
+
exports.TaskCreationParamsSchema = z.looseObject({
|
| 57 |
+
/**
|
| 58 |
+
* Requested duration in milliseconds to retain task from creation.
|
| 59 |
+
*/
|
| 60 |
+
ttl: z.number().optional(),
|
| 61 |
+
/**
|
| 62 |
+
* Time in milliseconds to wait between task status requests.
|
| 63 |
+
*/
|
| 64 |
+
pollInterval: z.number().optional()
|
| 65 |
+
});
|
| 66 |
+
exports.TaskMetadataSchema = z.object({
|
| 67 |
+
ttl: z.number().optional()
|
| 68 |
+
});
|
| 69 |
+
/**
|
| 70 |
+
* Metadata for associating messages with a task.
|
| 71 |
+
* Include this in the `_meta` field under the key `io.modelcontextprotocol/related-task`.
|
| 72 |
+
*/
|
| 73 |
+
exports.RelatedTaskMetadataSchema = z.object({
|
| 74 |
+
taskId: z.string()
|
| 75 |
+
});
|
| 76 |
+
const RequestMetaSchema = z.looseObject({
|
| 77 |
+
/**
|
| 78 |
+
* If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications.
|
| 79 |
+
*/
|
| 80 |
+
progressToken: exports.ProgressTokenSchema.optional(),
|
| 81 |
+
/**
|
| 82 |
+
* If specified, this request is related to the provided task.
|
| 83 |
+
*/
|
| 84 |
+
[exports.RELATED_TASK_META_KEY]: exports.RelatedTaskMetadataSchema.optional()
|
| 85 |
+
});
|
| 86 |
+
/**
|
| 87 |
+
* Common params for any request.
|
| 88 |
+
*/
|
| 89 |
+
const BaseRequestParamsSchema = z.object({
|
| 90 |
+
/**
|
| 91 |
+
* See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage.
|
| 92 |
+
*/
|
| 93 |
+
_meta: RequestMetaSchema.optional()
|
| 94 |
+
});
|
| 95 |
+
/**
|
| 96 |
+
* Common params for any task-augmented request.
|
| 97 |
+
*/
|
| 98 |
+
exports.TaskAugmentedRequestParamsSchema = BaseRequestParamsSchema.extend({
|
| 99 |
+
/**
|
| 100 |
+
* If specified, the caller is requesting task-augmented execution for this request.
|
| 101 |
+
* The request will return a CreateTaskResult immediately, and the actual result can be
|
| 102 |
+
* retrieved later via tasks/result.
|
| 103 |
+
*
|
| 104 |
+
* Task augmentation is subject to capability negotiation - receivers MUST declare support
|
| 105 |
+
* for task augmentation of specific request types in their capabilities.
|
| 106 |
+
*/
|
| 107 |
+
task: exports.TaskMetadataSchema.optional()
|
| 108 |
+
});
|
| 109 |
+
/**
|
| 110 |
+
* Checks if a value is a valid TaskAugmentedRequestParams.
|
| 111 |
+
* @param value - The value to check.
|
| 112 |
+
*
|
| 113 |
+
* @returns True if the value is a valid TaskAugmentedRequestParams, false otherwise.
|
| 114 |
+
*/
|
| 115 |
+
const isTaskAugmentedRequestParams = (value) => exports.TaskAugmentedRequestParamsSchema.safeParse(value).success;
|
| 116 |
+
exports.isTaskAugmentedRequestParams = isTaskAugmentedRequestParams;
|
| 117 |
+
exports.RequestSchema = z.object({
|
| 118 |
+
method: z.string(),
|
| 119 |
+
params: BaseRequestParamsSchema.loose().optional()
|
| 120 |
+
});
|
| 121 |
+
const NotificationsParamsSchema = z.object({
|
| 122 |
+
/**
|
| 123 |
+
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
| 124 |
+
* for notes on _meta usage.
|
| 125 |
+
*/
|
| 126 |
+
_meta: RequestMetaSchema.optional()
|
| 127 |
+
});
|
| 128 |
+
exports.NotificationSchema = z.object({
|
| 129 |
+
method: z.string(),
|
| 130 |
+
params: NotificationsParamsSchema.loose().optional()
|
| 131 |
+
});
|
| 132 |
+
exports.ResultSchema = z.looseObject({
|
| 133 |
+
/**
|
| 134 |
+
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
| 135 |
+
* for notes on _meta usage.
|
| 136 |
+
*/
|
| 137 |
+
_meta: RequestMetaSchema.optional()
|
| 138 |
+
});
|
| 139 |
+
/**
|
| 140 |
+
* A uniquely identifying ID for a request in JSON-RPC.
|
| 141 |
+
*/
|
| 142 |
+
exports.RequestIdSchema = z.union([z.string(), z.number().int()]);
|
| 143 |
+
/**
|
| 144 |
+
* A request that expects a response.
|
| 145 |
+
*/
|
| 146 |
+
exports.JSONRPCRequestSchema = z
|
| 147 |
+
.object({
|
| 148 |
+
jsonrpc: z.literal(exports.JSONRPC_VERSION),
|
| 149 |
+
id: exports.RequestIdSchema,
|
| 150 |
+
...exports.RequestSchema.shape
|
| 151 |
+
})
|
| 152 |
+
.strict();
|
| 153 |
+
const isJSONRPCRequest = (value) => exports.JSONRPCRequestSchema.safeParse(value).success;
|
| 154 |
+
exports.isJSONRPCRequest = isJSONRPCRequest;
|
| 155 |
+
/**
|
| 156 |
+
* A notification which does not expect a response.
|
| 157 |
+
*/
|
| 158 |
+
exports.JSONRPCNotificationSchema = z
|
| 159 |
+
.object({
|
| 160 |
+
jsonrpc: z.literal(exports.JSONRPC_VERSION),
|
| 161 |
+
...exports.NotificationSchema.shape
|
| 162 |
+
})
|
| 163 |
+
.strict();
|
| 164 |
+
const isJSONRPCNotification = (value) => exports.JSONRPCNotificationSchema.safeParse(value).success;
|
| 165 |
+
exports.isJSONRPCNotification = isJSONRPCNotification;
|
| 166 |
+
/**
|
| 167 |
+
* A successful (non-error) response to a request.
|
| 168 |
+
*/
|
| 169 |
+
exports.JSONRPCResultResponseSchema = z
|
| 170 |
+
.object({
|
| 171 |
+
jsonrpc: z.literal(exports.JSONRPC_VERSION),
|
| 172 |
+
id: exports.RequestIdSchema,
|
| 173 |
+
result: exports.ResultSchema
|
| 174 |
+
})
|
| 175 |
+
.strict();
|
| 176 |
+
/**
|
| 177 |
+
* Checks if a value is a valid JSONRPCResultResponse.
|
| 178 |
+
* @param value - The value to check.
|
| 179 |
+
*
|
| 180 |
+
* @returns True if the value is a valid JSONRPCResultResponse, false otherwise.
|
| 181 |
+
*/
|
| 182 |
+
const isJSONRPCResultResponse = (value) => exports.JSONRPCResultResponseSchema.safeParse(value).success;
|
| 183 |
+
exports.isJSONRPCResultResponse = isJSONRPCResultResponse;
|
| 184 |
+
/**
|
| 185 |
+
* @deprecated Use {@link isJSONRPCResultResponse} instead.
|
| 186 |
+
*
|
| 187 |
+
* Please note that {@link JSONRPCResponse} is a union of {@link JSONRPCResultResponse} and {@link JSONRPCErrorResponse} as per the updated JSON-RPC specification. (was previously just {@link JSONRPCResultResponse})
|
| 188 |
+
*/
|
| 189 |
+
exports.isJSONRPCResponse = exports.isJSONRPCResultResponse;
|
| 190 |
+
/**
|
| 191 |
+
* Error codes defined by the JSON-RPC specification.
|
| 192 |
+
*/
|
| 193 |
+
var ErrorCode;
|
| 194 |
+
(function (ErrorCode) {
|
| 195 |
+
// SDK error codes
|
| 196 |
+
ErrorCode[ErrorCode["ConnectionClosed"] = -32000] = "ConnectionClosed";
|
| 197 |
+
ErrorCode[ErrorCode["RequestTimeout"] = -32001] = "RequestTimeout";
|
| 198 |
+
// Standard JSON-RPC error codes
|
| 199 |
+
ErrorCode[ErrorCode["ParseError"] = -32700] = "ParseError";
|
| 200 |
+
ErrorCode[ErrorCode["InvalidRequest"] = -32600] = "InvalidRequest";
|
| 201 |
+
ErrorCode[ErrorCode["MethodNotFound"] = -32601] = "MethodNotFound";
|
| 202 |
+
ErrorCode[ErrorCode["InvalidParams"] = -32602] = "InvalidParams";
|
| 203 |
+
ErrorCode[ErrorCode["InternalError"] = -32603] = "InternalError";
|
| 204 |
+
// MCP-specific error codes
|
| 205 |
+
ErrorCode[ErrorCode["UrlElicitationRequired"] = -32042] = "UrlElicitationRequired";
|
| 206 |
+
})(ErrorCode || (exports.ErrorCode = ErrorCode = {}));
|
| 207 |
+
/**
|
| 208 |
+
* A response to a request that indicates an error occurred.
|
| 209 |
+
*/
|
| 210 |
+
exports.JSONRPCErrorResponseSchema = z
|
| 211 |
+
.object({
|
| 212 |
+
jsonrpc: z.literal(exports.JSONRPC_VERSION),
|
| 213 |
+
id: exports.RequestIdSchema.optional(),
|
| 214 |
+
error: z.object({
|
| 215 |
+
/**
|
| 216 |
+
* The error type that occurred.
|
| 217 |
+
*/
|
| 218 |
+
code: z.number().int(),
|
| 219 |
+
/**
|
| 220 |
+
* A short description of the error. The message SHOULD be limited to a concise single sentence.
|
| 221 |
+
*/
|
| 222 |
+
message: z.string(),
|
| 223 |
+
/**
|
| 224 |
+
* Additional information about the error. The value of this member is defined by the sender (e.g. detailed error information, nested errors etc.).
|
| 225 |
+
*/
|
| 226 |
+
data: z.unknown().optional()
|
| 227 |
+
})
|
| 228 |
+
})
|
| 229 |
+
.strict();
|
| 230 |
+
/**
|
| 231 |
+
* @deprecated Use {@link JSONRPCErrorResponseSchema} instead.
|
| 232 |
+
*/
|
| 233 |
+
exports.JSONRPCErrorSchema = exports.JSONRPCErrorResponseSchema;
|
| 234 |
+
/**
|
| 235 |
+
* Checks if a value is a valid JSONRPCErrorResponse.
|
| 236 |
+
* @param value - The value to check.
|
| 237 |
+
*
|
| 238 |
+
* @returns True if the value is a valid JSONRPCErrorResponse, false otherwise.
|
| 239 |
+
*/
|
| 240 |
+
const isJSONRPCErrorResponse = (value) => exports.JSONRPCErrorResponseSchema.safeParse(value).success;
|
| 241 |
+
exports.isJSONRPCErrorResponse = isJSONRPCErrorResponse;
|
| 242 |
+
/**
|
| 243 |
+
* @deprecated Use {@link isJSONRPCErrorResponse} instead.
|
| 244 |
+
*/
|
| 245 |
+
exports.isJSONRPCError = exports.isJSONRPCErrorResponse;
|
| 246 |
+
exports.JSONRPCMessageSchema = z.union([
|
| 247 |
+
exports.JSONRPCRequestSchema,
|
| 248 |
+
exports.JSONRPCNotificationSchema,
|
| 249 |
+
exports.JSONRPCResultResponseSchema,
|
| 250 |
+
exports.JSONRPCErrorResponseSchema
|
| 251 |
+
]);
|
| 252 |
+
exports.JSONRPCResponseSchema = z.union([exports.JSONRPCResultResponseSchema, exports.JSONRPCErrorResponseSchema]);
|
| 253 |
+
/* Empty result */
|
| 254 |
+
/**
|
| 255 |
+
* A response that indicates success but carries no data.
|
| 256 |
+
*/
|
| 257 |
+
exports.EmptyResultSchema = exports.ResultSchema.strict();
|
| 258 |
+
exports.CancelledNotificationParamsSchema = NotificationsParamsSchema.extend({
|
| 259 |
+
/**
|
| 260 |
+
* The ID of the request to cancel.
|
| 261 |
+
*
|
| 262 |
+
* This MUST correspond to the ID of a request previously issued in the same direction.
|
| 263 |
+
*/
|
| 264 |
+
requestId: exports.RequestIdSchema.optional(),
|
| 265 |
+
/**
|
| 266 |
+
* An optional string describing the reason for the cancellation. This MAY be logged or presented to the user.
|
| 267 |
+
*/
|
| 268 |
+
reason: z.string().optional()
|
| 269 |
+
});
|
| 270 |
+
/* Cancellation */
|
| 271 |
+
/**
|
| 272 |
+
* This notification can be sent by either side to indicate that it is cancelling a previously-issued request.
|
| 273 |
+
*
|
| 274 |
+
* The request SHOULD still be in-flight, but due to communication latency, it is always possible that this notification MAY arrive after the request has already finished.
|
| 275 |
+
*
|
| 276 |
+
* This notification indicates that the result will be unused, so any associated processing SHOULD cease.
|
| 277 |
+
*
|
| 278 |
+
* A client MUST NOT attempt to cancel its `initialize` request.
|
| 279 |
+
*/
|
| 280 |
+
exports.CancelledNotificationSchema = exports.NotificationSchema.extend({
|
| 281 |
+
method: z.literal('notifications/cancelled'),
|
| 282 |
+
params: exports.CancelledNotificationParamsSchema
|
| 283 |
+
});
|
| 284 |
+
/* Base Metadata */
|
| 285 |
+
/**
|
| 286 |
+
* Icon schema for use in tools, prompts, resources, and implementations.
|
| 287 |
+
*/
|
| 288 |
+
exports.IconSchema = z.object({
|
| 289 |
+
/**
|
| 290 |
+
* URL or data URI for the icon.
|
| 291 |
+
*/
|
| 292 |
+
src: z.string(),
|
| 293 |
+
/**
|
| 294 |
+
* Optional MIME type for the icon.
|
| 295 |
+
*/
|
| 296 |
+
mimeType: z.string().optional(),
|
| 297 |
+
/**
|
| 298 |
+
* Optional array of strings that specify sizes at which the icon can be used.
|
| 299 |
+
* Each string should be in WxH format (e.g., `"48x48"`, `"96x96"`) or `"any"` for scalable formats like SVG.
|
| 300 |
+
*
|
| 301 |
+
* If not provided, the client should assume that the icon can be used at any size.
|
| 302 |
+
*/
|
| 303 |
+
sizes: z.array(z.string()).optional(),
|
| 304 |
+
/**
|
| 305 |
+
* Optional specifier for the theme this icon is designed for. `light` indicates
|
| 306 |
+
* the icon is designed to be used with a light background, and `dark` indicates
|
| 307 |
+
* the icon is designed to be used with a dark background.
|
| 308 |
+
*
|
| 309 |
+
* If not provided, the client should assume the icon can be used with any theme.
|
| 310 |
+
*/
|
| 311 |
+
theme: z.enum(['light', 'dark']).optional()
|
| 312 |
+
});
|
| 313 |
+
/**
|
| 314 |
+
* Base schema to add `icons` property.
|
| 315 |
+
*
|
| 316 |
+
*/
|
| 317 |
+
exports.IconsSchema = z.object({
|
| 318 |
+
/**
|
| 319 |
+
* Optional set of sized icons that the client can display in a user interface.
|
| 320 |
+
*
|
| 321 |
+
* Clients that support rendering icons MUST support at least the following MIME types:
|
| 322 |
+
* - `image/png` - PNG images (safe, universal compatibility)
|
| 323 |
+
* - `image/jpeg` (and `image/jpg`) - JPEG images (safe, universal compatibility)
|
| 324 |
+
*
|
| 325 |
+
* Clients that support rendering icons SHOULD also support:
|
| 326 |
+
* - `image/svg+xml` - SVG images (scalable but requires security precautions)
|
| 327 |
+
* - `image/webp` - WebP images (modern, efficient format)
|
| 328 |
+
*/
|
| 329 |
+
icons: z.array(exports.IconSchema).optional()
|
| 330 |
+
});
|
| 331 |
+
/**
|
| 332 |
+
* Base metadata interface for common properties across resources, tools, prompts, and implementations.
|
| 333 |
+
*/
|
| 334 |
+
exports.BaseMetadataSchema = z.object({
|
| 335 |
+
/** Intended for programmatic or logical use, but used as a display name in past specs or fallback */
|
| 336 |
+
name: z.string(),
|
| 337 |
+
/**
|
| 338 |
+
* Intended for UI and end-user contexts — optimized to be human-readable and easily understood,
|
| 339 |
+
* even by those unfamiliar with domain-specific terminology.
|
| 340 |
+
*
|
| 341 |
+
* If not provided, the name should be used for display (except for Tool,
|
| 342 |
+
* where `annotations.title` should be given precedence over using `name`,
|
| 343 |
+
* if present).
|
| 344 |
+
*/
|
| 345 |
+
title: z.string().optional()
|
| 346 |
+
});
|
| 347 |
+
/* Initialization */
|
| 348 |
+
/**
|
| 349 |
+
* Describes the name and version of an MCP implementation.
|
| 350 |
+
*/
|
| 351 |
+
exports.ImplementationSchema = exports.BaseMetadataSchema.extend({
|
| 352 |
+
...exports.BaseMetadataSchema.shape,
|
| 353 |
+
...exports.IconsSchema.shape,
|
| 354 |
+
version: z.string(),
|
| 355 |
+
/**
|
| 356 |
+
* An optional URL of the website for this implementation.
|
| 357 |
+
*/
|
| 358 |
+
websiteUrl: z.string().optional(),
|
| 359 |
+
/**
|
| 360 |
+
* An optional human-readable description of what this implementation does.
|
| 361 |
+
*
|
| 362 |
+
* This can be used by clients or servers to provide context about their purpose
|
| 363 |
+
* and capabilities. For example, a server might describe the types of resources
|
| 364 |
+
* or tools it provides, while a client might describe its intended use case.
|
| 365 |
+
*/
|
| 366 |
+
description: z.string().optional()
|
| 367 |
+
});
|
| 368 |
+
const FormElicitationCapabilitySchema = z.intersection(z.object({
|
| 369 |
+
applyDefaults: z.boolean().optional()
|
| 370 |
+
}), z.record(z.string(), z.unknown()));
|
| 371 |
+
const ElicitationCapabilitySchema = z.preprocess(value => {
|
| 372 |
+
if (value && typeof value === 'object' && !Array.isArray(value)) {
|
| 373 |
+
if (Object.keys(value).length === 0) {
|
| 374 |
+
return { form: {} };
|
| 375 |
+
}
|
| 376 |
+
}
|
| 377 |
+
return value;
|
| 378 |
+
}, z.intersection(z.object({
|
| 379 |
+
form: FormElicitationCapabilitySchema.optional(),
|
| 380 |
+
url: AssertObjectSchema.optional()
|
| 381 |
+
}), z.record(z.string(), z.unknown()).optional()));
|
| 382 |
+
/**
|
| 383 |
+
* Task capabilities for clients, indicating which request types support task creation.
|
| 384 |
+
*/
|
| 385 |
+
exports.ClientTasksCapabilitySchema = z.looseObject({
|
| 386 |
+
/**
|
| 387 |
+
* Present if the client supports listing tasks.
|
| 388 |
+
*/
|
| 389 |
+
list: AssertObjectSchema.optional(),
|
| 390 |
+
/**
|
| 391 |
+
* Present if the client supports cancelling tasks.
|
| 392 |
+
*/
|
| 393 |
+
cancel: AssertObjectSchema.optional(),
|
| 394 |
+
/**
|
| 395 |
+
* Capabilities for task creation on specific request types.
|
| 396 |
+
*/
|
| 397 |
+
requests: z
|
| 398 |
+
.looseObject({
|
| 399 |
+
/**
|
| 400 |
+
* Task support for sampling requests.
|
| 401 |
+
*/
|
| 402 |
+
sampling: z
|
| 403 |
+
.looseObject({
|
| 404 |
+
createMessage: AssertObjectSchema.optional()
|
| 405 |
+
})
|
| 406 |
+
.optional(),
|
| 407 |
+
/**
|
| 408 |
+
* Task support for elicitation requests.
|
| 409 |
+
*/
|
| 410 |
+
elicitation: z
|
| 411 |
+
.looseObject({
|
| 412 |
+
create: AssertObjectSchema.optional()
|
| 413 |
+
})
|
| 414 |
+
.optional()
|
| 415 |
+
})
|
| 416 |
+
.optional()
|
| 417 |
+
});
|
| 418 |
+
/**
|
| 419 |
+
* Task capabilities for servers, indicating which request types support task creation.
|
| 420 |
+
*/
|
| 421 |
+
exports.ServerTasksCapabilitySchema = z.looseObject({
|
| 422 |
+
/**
|
| 423 |
+
* Present if the server supports listing tasks.
|
| 424 |
+
*/
|
| 425 |
+
list: AssertObjectSchema.optional(),
|
| 426 |
+
/**
|
| 427 |
+
* Present if the server supports cancelling tasks.
|
| 428 |
+
*/
|
| 429 |
+
cancel: AssertObjectSchema.optional(),
|
| 430 |
+
/**
|
| 431 |
+
* Capabilities for task creation on specific request types.
|
| 432 |
+
*/
|
| 433 |
+
requests: z
|
| 434 |
+
.looseObject({
|
| 435 |
+
/**
|
| 436 |
+
* Task support for tool requests.
|
| 437 |
+
*/
|
| 438 |
+
tools: z
|
| 439 |
+
.looseObject({
|
| 440 |
+
call: AssertObjectSchema.optional()
|
| 441 |
+
})
|
| 442 |
+
.optional()
|
| 443 |
+
})
|
| 444 |
+
.optional()
|
| 445 |
+
});
|
| 446 |
+
/**
|
| 447 |
+
* Capabilities a client may support. Known capabilities are defined here, in this schema, but this is not a closed set: any client can define its own, additional capabilities.
|
| 448 |
+
*/
|
| 449 |
+
exports.ClientCapabilitiesSchema = z.object({
|
| 450 |
+
/**
|
| 451 |
+
* Experimental, non-standard capabilities that the client supports.
|
| 452 |
+
*/
|
| 453 |
+
experimental: z.record(z.string(), AssertObjectSchema).optional(),
|
| 454 |
+
/**
|
| 455 |
+
* Present if the client supports sampling from an LLM.
|
| 456 |
+
*/
|
| 457 |
+
sampling: z
|
| 458 |
+
.object({
|
| 459 |
+
/**
|
| 460 |
+
* Present if the client supports context inclusion via includeContext parameter.
|
| 461 |
+
* If not declared, servers SHOULD only use `includeContext: "none"` (or omit it).
|
| 462 |
+
*/
|
| 463 |
+
context: AssertObjectSchema.optional(),
|
| 464 |
+
/**
|
| 465 |
+
* Present if the client supports tool use via tools and toolChoice parameters.
|
| 466 |
+
*/
|
| 467 |
+
tools: AssertObjectSchema.optional()
|
| 468 |
+
})
|
| 469 |
+
.optional(),
|
| 470 |
+
/**
|
| 471 |
+
* Present if the client supports eliciting user input.
|
| 472 |
+
*/
|
| 473 |
+
elicitation: ElicitationCapabilitySchema.optional(),
|
| 474 |
+
/**
|
| 475 |
+
* Present if the client supports listing roots.
|
| 476 |
+
*/
|
| 477 |
+
roots: z
|
| 478 |
+
.object({
|
| 479 |
+
/**
|
| 480 |
+
* Whether the client supports issuing notifications for changes to the roots list.
|
| 481 |
+
*/
|
| 482 |
+
listChanged: z.boolean().optional()
|
| 483 |
+
})
|
| 484 |
+
.optional(),
|
| 485 |
+
/**
|
| 486 |
+
* Present if the client supports task creation.
|
| 487 |
+
*/
|
| 488 |
+
tasks: exports.ClientTasksCapabilitySchema.optional(),
|
| 489 |
+
/**
|
| 490 |
+
* Extensions that the client supports. Keys are extension identifiers (vendor-prefix/extension-name).
|
| 491 |
+
*/
|
| 492 |
+
extensions: z.record(z.string(), AssertObjectSchema).optional()
|
| 493 |
+
});
|
| 494 |
+
exports.InitializeRequestParamsSchema = BaseRequestParamsSchema.extend({
|
| 495 |
+
/**
|
| 496 |
+
* The latest version of the Model Context Protocol that the client supports. The client MAY decide to support older versions as well.
|
| 497 |
+
*/
|
| 498 |
+
protocolVersion: z.string(),
|
| 499 |
+
capabilities: exports.ClientCapabilitiesSchema,
|
| 500 |
+
clientInfo: exports.ImplementationSchema
|
| 501 |
+
});
|
| 502 |
+
/**
|
| 503 |
+
* This request is sent from the client to the server when it first connects, asking it to begin initialization.
|
| 504 |
+
*/
|
| 505 |
+
exports.InitializeRequestSchema = exports.RequestSchema.extend({
|
| 506 |
+
method: z.literal('initialize'),
|
| 507 |
+
params: exports.InitializeRequestParamsSchema
|
| 508 |
+
});
|
| 509 |
+
const isInitializeRequest = (value) => exports.InitializeRequestSchema.safeParse(value).success;
|
| 510 |
+
exports.isInitializeRequest = isInitializeRequest;
|
| 511 |
+
/**
|
| 512 |
+
* Capabilities that a server may support. Known capabilities are defined here, in this schema, but this is not a closed set: any server can define its own, additional capabilities.
|
| 513 |
+
*/
|
| 514 |
+
exports.ServerCapabilitiesSchema = z.object({
|
| 515 |
+
/**
|
| 516 |
+
* Experimental, non-standard capabilities that the server supports.
|
| 517 |
+
*/
|
| 518 |
+
experimental: z.record(z.string(), AssertObjectSchema).optional(),
|
| 519 |
+
/**
|
| 520 |
+
* Present if the server supports sending log messages to the client.
|
| 521 |
+
*/
|
| 522 |
+
logging: AssertObjectSchema.optional(),
|
| 523 |
+
/**
|
| 524 |
+
* Present if the server supports sending completions to the client.
|
| 525 |
+
*/
|
| 526 |
+
completions: AssertObjectSchema.optional(),
|
| 527 |
+
/**
|
| 528 |
+
* Present if the server offers any prompt templates.
|
| 529 |
+
*/
|
| 530 |
+
prompts: z
|
| 531 |
+
.object({
|
| 532 |
+
/**
|
| 533 |
+
* Whether this server supports issuing notifications for changes to the prompt list.
|
| 534 |
+
*/
|
| 535 |
+
listChanged: z.boolean().optional()
|
| 536 |
+
})
|
| 537 |
+
.optional(),
|
| 538 |
+
/**
|
| 539 |
+
* Present if the server offers any resources to read.
|
| 540 |
+
*/
|
| 541 |
+
resources: z
|
| 542 |
+
.object({
|
| 543 |
+
/**
|
| 544 |
+
* Whether this server supports clients subscribing to resource updates.
|
| 545 |
+
*/
|
| 546 |
+
subscribe: z.boolean().optional(),
|
| 547 |
+
/**
|
| 548 |
+
* Whether this server supports issuing notifications for changes to the resource list.
|
| 549 |
+
*/
|
| 550 |
+
listChanged: z.boolean().optional()
|
| 551 |
+
})
|
| 552 |
+
.optional(),
|
| 553 |
+
/**
|
| 554 |
+
* Present if the server offers any tools to call.
|
| 555 |
+
*/
|
| 556 |
+
tools: z
|
| 557 |
+
.object({
|
| 558 |
+
/**
|
| 559 |
+
* Whether this server supports issuing notifications for changes to the tool list.
|
| 560 |
+
*/
|
| 561 |
+
listChanged: z.boolean().optional()
|
| 562 |
+
})
|
| 563 |
+
.optional(),
|
| 564 |
+
/**
|
| 565 |
+
* Present if the server supports task creation.
|
| 566 |
+
*/
|
| 567 |
+
tasks: exports.ServerTasksCapabilitySchema.optional(),
|
| 568 |
+
/**
|
| 569 |
+
* Extensions that the server supports. Keys are extension identifiers (vendor-prefix/extension-name).
|
| 570 |
+
*/
|
| 571 |
+
extensions: z.record(z.string(), AssertObjectSchema).optional()
|
| 572 |
+
});
|
| 573 |
+
/**
|
| 574 |
+
* After receiving an initialize request from the client, the server sends this response.
|
| 575 |
+
*/
|
| 576 |
+
exports.InitializeResultSchema = exports.ResultSchema.extend({
|
| 577 |
+
/**
|
| 578 |
+
* The version of the Model Context Protocol that the server wants to use. This may not match the version that the client requested. If the client cannot support this version, it MUST disconnect.
|
| 579 |
+
*/
|
| 580 |
+
protocolVersion: z.string(),
|
| 581 |
+
capabilities: exports.ServerCapabilitiesSchema,
|
| 582 |
+
serverInfo: exports.ImplementationSchema,
|
| 583 |
+
/**
|
| 584 |
+
* Instructions describing how to use the server and its features.
|
| 585 |
+
*
|
| 586 |
+
* This can be used by clients to improve the LLM's understanding of available tools, resources, etc. It can be thought of like a "hint" to the model. For example, this information MAY be added to the system prompt.
|
| 587 |
+
*/
|
| 588 |
+
instructions: z.string().optional()
|
| 589 |
+
});
|
| 590 |
+
/**
|
| 591 |
+
* This notification is sent from the client to the server after initialization has finished.
|
| 592 |
+
*/
|
| 593 |
+
exports.InitializedNotificationSchema = exports.NotificationSchema.extend({
|
| 594 |
+
method: z.literal('notifications/initialized'),
|
| 595 |
+
params: NotificationsParamsSchema.optional()
|
| 596 |
+
});
|
| 597 |
+
const isInitializedNotification = (value) => exports.InitializedNotificationSchema.safeParse(value).success;
|
| 598 |
+
exports.isInitializedNotification = isInitializedNotification;
|
| 599 |
+
/* Ping */
|
| 600 |
+
/**
|
| 601 |
+
* A ping, issued by either the server or the client, to check that the other party is still alive. The receiver must promptly respond, or else may be disconnected.
|
| 602 |
+
*/
|
| 603 |
+
exports.PingRequestSchema = exports.RequestSchema.extend({
|
| 604 |
+
method: z.literal('ping'),
|
| 605 |
+
params: BaseRequestParamsSchema.optional()
|
| 606 |
+
});
|
| 607 |
+
/* Progress notifications */
|
| 608 |
+
exports.ProgressSchema = z.object({
|
| 609 |
+
/**
|
| 610 |
+
* The progress thus far. This should increase every time progress is made, even if the total is unknown.
|
| 611 |
+
*/
|
| 612 |
+
progress: z.number(),
|
| 613 |
+
/**
|
| 614 |
+
* Total number of items to process (or total progress required), if known.
|
| 615 |
+
*/
|
| 616 |
+
total: z.optional(z.number()),
|
| 617 |
+
/**
|
| 618 |
+
* An optional message describing the current progress.
|
| 619 |
+
*/
|
| 620 |
+
message: z.optional(z.string())
|
| 621 |
+
});
|
| 622 |
+
exports.ProgressNotificationParamsSchema = z.object({
|
| 623 |
+
...NotificationsParamsSchema.shape,
|
| 624 |
+
...exports.ProgressSchema.shape,
|
| 625 |
+
/**
|
| 626 |
+
* The progress token which was given in the initial request, used to associate this notification with the request that is proceeding.
|
| 627 |
+
*/
|
| 628 |
+
progressToken: exports.ProgressTokenSchema
|
| 629 |
+
});
|
| 630 |
+
/**
|
| 631 |
+
* An out-of-band notification used to inform the receiver of a progress update for a long-running request.
|
| 632 |
+
*
|
| 633 |
+
* @category notifications/progress
|
| 634 |
+
*/
|
| 635 |
+
exports.ProgressNotificationSchema = exports.NotificationSchema.extend({
|
| 636 |
+
method: z.literal('notifications/progress'),
|
| 637 |
+
params: exports.ProgressNotificationParamsSchema
|
| 638 |
+
});
|
| 639 |
+
exports.PaginatedRequestParamsSchema = BaseRequestParamsSchema.extend({
|
| 640 |
+
/**
|
| 641 |
+
* An opaque token representing the current pagination position.
|
| 642 |
+
* If provided, the server should return results starting after this cursor.
|
| 643 |
+
*/
|
| 644 |
+
cursor: exports.CursorSchema.optional()
|
| 645 |
+
});
|
| 646 |
+
/* Pagination */
|
| 647 |
+
exports.PaginatedRequestSchema = exports.RequestSchema.extend({
|
| 648 |
+
params: exports.PaginatedRequestParamsSchema.optional()
|
| 649 |
+
});
|
| 650 |
+
exports.PaginatedResultSchema = exports.ResultSchema.extend({
|
| 651 |
+
/**
|
| 652 |
+
* An opaque token representing the pagination position after the last returned result.
|
| 653 |
+
* If present, there may be more results available.
|
| 654 |
+
*/
|
| 655 |
+
nextCursor: exports.CursorSchema.optional()
|
| 656 |
+
});
|
| 657 |
+
/**
|
| 658 |
+
* The status of a task.
|
| 659 |
+
* */
|
| 660 |
+
exports.TaskStatusSchema = z.enum(['working', 'input_required', 'completed', 'failed', 'cancelled']);
|
| 661 |
+
/* Tasks */
|
| 662 |
+
/**
|
| 663 |
+
* A pollable state object associated with a request.
|
| 664 |
+
*/
|
| 665 |
+
exports.TaskSchema = z.object({
|
| 666 |
+
taskId: z.string(),
|
| 667 |
+
status: exports.TaskStatusSchema,
|
| 668 |
+
/**
|
| 669 |
+
* Time in milliseconds to keep task results available after completion.
|
| 670 |
+
* If null, the task has unlimited lifetime until manually cleaned up.
|
| 671 |
+
*/
|
| 672 |
+
ttl: z.union([z.number(), z.null()]),
|
| 673 |
+
/**
|
| 674 |
+
* ISO 8601 timestamp when the task was created.
|
| 675 |
+
*/
|
| 676 |
+
createdAt: z.string(),
|
| 677 |
+
/**
|
| 678 |
+
* ISO 8601 timestamp when the task was last updated.
|
| 679 |
+
*/
|
| 680 |
+
lastUpdatedAt: z.string(),
|
| 681 |
+
pollInterval: z.optional(z.number()),
|
| 682 |
+
/**
|
| 683 |
+
* Optional diagnostic message for failed tasks or other status information.
|
| 684 |
+
*/
|
| 685 |
+
statusMessage: z.optional(z.string())
|
| 686 |
+
});
|
| 687 |
+
/**
|
| 688 |
+
* Result returned when a task is created, containing the task data wrapped in a task field.
|
| 689 |
+
*/
|
| 690 |
+
exports.CreateTaskResultSchema = exports.ResultSchema.extend({
|
| 691 |
+
task: exports.TaskSchema
|
| 692 |
+
});
|
| 693 |
+
/**
|
| 694 |
+
* Parameters for task status notification.
|
| 695 |
+
*/
|
| 696 |
+
exports.TaskStatusNotificationParamsSchema = NotificationsParamsSchema.merge(exports.TaskSchema);
|
| 697 |
+
/**
|
| 698 |
+
* A notification sent when a task's status changes.
|
| 699 |
+
*/
|
| 700 |
+
exports.TaskStatusNotificationSchema = exports.NotificationSchema.extend({
|
| 701 |
+
method: z.literal('notifications/tasks/status'),
|
| 702 |
+
params: exports.TaskStatusNotificationParamsSchema
|
| 703 |
+
});
|
| 704 |
+
/**
|
| 705 |
+
* A request to get the state of a specific task.
|
| 706 |
+
*/
|
| 707 |
+
exports.GetTaskRequestSchema = exports.RequestSchema.extend({
|
| 708 |
+
method: z.literal('tasks/get'),
|
| 709 |
+
params: BaseRequestParamsSchema.extend({
|
| 710 |
+
taskId: z.string()
|
| 711 |
+
})
|
| 712 |
+
});
|
| 713 |
+
/**
|
| 714 |
+
* The response to a tasks/get request.
|
| 715 |
+
*/
|
| 716 |
+
exports.GetTaskResultSchema = exports.ResultSchema.merge(exports.TaskSchema);
|
| 717 |
+
/**
|
| 718 |
+
* A request to get the result of a specific task.
|
| 719 |
+
*/
|
| 720 |
+
exports.GetTaskPayloadRequestSchema = exports.RequestSchema.extend({
|
| 721 |
+
method: z.literal('tasks/result'),
|
| 722 |
+
params: BaseRequestParamsSchema.extend({
|
| 723 |
+
taskId: z.string()
|
| 724 |
+
})
|
| 725 |
+
});
|
| 726 |
+
/**
|
| 727 |
+
* The response to a tasks/result request.
|
| 728 |
+
* The structure matches the result type of the original request.
|
| 729 |
+
* For example, a tools/call task would return the CallToolResult structure.
|
| 730 |
+
*
|
| 731 |
+
*/
|
| 732 |
+
exports.GetTaskPayloadResultSchema = exports.ResultSchema.loose();
|
| 733 |
+
/**
|
| 734 |
+
* A request to list tasks.
|
| 735 |
+
*/
|
| 736 |
+
exports.ListTasksRequestSchema = exports.PaginatedRequestSchema.extend({
|
| 737 |
+
method: z.literal('tasks/list')
|
| 738 |
+
});
|
| 739 |
+
/**
|
| 740 |
+
* The response to a tasks/list request.
|
| 741 |
+
*/
|
| 742 |
+
exports.ListTasksResultSchema = exports.PaginatedResultSchema.extend({
|
| 743 |
+
tasks: z.array(exports.TaskSchema)
|
| 744 |
+
});
|
| 745 |
+
/**
|
| 746 |
+
* A request to cancel a specific task.
|
| 747 |
+
*/
|
| 748 |
+
exports.CancelTaskRequestSchema = exports.RequestSchema.extend({
|
| 749 |
+
method: z.literal('tasks/cancel'),
|
| 750 |
+
params: BaseRequestParamsSchema.extend({
|
| 751 |
+
taskId: z.string()
|
| 752 |
+
})
|
| 753 |
+
});
|
| 754 |
+
/**
|
| 755 |
+
* The response to a tasks/cancel request.
|
| 756 |
+
*/
|
| 757 |
+
exports.CancelTaskResultSchema = exports.ResultSchema.merge(exports.TaskSchema);
|
| 758 |
+
/* Resources */
|
| 759 |
+
/**
|
| 760 |
+
* The contents of a specific resource or sub-resource.
|
| 761 |
+
*/
|
| 762 |
+
exports.ResourceContentsSchema = z.object({
|
| 763 |
+
/**
|
| 764 |
+
* The URI of this resource.
|
| 765 |
+
*/
|
| 766 |
+
uri: z.string(),
|
| 767 |
+
/**
|
| 768 |
+
* The MIME type of this resource, if known.
|
| 769 |
+
*/
|
| 770 |
+
mimeType: z.optional(z.string()),
|
| 771 |
+
/**
|
| 772 |
+
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
| 773 |
+
* for notes on _meta usage.
|
| 774 |
+
*/
|
| 775 |
+
_meta: z.record(z.string(), z.unknown()).optional()
|
| 776 |
+
});
|
| 777 |
+
exports.TextResourceContentsSchema = exports.ResourceContentsSchema.extend({
|
| 778 |
+
/**
|
| 779 |
+
* The text of the item. This must only be set if the item can actually be represented as text (not binary data).
|
| 780 |
+
*/
|
| 781 |
+
text: z.string()
|
| 782 |
+
});
|
| 783 |
+
/**
|
| 784 |
+
* A Zod schema for validating Base64 strings that is more performant and
|
| 785 |
+
* robust for very large inputs than the default regex-based check. It avoids
|
| 786 |
+
* stack overflows by using the native `atob` function for validation.
|
| 787 |
+
*/
|
| 788 |
+
const Base64Schema = z.string().refine(val => {
|
| 789 |
+
try {
|
| 790 |
+
// atob throws a DOMException if the string contains characters
|
| 791 |
+
// that are not part of the Base64 character set.
|
| 792 |
+
atob(val);
|
| 793 |
+
return true;
|
| 794 |
+
}
|
| 795 |
+
catch {
|
| 796 |
+
return false;
|
| 797 |
+
}
|
| 798 |
+
}, { message: 'Invalid Base64 string' });
|
| 799 |
+
exports.BlobResourceContentsSchema = exports.ResourceContentsSchema.extend({
|
| 800 |
+
/**
|
| 801 |
+
* A base64-encoded string representing the binary data of the item.
|
| 802 |
+
*/
|
| 803 |
+
blob: Base64Schema
|
| 804 |
+
});
|
| 805 |
+
/**
|
| 806 |
+
* The sender or recipient of messages and data in a conversation.
|
| 807 |
+
*/
|
| 808 |
+
exports.RoleSchema = z.enum(['user', 'assistant']);
|
| 809 |
+
/**
|
| 810 |
+
* Optional annotations providing clients additional context about a resource.
|
| 811 |
+
*/
|
| 812 |
+
exports.AnnotationsSchema = z.object({
|
| 813 |
+
/**
|
| 814 |
+
* Intended audience(s) for the resource.
|
| 815 |
+
*/
|
| 816 |
+
audience: z.array(exports.RoleSchema).optional(),
|
| 817 |
+
/**
|
| 818 |
+
* Importance hint for the resource, from 0 (least) to 1 (most).
|
| 819 |
+
*/
|
| 820 |
+
priority: z.number().min(0).max(1).optional(),
|
| 821 |
+
/**
|
| 822 |
+
* ISO 8601 timestamp for the most recent modification.
|
| 823 |
+
*/
|
| 824 |
+
lastModified: z.iso.datetime({ offset: true }).optional()
|
| 825 |
+
});
|
| 826 |
+
/**
|
| 827 |
+
* A known resource that the server is capable of reading.
|
| 828 |
+
*/
|
| 829 |
+
exports.ResourceSchema = z.object({
|
| 830 |
+
...exports.BaseMetadataSchema.shape,
|
| 831 |
+
...exports.IconsSchema.shape,
|
| 832 |
+
/**
|
| 833 |
+
* The URI of this resource.
|
| 834 |
+
*/
|
| 835 |
+
uri: z.string(),
|
| 836 |
+
/**
|
| 837 |
+
* A description of what this resource represents.
|
| 838 |
+
*
|
| 839 |
+
* This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model.
|
| 840 |
+
*/
|
| 841 |
+
description: z.optional(z.string()),
|
| 842 |
+
/**
|
| 843 |
+
* The MIME type of this resource, if known.
|
| 844 |
+
*/
|
| 845 |
+
mimeType: z.optional(z.string()),
|
| 846 |
+
/**
|
| 847 |
+
* The size of the raw resource content, in bytes (i.e., before base64 encoding or any tokenization), if known.
|
| 848 |
+
*
|
| 849 |
+
* This can be used by Hosts to display file sizes and estimate context window usage.
|
| 850 |
+
*/
|
| 851 |
+
size: z.optional(z.number()),
|
| 852 |
+
/**
|
| 853 |
+
* Optional annotations for the client.
|
| 854 |
+
*/
|
| 855 |
+
annotations: exports.AnnotationsSchema.optional(),
|
| 856 |
+
/**
|
| 857 |
+
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
| 858 |
+
* for notes on _meta usage.
|
| 859 |
+
*/
|
| 860 |
+
_meta: z.optional(z.looseObject({}))
|
| 861 |
+
});
|
| 862 |
+
/**
|
| 863 |
+
* A template description for resources available on the server.
|
| 864 |
+
*/
|
| 865 |
+
exports.ResourceTemplateSchema = z.object({
|
| 866 |
+
...exports.BaseMetadataSchema.shape,
|
| 867 |
+
...exports.IconsSchema.shape,
|
| 868 |
+
/**
|
| 869 |
+
* A URI template (according to RFC 6570) that can be used to construct resource URIs.
|
| 870 |
+
*/
|
| 871 |
+
uriTemplate: z.string(),
|
| 872 |
+
/**
|
| 873 |
+
* A description of what this template is for.
|
| 874 |
+
*
|
| 875 |
+
* This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model.
|
| 876 |
+
*/
|
| 877 |
+
description: z.optional(z.string()),
|
| 878 |
+
/**
|
| 879 |
+
* The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type.
|
| 880 |
+
*/
|
| 881 |
+
mimeType: z.optional(z.string()),
|
| 882 |
+
/**
|
| 883 |
+
* Optional annotations for the client.
|
| 884 |
+
*/
|
| 885 |
+
annotations: exports.AnnotationsSchema.optional(),
|
| 886 |
+
/**
|
| 887 |
+
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
| 888 |
+
* for notes on _meta usage.
|
| 889 |
+
*/
|
| 890 |
+
_meta: z.optional(z.looseObject({}))
|
| 891 |
+
});
|
| 892 |
+
/**
|
| 893 |
+
* Sent from the client to request a list of resources the server has.
|
| 894 |
+
*/
|
| 895 |
+
exports.ListResourcesRequestSchema = exports.PaginatedRequestSchema.extend({
|
| 896 |
+
method: z.literal('resources/list')
|
| 897 |
+
});
|
| 898 |
+
/**
|
| 899 |
+
* The server's response to a resources/list request from the client.
|
| 900 |
+
*/
|
| 901 |
+
exports.ListResourcesResultSchema = exports.PaginatedResultSchema.extend({
|
| 902 |
+
resources: z.array(exports.ResourceSchema)
|
| 903 |
+
});
|
| 904 |
+
/**
|
| 905 |
+
* Sent from the client to request a list of resource templates the server has.
|
| 906 |
+
*/
|
| 907 |
+
exports.ListResourceTemplatesRequestSchema = exports.PaginatedRequestSchema.extend({
|
| 908 |
+
method: z.literal('resources/templates/list')
|
| 909 |
+
});
|
| 910 |
+
/**
|
| 911 |
+
* The server's response to a resources/templates/list request from the client.
|
| 912 |
+
*/
|
| 913 |
+
exports.ListResourceTemplatesResultSchema = exports.PaginatedResultSchema.extend({
|
| 914 |
+
resourceTemplates: z.array(exports.ResourceTemplateSchema)
|
| 915 |
+
});
|
| 916 |
+
exports.ResourceRequestParamsSchema = BaseRequestParamsSchema.extend({
|
| 917 |
+
/**
|
| 918 |
+
* The URI of the resource to read. The URI can use any protocol; it is up to the server how to interpret it.
|
| 919 |
+
*
|
| 920 |
+
* @format uri
|
| 921 |
+
*/
|
| 922 |
+
uri: z.string()
|
| 923 |
+
});
|
| 924 |
+
/**
|
| 925 |
+
* Parameters for a `resources/read` request.
|
| 926 |
+
*/
|
| 927 |
+
exports.ReadResourceRequestParamsSchema = exports.ResourceRequestParamsSchema;
|
| 928 |
+
/**
|
| 929 |
+
* Sent from the client to the server, to read a specific resource URI.
|
| 930 |
+
*/
|
| 931 |
+
exports.ReadResourceRequestSchema = exports.RequestSchema.extend({
|
| 932 |
+
method: z.literal('resources/read'),
|
| 933 |
+
params: exports.ReadResourceRequestParamsSchema
|
| 934 |
+
});
|
| 935 |
+
/**
|
| 936 |
+
* The server's response to a resources/read request from the client.
|
| 937 |
+
*/
|
| 938 |
+
exports.ReadResourceResultSchema = exports.ResultSchema.extend({
|
| 939 |
+
contents: z.array(z.union([exports.TextResourceContentsSchema, exports.BlobResourceContentsSchema]))
|
| 940 |
+
});
|
| 941 |
+
/**
|
| 942 |
+
* An optional notification from the server to the client, informing it that the list of resources it can read from has changed. This may be issued by servers without any previous subscription from the client.
|
| 943 |
+
*/
|
| 944 |
+
exports.ResourceListChangedNotificationSchema = exports.NotificationSchema.extend({
|
| 945 |
+
method: z.literal('notifications/resources/list_changed'),
|
| 946 |
+
params: NotificationsParamsSchema.optional()
|
| 947 |
+
});
|
| 948 |
+
exports.SubscribeRequestParamsSchema = exports.ResourceRequestParamsSchema;
|
| 949 |
+
/**
|
| 950 |
+
* Sent from the client to request resources/updated notifications from the server whenever a particular resource changes.
|
| 951 |
+
*/
|
| 952 |
+
exports.SubscribeRequestSchema = exports.RequestSchema.extend({
|
| 953 |
+
method: z.literal('resources/subscribe'),
|
| 954 |
+
params: exports.SubscribeRequestParamsSchema
|
| 955 |
+
});
|
| 956 |
+
exports.UnsubscribeRequestParamsSchema = exports.ResourceRequestParamsSchema;
|
| 957 |
+
/**
|
| 958 |
+
* Sent from the client to request cancellation of resources/updated notifications from the server. This should follow a previous resources/subscribe request.
|
| 959 |
+
*/
|
| 960 |
+
exports.UnsubscribeRequestSchema = exports.RequestSchema.extend({
|
| 961 |
+
method: z.literal('resources/unsubscribe'),
|
| 962 |
+
params: exports.UnsubscribeRequestParamsSchema
|
| 963 |
+
});
|
| 964 |
+
/**
|
| 965 |
+
* Parameters for a `notifications/resources/updated` notification.
|
| 966 |
+
*/
|
| 967 |
+
exports.ResourceUpdatedNotificationParamsSchema = NotificationsParamsSchema.extend({
|
| 968 |
+
/**
|
| 969 |
+
* The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to.
|
| 970 |
+
*/
|
| 971 |
+
uri: z.string()
|
| 972 |
+
});
|
| 973 |
+
/**
|
| 974 |
+
* A notification from the server to the client, informing it that a resource has changed and may need to be read again. This should only be sent if the client previously sent a resources/subscribe request.
|
| 975 |
+
*/
|
| 976 |
+
exports.ResourceUpdatedNotificationSchema = exports.NotificationSchema.extend({
|
| 977 |
+
method: z.literal('notifications/resources/updated'),
|
| 978 |
+
params: exports.ResourceUpdatedNotificationParamsSchema
|
| 979 |
+
});
|
| 980 |
+
/* Prompts */
|
| 981 |
+
/**
|
| 982 |
+
* Describes an argument that a prompt can accept.
|
| 983 |
+
*/
|
| 984 |
+
exports.PromptArgumentSchema = z.object({
|
| 985 |
+
/**
|
| 986 |
+
* The name of the argument.
|
| 987 |
+
*/
|
| 988 |
+
name: z.string(),
|
| 989 |
+
/**
|
| 990 |
+
* A human-readable description of the argument.
|
| 991 |
+
*/
|
| 992 |
+
description: z.optional(z.string()),
|
| 993 |
+
/**
|
| 994 |
+
* Whether this argument must be provided.
|
| 995 |
+
*/
|
| 996 |
+
required: z.optional(z.boolean())
|
| 997 |
+
});
|
| 998 |
+
/**
|
| 999 |
+
* A prompt or prompt template that the server offers.
|
| 1000 |
+
*/
|
| 1001 |
+
exports.PromptSchema = z.object({
|
| 1002 |
+
...exports.BaseMetadataSchema.shape,
|
| 1003 |
+
...exports.IconsSchema.shape,
|
| 1004 |
+
/**
|
| 1005 |
+
* An optional description of what this prompt provides
|
| 1006 |
+
*/
|
| 1007 |
+
description: z.optional(z.string()),
|
| 1008 |
+
/**
|
| 1009 |
+
* A list of arguments to use for templating the prompt.
|
| 1010 |
+
*/
|
| 1011 |
+
arguments: z.optional(z.array(exports.PromptArgumentSchema)),
|
| 1012 |
+
/**
|
| 1013 |
+
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
| 1014 |
+
* for notes on _meta usage.
|
| 1015 |
+
*/
|
| 1016 |
+
_meta: z.optional(z.looseObject({}))
|
| 1017 |
+
});
|
| 1018 |
+
/**
|
| 1019 |
+
* Sent from the client to request a list of prompts and prompt templates the server has.
|
| 1020 |
+
*/
|
| 1021 |
+
exports.ListPromptsRequestSchema = exports.PaginatedRequestSchema.extend({
|
| 1022 |
+
method: z.literal('prompts/list')
|
| 1023 |
+
});
|
| 1024 |
+
/**
|
| 1025 |
+
* The server's response to a prompts/list request from the client.
|
| 1026 |
+
*/
|
| 1027 |
+
exports.ListPromptsResultSchema = exports.PaginatedResultSchema.extend({
|
| 1028 |
+
prompts: z.array(exports.PromptSchema)
|
| 1029 |
+
});
|
| 1030 |
+
/**
|
| 1031 |
+
* Parameters for a `prompts/get` request.
|
| 1032 |
+
*/
|
| 1033 |
+
exports.GetPromptRequestParamsSchema = BaseRequestParamsSchema.extend({
|
| 1034 |
+
/**
|
| 1035 |
+
* The name of the prompt or prompt template.
|
| 1036 |
+
*/
|
| 1037 |
+
name: z.string(),
|
| 1038 |
+
/**
|
| 1039 |
+
* Arguments to use for templating the prompt.
|
| 1040 |
+
*/
|
| 1041 |
+
arguments: z.record(z.string(), z.string()).optional()
|
| 1042 |
+
});
|
| 1043 |
+
/**
|
| 1044 |
+
* Used by the client to get a prompt provided by the server.
|
| 1045 |
+
*/
|
| 1046 |
+
exports.GetPromptRequestSchema = exports.RequestSchema.extend({
|
| 1047 |
+
method: z.literal('prompts/get'),
|
| 1048 |
+
params: exports.GetPromptRequestParamsSchema
|
| 1049 |
+
});
|
| 1050 |
+
/**
|
| 1051 |
+
* Text provided to or from an LLM.
|
| 1052 |
+
*/
|
| 1053 |
+
exports.TextContentSchema = z.object({
|
| 1054 |
+
type: z.literal('text'),
|
| 1055 |
+
/**
|
| 1056 |
+
* The text content of the message.
|
| 1057 |
+
*/
|
| 1058 |
+
text: z.string(),
|
| 1059 |
+
/**
|
| 1060 |
+
* Optional annotations for the client.
|
| 1061 |
+
*/
|
| 1062 |
+
annotations: exports.AnnotationsSchema.optional(),
|
| 1063 |
+
/**
|
| 1064 |
+
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
| 1065 |
+
* for notes on _meta usage.
|
| 1066 |
+
*/
|
| 1067 |
+
_meta: z.record(z.string(), z.unknown()).optional()
|
| 1068 |
+
});
|
| 1069 |
+
/**
|
| 1070 |
+
* An image provided to or from an LLM.
|
| 1071 |
+
*/
|
| 1072 |
+
exports.ImageContentSchema = z.object({
|
| 1073 |
+
type: z.literal('image'),
|
| 1074 |
+
/**
|
| 1075 |
+
* The base64-encoded image data.
|
| 1076 |
+
*/
|
| 1077 |
+
data: Base64Schema,
|
| 1078 |
+
/**
|
| 1079 |
+
* The MIME type of the image. Different providers may support different image types.
|
| 1080 |
+
*/
|
| 1081 |
+
mimeType: z.string(),
|
| 1082 |
+
/**
|
| 1083 |
+
* Optional annotations for the client.
|
| 1084 |
+
*/
|
| 1085 |
+
annotations: exports.AnnotationsSchema.optional(),
|
| 1086 |
+
/**
|
| 1087 |
+
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
| 1088 |
+
* for notes on _meta usage.
|
| 1089 |
+
*/
|
| 1090 |
+
_meta: z.record(z.string(), z.unknown()).optional()
|
| 1091 |
+
});
|
| 1092 |
+
/**
|
| 1093 |
+
* An Audio provided to or from an LLM.
|
| 1094 |
+
*/
|
| 1095 |
+
exports.AudioContentSchema = z.object({
|
| 1096 |
+
type: z.literal('audio'),
|
| 1097 |
+
/**
|
| 1098 |
+
* The base64-encoded audio data.
|
| 1099 |
+
*/
|
| 1100 |
+
data: Base64Schema,
|
| 1101 |
+
/**
|
| 1102 |
+
* The MIME type of the audio. Different providers may support different audio types.
|
| 1103 |
+
*/
|
| 1104 |
+
mimeType: z.string(),
|
| 1105 |
+
/**
|
| 1106 |
+
* Optional annotations for the client.
|
| 1107 |
+
*/
|
| 1108 |
+
annotations: exports.AnnotationsSchema.optional(),
|
| 1109 |
+
/**
|
| 1110 |
+
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
| 1111 |
+
* for notes on _meta usage.
|
| 1112 |
+
*/
|
| 1113 |
+
_meta: z.record(z.string(), z.unknown()).optional()
|
| 1114 |
+
});
|
| 1115 |
+
/**
|
| 1116 |
+
* A tool call request from an assistant (LLM).
|
| 1117 |
+
* Represents the assistant's request to use a tool.
|
| 1118 |
+
*/
|
| 1119 |
+
exports.ToolUseContentSchema = z.object({
|
| 1120 |
+
type: z.literal('tool_use'),
|
| 1121 |
+
/**
|
| 1122 |
+
* The name of the tool to invoke.
|
| 1123 |
+
* Must match a tool name from the request's tools array.
|
| 1124 |
+
*/
|
| 1125 |
+
name: z.string(),
|
| 1126 |
+
/**
|
| 1127 |
+
* Unique identifier for this tool call.
|
| 1128 |
+
* Used to correlate with ToolResultContent in subsequent messages.
|
| 1129 |
+
*/
|
| 1130 |
+
id: z.string(),
|
| 1131 |
+
/**
|
| 1132 |
+
* Arguments to pass to the tool.
|
| 1133 |
+
* Must conform to the tool's inputSchema.
|
| 1134 |
+
*/
|
| 1135 |
+
input: z.record(z.string(), z.unknown()),
|
| 1136 |
+
/**
|
| 1137 |
+
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
| 1138 |
+
* for notes on _meta usage.
|
| 1139 |
+
*/
|
| 1140 |
+
_meta: z.record(z.string(), z.unknown()).optional()
|
| 1141 |
+
});
|
| 1142 |
+
/**
|
| 1143 |
+
* The contents of a resource, embedded into a prompt or tool call result.
|
| 1144 |
+
*/
|
| 1145 |
+
exports.EmbeddedResourceSchema = z.object({
|
| 1146 |
+
type: z.literal('resource'),
|
| 1147 |
+
resource: z.union([exports.TextResourceContentsSchema, exports.BlobResourceContentsSchema]),
|
| 1148 |
+
/**
|
| 1149 |
+
* Optional annotations for the client.
|
| 1150 |
+
*/
|
| 1151 |
+
annotations: exports.AnnotationsSchema.optional(),
|
| 1152 |
+
/**
|
| 1153 |
+
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
| 1154 |
+
* for notes on _meta usage.
|
| 1155 |
+
*/
|
| 1156 |
+
_meta: z.record(z.string(), z.unknown()).optional()
|
| 1157 |
+
});
|
| 1158 |
+
/**
|
| 1159 |
+
* A resource that the server is capable of reading, included in a prompt or tool call result.
|
| 1160 |
+
*
|
| 1161 |
+
* Note: resource links returned by tools are not guaranteed to appear in the results of `resources/list` requests.
|
| 1162 |
+
*/
|
| 1163 |
+
exports.ResourceLinkSchema = exports.ResourceSchema.extend({
|
| 1164 |
+
type: z.literal('resource_link')
|
| 1165 |
+
});
|
| 1166 |
+
/**
|
| 1167 |
+
* A content block that can be used in prompts and tool results.
|
| 1168 |
+
*/
|
| 1169 |
+
exports.ContentBlockSchema = z.union([
|
| 1170 |
+
exports.TextContentSchema,
|
| 1171 |
+
exports.ImageContentSchema,
|
| 1172 |
+
exports.AudioContentSchema,
|
| 1173 |
+
exports.ResourceLinkSchema,
|
| 1174 |
+
exports.EmbeddedResourceSchema
|
| 1175 |
+
]);
|
| 1176 |
+
/**
|
| 1177 |
+
* Describes a message returned as part of a prompt.
|
| 1178 |
+
*/
|
| 1179 |
+
exports.PromptMessageSchema = z.object({
|
| 1180 |
+
role: exports.RoleSchema,
|
| 1181 |
+
content: exports.ContentBlockSchema
|
| 1182 |
+
});
|
| 1183 |
+
/**
|
| 1184 |
+
* The server's response to a prompts/get request from the client.
|
| 1185 |
+
*/
|
| 1186 |
+
exports.GetPromptResultSchema = exports.ResultSchema.extend({
|
| 1187 |
+
/**
|
| 1188 |
+
* An optional description for the prompt.
|
| 1189 |
+
*/
|
| 1190 |
+
description: z.string().optional(),
|
| 1191 |
+
messages: z.array(exports.PromptMessageSchema)
|
| 1192 |
+
});
|
| 1193 |
+
/**
|
| 1194 |
+
* An optional notification from the server to the client, informing it that the list of prompts it offers has changed. This may be issued by servers without any previous subscription from the client.
|
| 1195 |
+
*/
|
| 1196 |
+
exports.PromptListChangedNotificationSchema = exports.NotificationSchema.extend({
|
| 1197 |
+
method: z.literal('notifications/prompts/list_changed'),
|
| 1198 |
+
params: NotificationsParamsSchema.optional()
|
| 1199 |
+
});
|
| 1200 |
+
/* Tools */
|
| 1201 |
+
/**
|
| 1202 |
+
* Additional properties describing a Tool to clients.
|
| 1203 |
+
*
|
| 1204 |
+
* NOTE: all properties in ToolAnnotations are **hints**.
|
| 1205 |
+
* They are not guaranteed to provide a faithful description of
|
| 1206 |
+
* tool behavior (including descriptive properties like `title`).
|
| 1207 |
+
*
|
| 1208 |
+
* Clients should never make tool use decisions based on ToolAnnotations
|
| 1209 |
+
* received from untrusted servers.
|
| 1210 |
+
*/
|
| 1211 |
+
exports.ToolAnnotationsSchema = z.object({
|
| 1212 |
+
/**
|
| 1213 |
+
* A human-readable title for the tool.
|
| 1214 |
+
*/
|
| 1215 |
+
title: z.string().optional(),
|
| 1216 |
+
/**
|
| 1217 |
+
* If true, the tool does not modify its environment.
|
| 1218 |
+
*
|
| 1219 |
+
* Default: false
|
| 1220 |
+
*/
|
| 1221 |
+
readOnlyHint: z.boolean().optional(),
|
| 1222 |
+
/**
|
| 1223 |
+
* If true, the tool may perform destructive updates to its environment.
|
| 1224 |
+
* If false, the tool performs only additive updates.
|
| 1225 |
+
*
|
| 1226 |
+
* (This property is meaningful only when `readOnlyHint == false`)
|
| 1227 |
+
*
|
| 1228 |
+
* Default: true
|
| 1229 |
+
*/
|
| 1230 |
+
destructiveHint: z.boolean().optional(),
|
| 1231 |
+
/**
|
| 1232 |
+
* If true, calling the tool repeatedly with the same arguments
|
| 1233 |
+
* will have no additional effect on the its environment.
|
| 1234 |
+
*
|
| 1235 |
+
* (This property is meaningful only when `readOnlyHint == false`)
|
| 1236 |
+
*
|
| 1237 |
+
* Default: false
|
| 1238 |
+
*/
|
| 1239 |
+
idempotentHint: z.boolean().optional(),
|
| 1240 |
+
/**
|
| 1241 |
+
* If true, this tool may interact with an "open world" of external
|
| 1242 |
+
* entities. If false, the tool's domain of interaction is closed.
|
| 1243 |
+
* For example, the world of a web search tool is open, whereas that
|
| 1244 |
+
* of a memory tool is not.
|
| 1245 |
+
*
|
| 1246 |
+
* Default: true
|
| 1247 |
+
*/
|
| 1248 |
+
openWorldHint: z.boolean().optional()
|
| 1249 |
+
});
|
| 1250 |
+
/**
|
| 1251 |
+
* Execution-related properties for a tool.
|
| 1252 |
+
*/
|
| 1253 |
+
exports.ToolExecutionSchema = z.object({
|
| 1254 |
+
/**
|
| 1255 |
+
* Indicates the tool's preference for task-augmented execution.
|
| 1256 |
+
* - "required": Clients MUST invoke the tool as a task
|
| 1257 |
+
* - "optional": Clients MAY invoke the tool as a task or normal request
|
| 1258 |
+
* - "forbidden": Clients MUST NOT attempt to invoke the tool as a task
|
| 1259 |
+
*
|
| 1260 |
+
* If not present, defaults to "forbidden".
|
| 1261 |
+
*/
|
| 1262 |
+
taskSupport: z.enum(['required', 'optional', 'forbidden']).optional()
|
| 1263 |
+
});
|
| 1264 |
+
/**
|
| 1265 |
+
* Definition for a tool the client can call.
|
| 1266 |
+
*/
|
| 1267 |
+
exports.ToolSchema = z.object({
|
| 1268 |
+
...exports.BaseMetadataSchema.shape,
|
| 1269 |
+
...exports.IconsSchema.shape,
|
| 1270 |
+
/**
|
| 1271 |
+
* A human-readable description of the tool.
|
| 1272 |
+
*/
|
| 1273 |
+
description: z.string().optional(),
|
| 1274 |
+
/**
|
| 1275 |
+
* A JSON Schema 2020-12 object defining the expected parameters for the tool.
|
| 1276 |
+
* Must have type: 'object' at the root level per MCP spec.
|
| 1277 |
+
*/
|
| 1278 |
+
inputSchema: z
|
| 1279 |
+
.object({
|
| 1280 |
+
type: z.literal('object'),
|
| 1281 |
+
properties: z.record(z.string(), AssertObjectSchema).optional(),
|
| 1282 |
+
required: z.array(z.string()).optional()
|
| 1283 |
+
})
|
| 1284 |
+
.catchall(z.unknown()),
|
| 1285 |
+
/**
|
| 1286 |
+
* An optional JSON Schema 2020-12 object defining the structure of the tool's output
|
| 1287 |
+
* returned in the structuredContent field of a CallToolResult.
|
| 1288 |
+
* Must have type: 'object' at the root level per MCP spec.
|
| 1289 |
+
*/
|
| 1290 |
+
outputSchema: z
|
| 1291 |
+
.object({
|
| 1292 |
+
type: z.literal('object'),
|
| 1293 |
+
properties: z.record(z.string(), AssertObjectSchema).optional(),
|
| 1294 |
+
required: z.array(z.string()).optional()
|
| 1295 |
+
})
|
| 1296 |
+
.catchall(z.unknown())
|
| 1297 |
+
.optional(),
|
| 1298 |
+
/**
|
| 1299 |
+
* Optional additional tool information.
|
| 1300 |
+
*/
|
| 1301 |
+
annotations: exports.ToolAnnotationsSchema.optional(),
|
| 1302 |
+
/**
|
| 1303 |
+
* Execution-related properties for this tool.
|
| 1304 |
+
*/
|
| 1305 |
+
execution: exports.ToolExecutionSchema.optional(),
|
| 1306 |
+
/**
|
| 1307 |
+
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
| 1308 |
+
* for notes on _meta usage.
|
| 1309 |
+
*/
|
| 1310 |
+
_meta: z.record(z.string(), z.unknown()).optional()
|
| 1311 |
+
});
|
| 1312 |
+
/**
|
| 1313 |
+
* Sent from the client to request a list of tools the server has.
|
| 1314 |
+
*/
|
| 1315 |
+
exports.ListToolsRequestSchema = exports.PaginatedRequestSchema.extend({
|
| 1316 |
+
method: z.literal('tools/list')
|
| 1317 |
+
});
|
| 1318 |
+
/**
|
| 1319 |
+
* The server's response to a tools/list request from the client.
|
| 1320 |
+
*/
|
| 1321 |
+
exports.ListToolsResultSchema = exports.PaginatedResultSchema.extend({
|
| 1322 |
+
tools: z.array(exports.ToolSchema)
|
| 1323 |
+
});
|
| 1324 |
+
/**
|
| 1325 |
+
* The server's response to a tool call.
|
| 1326 |
+
*/
|
| 1327 |
+
exports.CallToolResultSchema = exports.ResultSchema.extend({
|
| 1328 |
+
/**
|
| 1329 |
+
* A list of content objects that represent the result of the tool call.
|
| 1330 |
+
*
|
| 1331 |
+
* If the Tool does not define an outputSchema, this field MUST be present in the result.
|
| 1332 |
+
* For backwards compatibility, this field is always present, but it may be empty.
|
| 1333 |
+
*/
|
| 1334 |
+
content: z.array(exports.ContentBlockSchema).default([]),
|
| 1335 |
+
/**
|
| 1336 |
+
* An object containing structured tool output.
|
| 1337 |
+
*
|
| 1338 |
+
* If the Tool defines an outputSchema, this field MUST be present in the result, and contain a JSON object that matches the schema.
|
| 1339 |
+
*/
|
| 1340 |
+
structuredContent: z.record(z.string(), z.unknown()).optional(),
|
| 1341 |
+
/**
|
| 1342 |
+
* Whether the tool call ended in an error.
|
| 1343 |
+
*
|
| 1344 |
+
* If not set, this is assumed to be false (the call was successful).
|
| 1345 |
+
*
|
| 1346 |
+
* Any errors that originate from the tool SHOULD be reported inside the result
|
| 1347 |
+
* object, with `isError` set to true, _not_ as an MCP protocol-level error
|
| 1348 |
+
* response. Otherwise, the LLM would not be able to see that an error occurred
|
| 1349 |
+
* and self-correct.
|
| 1350 |
+
*
|
| 1351 |
+
* However, any errors in _finding_ the tool, an error indicating that the
|
| 1352 |
+
* server does not support tool calls, or any other exceptional conditions,
|
| 1353 |
+
* should be reported as an MCP error response.
|
| 1354 |
+
*/
|
| 1355 |
+
isError: z.boolean().optional()
|
| 1356 |
+
});
|
| 1357 |
+
/**
|
| 1358 |
+
* CallToolResultSchema extended with backwards compatibility to protocol version 2024-10-07.
|
| 1359 |
+
*/
|
| 1360 |
+
exports.CompatibilityCallToolResultSchema = exports.CallToolResultSchema.or(exports.ResultSchema.extend({
|
| 1361 |
+
toolResult: z.unknown()
|
| 1362 |
+
}));
|
| 1363 |
+
/**
|
| 1364 |
+
* Parameters for a `tools/call` request.
|
| 1365 |
+
*/
|
| 1366 |
+
exports.CallToolRequestParamsSchema = exports.TaskAugmentedRequestParamsSchema.extend({
|
| 1367 |
+
/**
|
| 1368 |
+
* The name of the tool to call.
|
| 1369 |
+
*/
|
| 1370 |
+
name: z.string(),
|
| 1371 |
+
/**
|
| 1372 |
+
* Arguments to pass to the tool.
|
| 1373 |
+
*/
|
| 1374 |
+
arguments: z.record(z.string(), z.unknown()).optional()
|
| 1375 |
+
});
|
| 1376 |
+
/**
|
| 1377 |
+
* Used by the client to invoke a tool provided by the server.
|
| 1378 |
+
*/
|
| 1379 |
+
exports.CallToolRequestSchema = exports.RequestSchema.extend({
|
| 1380 |
+
method: z.literal('tools/call'),
|
| 1381 |
+
params: exports.CallToolRequestParamsSchema
|
| 1382 |
+
});
|
| 1383 |
+
/**
|
| 1384 |
+
* An optional notification from the server to the client, informing it that the list of tools it offers has changed. This may be issued by servers without any previous subscription from the client.
|
| 1385 |
+
*/
|
| 1386 |
+
exports.ToolListChangedNotificationSchema = exports.NotificationSchema.extend({
|
| 1387 |
+
method: z.literal('notifications/tools/list_changed'),
|
| 1388 |
+
params: NotificationsParamsSchema.optional()
|
| 1389 |
+
});
|
| 1390 |
+
/**
|
| 1391 |
+
* Base schema for list changed subscription options (without callback).
|
| 1392 |
+
* Used internally for Zod validation of autoRefresh and debounceMs.
|
| 1393 |
+
*/
|
| 1394 |
+
exports.ListChangedOptionsBaseSchema = z.object({
|
| 1395 |
+
/**
|
| 1396 |
+
* If true, the list will be refreshed automatically when a list changed notification is received.
|
| 1397 |
+
* The callback will be called with the updated list.
|
| 1398 |
+
*
|
| 1399 |
+
* If false, the callback will be called with null items, allowing manual refresh.
|
| 1400 |
+
*
|
| 1401 |
+
* @default true
|
| 1402 |
+
*/
|
| 1403 |
+
autoRefresh: z.boolean().default(true),
|
| 1404 |
+
/**
|
| 1405 |
+
* Debounce time in milliseconds for list changed notification processing.
|
| 1406 |
+
*
|
| 1407 |
+
* Multiple notifications received within this timeframe will only trigger one refresh.
|
| 1408 |
+
* Set to 0 to disable debouncing.
|
| 1409 |
+
*
|
| 1410 |
+
* @default 300
|
| 1411 |
+
*/
|
| 1412 |
+
debounceMs: z.number().int().nonnegative().default(300)
|
| 1413 |
+
});
|
| 1414 |
+
/* Logging */
|
| 1415 |
+
/**
|
| 1416 |
+
* The severity of a log message.
|
| 1417 |
+
*/
|
| 1418 |
+
exports.LoggingLevelSchema = z.enum(['debug', 'info', 'notice', 'warning', 'error', 'critical', 'alert', 'emergency']);
|
| 1419 |
+
/**
|
| 1420 |
+
* Parameters for a `logging/setLevel` request.
|
| 1421 |
+
*/
|
| 1422 |
+
exports.SetLevelRequestParamsSchema = BaseRequestParamsSchema.extend({
|
| 1423 |
+
/**
|
| 1424 |
+
* The level of logging that the client wants to receive from the server. The server should send all logs at this level and higher (i.e., more severe) to the client as notifications/logging/message.
|
| 1425 |
+
*/
|
| 1426 |
+
level: exports.LoggingLevelSchema
|
| 1427 |
+
});
|
| 1428 |
+
/**
|
| 1429 |
+
* A request from the client to the server, to enable or adjust logging.
|
| 1430 |
+
*/
|
| 1431 |
+
exports.SetLevelRequestSchema = exports.RequestSchema.extend({
|
| 1432 |
+
method: z.literal('logging/setLevel'),
|
| 1433 |
+
params: exports.SetLevelRequestParamsSchema
|
| 1434 |
+
});
|
| 1435 |
+
/**
|
| 1436 |
+
* Parameters for a `notifications/message` notification.
|
| 1437 |
+
*/
|
| 1438 |
+
exports.LoggingMessageNotificationParamsSchema = NotificationsParamsSchema.extend({
|
| 1439 |
+
/**
|
| 1440 |
+
* The severity of this log message.
|
| 1441 |
+
*/
|
| 1442 |
+
level: exports.LoggingLevelSchema,
|
| 1443 |
+
/**
|
| 1444 |
+
* An optional name of the logger issuing this message.
|
| 1445 |
+
*/
|
| 1446 |
+
logger: z.string().optional(),
|
| 1447 |
+
/**
|
| 1448 |
+
* The data to be logged, such as a string message or an object. Any JSON serializable type is allowed here.
|
| 1449 |
+
*/
|
| 1450 |
+
data: z.unknown()
|
| 1451 |
+
});
|
| 1452 |
+
/**
|
| 1453 |
+
* Notification of a log message passed from server to client. If no logging/setLevel request has been sent from the client, the server MAY decide which messages to send automatically.
|
| 1454 |
+
*/
|
| 1455 |
+
exports.LoggingMessageNotificationSchema = exports.NotificationSchema.extend({
|
| 1456 |
+
method: z.literal('notifications/message'),
|
| 1457 |
+
params: exports.LoggingMessageNotificationParamsSchema
|
| 1458 |
+
});
|
| 1459 |
+
/* Sampling */
|
| 1460 |
+
/**
|
| 1461 |
+
* Hints to use for model selection.
|
| 1462 |
+
*/
|
| 1463 |
+
exports.ModelHintSchema = z.object({
|
| 1464 |
+
/**
|
| 1465 |
+
* A hint for a model name.
|
| 1466 |
+
*/
|
| 1467 |
+
name: z.string().optional()
|
| 1468 |
+
});
|
| 1469 |
+
/**
|
| 1470 |
+
* The server's preferences for model selection, requested of the client during sampling.
|
| 1471 |
+
*/
|
| 1472 |
+
exports.ModelPreferencesSchema = z.object({
|
| 1473 |
+
/**
|
| 1474 |
+
* Optional hints to use for model selection.
|
| 1475 |
+
*/
|
| 1476 |
+
hints: z.array(exports.ModelHintSchema).optional(),
|
| 1477 |
+
/**
|
| 1478 |
+
* How much to prioritize cost when selecting a model.
|
| 1479 |
+
*/
|
| 1480 |
+
costPriority: z.number().min(0).max(1).optional(),
|
| 1481 |
+
/**
|
| 1482 |
+
* How much to prioritize sampling speed (latency) when selecting a model.
|
| 1483 |
+
*/
|
| 1484 |
+
speedPriority: z.number().min(0).max(1).optional(),
|
| 1485 |
+
/**
|
| 1486 |
+
* How much to prioritize intelligence and capabilities when selecting a model.
|
| 1487 |
+
*/
|
| 1488 |
+
intelligencePriority: z.number().min(0).max(1).optional()
|
| 1489 |
+
});
|
| 1490 |
+
/**
|
| 1491 |
+
* Controls tool usage behavior in sampling requests.
|
| 1492 |
+
*/
|
| 1493 |
+
exports.ToolChoiceSchema = z.object({
|
| 1494 |
+
/**
|
| 1495 |
+
* Controls when tools are used:
|
| 1496 |
+
* - "auto": Model decides whether to use tools (default)
|
| 1497 |
+
* - "required": Model MUST use at least one tool before completing
|
| 1498 |
+
* - "none": Model MUST NOT use any tools
|
| 1499 |
+
*/
|
| 1500 |
+
mode: z.enum(['auto', 'required', 'none']).optional()
|
| 1501 |
+
});
|
| 1502 |
+
/**
|
| 1503 |
+
* The result of a tool execution, provided by the user (server).
|
| 1504 |
+
* Represents the outcome of invoking a tool requested via ToolUseContent.
|
| 1505 |
+
*/
|
| 1506 |
+
exports.ToolResultContentSchema = z.object({
|
| 1507 |
+
type: z.literal('tool_result'),
|
| 1508 |
+
toolUseId: z.string().describe('The unique identifier for the corresponding tool call.'),
|
| 1509 |
+
content: z.array(exports.ContentBlockSchema).default([]),
|
| 1510 |
+
structuredContent: z.object({}).loose().optional(),
|
| 1511 |
+
isError: z.boolean().optional(),
|
| 1512 |
+
/**
|
| 1513 |
+
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
| 1514 |
+
* for notes on _meta usage.
|
| 1515 |
+
*/
|
| 1516 |
+
_meta: z.record(z.string(), z.unknown()).optional()
|
| 1517 |
+
});
|
| 1518 |
+
/**
|
| 1519 |
+
* Basic content types for sampling responses (without tool use).
|
| 1520 |
+
* Used for backwards-compatible CreateMessageResult when tools are not used.
|
| 1521 |
+
*/
|
| 1522 |
+
exports.SamplingContentSchema = z.discriminatedUnion('type', [exports.TextContentSchema, exports.ImageContentSchema, exports.AudioContentSchema]);
|
| 1523 |
+
/**
|
| 1524 |
+
* Content block types allowed in sampling messages.
|
| 1525 |
+
* This includes text, image, audio, tool use requests, and tool results.
|
| 1526 |
+
*/
|
| 1527 |
+
exports.SamplingMessageContentBlockSchema = z.discriminatedUnion('type', [
|
| 1528 |
+
exports.TextContentSchema,
|
| 1529 |
+
exports.ImageContentSchema,
|
| 1530 |
+
exports.AudioContentSchema,
|
| 1531 |
+
exports.ToolUseContentSchema,
|
| 1532 |
+
exports.ToolResultContentSchema
|
| 1533 |
+
]);
|
| 1534 |
+
/**
|
| 1535 |
+
* Describes a message issued to or received from an LLM API.
|
| 1536 |
+
*/
|
| 1537 |
+
exports.SamplingMessageSchema = z.object({
|
| 1538 |
+
role: exports.RoleSchema,
|
| 1539 |
+
content: z.union([exports.SamplingMessageContentBlockSchema, z.array(exports.SamplingMessageContentBlockSchema)]),
|
| 1540 |
+
/**
|
| 1541 |
+
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
| 1542 |
+
* for notes on _meta usage.
|
| 1543 |
+
*/
|
| 1544 |
+
_meta: z.record(z.string(), z.unknown()).optional()
|
| 1545 |
+
});
|
| 1546 |
+
/**
|
| 1547 |
+
* Parameters for a `sampling/createMessage` request.
|
| 1548 |
+
*/
|
| 1549 |
+
exports.CreateMessageRequestParamsSchema = exports.TaskAugmentedRequestParamsSchema.extend({
|
| 1550 |
+
messages: z.array(exports.SamplingMessageSchema),
|
| 1551 |
+
/**
|
| 1552 |
+
* The server's preferences for which model to select. The client MAY modify or omit this request.
|
| 1553 |
+
*/
|
| 1554 |
+
modelPreferences: exports.ModelPreferencesSchema.optional(),
|
| 1555 |
+
/**
|
| 1556 |
+
* An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt.
|
| 1557 |
+
*/
|
| 1558 |
+
systemPrompt: z.string().optional(),
|
| 1559 |
+
/**
|
| 1560 |
+
* A request to include context from one or more MCP servers (including the caller), to be attached to the prompt.
|
| 1561 |
+
* The client MAY ignore this request.
|
| 1562 |
+
*
|
| 1563 |
+
* Default is "none". Values "thisServer" and "allServers" are soft-deprecated. Servers SHOULD only use these values if the client
|
| 1564 |
+
* declares ClientCapabilities.sampling.context. These values may be removed in future spec releases.
|
| 1565 |
+
*/
|
| 1566 |
+
includeContext: z.enum(['none', 'thisServer', 'allServers']).optional(),
|
| 1567 |
+
temperature: z.number().optional(),
|
| 1568 |
+
/**
|
| 1569 |
+
* The requested maximum number of tokens to sample (to prevent runaway completions).
|
| 1570 |
+
*
|
| 1571 |
+
* The client MAY choose to sample fewer tokens than the requested maximum.
|
| 1572 |
+
*/
|
| 1573 |
+
maxTokens: z.number().int(),
|
| 1574 |
+
stopSequences: z.array(z.string()).optional(),
|
| 1575 |
+
/**
|
| 1576 |
+
* Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific.
|
| 1577 |
+
*/
|
| 1578 |
+
metadata: AssertObjectSchema.optional(),
|
| 1579 |
+
/**
|
| 1580 |
+
* Tools that the model may use during generation.
|
| 1581 |
+
* The client MUST return an error if this field is provided but ClientCapabilities.sampling.tools is not declared.
|
| 1582 |
+
*/
|
| 1583 |
+
tools: z.array(exports.ToolSchema).optional(),
|
| 1584 |
+
/**
|
| 1585 |
+
* Controls how the model uses tools.
|
| 1586 |
+
* The client MUST return an error if this field is provided but ClientCapabilities.sampling.tools is not declared.
|
| 1587 |
+
* Default is `{ mode: "auto" }`.
|
| 1588 |
+
*/
|
| 1589 |
+
toolChoice: exports.ToolChoiceSchema.optional()
|
| 1590 |
+
});
|
| 1591 |
+
/**
|
| 1592 |
+
* A request from the server to sample an LLM via the client. The client has full discretion over which model to select. The client should also inform the user before beginning sampling, to allow them to inspect the request (human in the loop) and decide whether to approve it.
|
| 1593 |
+
*/
|
| 1594 |
+
exports.CreateMessageRequestSchema = exports.RequestSchema.extend({
|
| 1595 |
+
method: z.literal('sampling/createMessage'),
|
| 1596 |
+
params: exports.CreateMessageRequestParamsSchema
|
| 1597 |
+
});
|
| 1598 |
+
/**
|
| 1599 |
+
* The client's response to a sampling/create_message request from the server.
|
| 1600 |
+
* This is the backwards-compatible version that returns single content (no arrays).
|
| 1601 |
+
* Used when the request does not include tools.
|
| 1602 |
+
*/
|
| 1603 |
+
exports.CreateMessageResultSchema = exports.ResultSchema.extend({
|
| 1604 |
+
/**
|
| 1605 |
+
* The name of the model that generated the message.
|
| 1606 |
+
*/
|
| 1607 |
+
model: z.string(),
|
| 1608 |
+
/**
|
| 1609 |
+
* The reason why sampling stopped, if known.
|
| 1610 |
+
*
|
| 1611 |
+
* Standard values:
|
| 1612 |
+
* - "endTurn": Natural end of the assistant's turn
|
| 1613 |
+
* - "stopSequence": A stop sequence was encountered
|
| 1614 |
+
* - "maxTokens": Maximum token limit was reached
|
| 1615 |
+
*
|
| 1616 |
+
* This field is an open string to allow for provider-specific stop reasons.
|
| 1617 |
+
*/
|
| 1618 |
+
stopReason: z.optional(z.enum(['endTurn', 'stopSequence', 'maxTokens']).or(z.string())),
|
| 1619 |
+
role: exports.RoleSchema,
|
| 1620 |
+
/**
|
| 1621 |
+
* Response content. Single content block (text, image, or audio).
|
| 1622 |
+
*/
|
| 1623 |
+
content: exports.SamplingContentSchema
|
| 1624 |
+
});
|
| 1625 |
+
/**
|
| 1626 |
+
* The client's response to a sampling/create_message request when tools were provided.
|
| 1627 |
+
* This version supports array content for tool use flows.
|
| 1628 |
+
*/
|
| 1629 |
+
exports.CreateMessageResultWithToolsSchema = exports.ResultSchema.extend({
|
| 1630 |
+
/**
|
| 1631 |
+
* The name of the model that generated the message.
|
| 1632 |
+
*/
|
| 1633 |
+
model: z.string(),
|
| 1634 |
+
/**
|
| 1635 |
+
* The reason why sampling stopped, if known.
|
| 1636 |
+
*
|
| 1637 |
+
* Standard values:
|
| 1638 |
+
* - "endTurn": Natural end of the assistant's turn
|
| 1639 |
+
* - "stopSequence": A stop sequence was encountered
|
| 1640 |
+
* - "maxTokens": Maximum token limit was reached
|
| 1641 |
+
* - "toolUse": The model wants to use one or more tools
|
| 1642 |
+
*
|
| 1643 |
+
* This field is an open string to allow for provider-specific stop reasons.
|
| 1644 |
+
*/
|
| 1645 |
+
stopReason: z.optional(z.enum(['endTurn', 'stopSequence', 'maxTokens', 'toolUse']).or(z.string())),
|
| 1646 |
+
role: exports.RoleSchema,
|
| 1647 |
+
/**
|
| 1648 |
+
* Response content. May be a single block or array. May include ToolUseContent if stopReason is "toolUse".
|
| 1649 |
+
*/
|
| 1650 |
+
content: z.union([exports.SamplingMessageContentBlockSchema, z.array(exports.SamplingMessageContentBlockSchema)])
|
| 1651 |
+
});
|
| 1652 |
+
/* Elicitation */
|
| 1653 |
+
/**
|
| 1654 |
+
* Primitive schema definition for boolean fields.
|
| 1655 |
+
*/
|
| 1656 |
+
exports.BooleanSchemaSchema = z.object({
|
| 1657 |
+
type: z.literal('boolean'),
|
| 1658 |
+
title: z.string().optional(),
|
| 1659 |
+
description: z.string().optional(),
|
| 1660 |
+
default: z.boolean().optional()
|
| 1661 |
+
});
|
| 1662 |
+
/**
|
| 1663 |
+
* Primitive schema definition for string fields.
|
| 1664 |
+
*/
|
| 1665 |
+
exports.StringSchemaSchema = z.object({
|
| 1666 |
+
type: z.literal('string'),
|
| 1667 |
+
title: z.string().optional(),
|
| 1668 |
+
description: z.string().optional(),
|
| 1669 |
+
minLength: z.number().optional(),
|
| 1670 |
+
maxLength: z.number().optional(),
|
| 1671 |
+
format: z.enum(['email', 'uri', 'date', 'date-time']).optional(),
|
| 1672 |
+
default: z.string().optional()
|
| 1673 |
+
});
|
| 1674 |
+
/**
|
| 1675 |
+
* Primitive schema definition for number fields.
|
| 1676 |
+
*/
|
| 1677 |
+
exports.NumberSchemaSchema = z.object({
|
| 1678 |
+
type: z.enum(['number', 'integer']),
|
| 1679 |
+
title: z.string().optional(),
|
| 1680 |
+
description: z.string().optional(),
|
| 1681 |
+
minimum: z.number().optional(),
|
| 1682 |
+
maximum: z.number().optional(),
|
| 1683 |
+
default: z.number().optional()
|
| 1684 |
+
});
|
| 1685 |
+
/**
|
| 1686 |
+
* Schema for single-selection enumeration without display titles for options.
|
| 1687 |
+
*/
|
| 1688 |
+
exports.UntitledSingleSelectEnumSchemaSchema = z.object({
|
| 1689 |
+
type: z.literal('string'),
|
| 1690 |
+
title: z.string().optional(),
|
| 1691 |
+
description: z.string().optional(),
|
| 1692 |
+
enum: z.array(z.string()),
|
| 1693 |
+
default: z.string().optional()
|
| 1694 |
+
});
|
| 1695 |
+
/**
|
| 1696 |
+
* Schema for single-selection enumeration with display titles for each option.
|
| 1697 |
+
*/
|
| 1698 |
+
exports.TitledSingleSelectEnumSchemaSchema = z.object({
|
| 1699 |
+
type: z.literal('string'),
|
| 1700 |
+
title: z.string().optional(),
|
| 1701 |
+
description: z.string().optional(),
|
| 1702 |
+
oneOf: z.array(z.object({
|
| 1703 |
+
const: z.string(),
|
| 1704 |
+
title: z.string()
|
| 1705 |
+
})),
|
| 1706 |
+
default: z.string().optional()
|
| 1707 |
+
});
|
| 1708 |
+
/**
|
| 1709 |
+
* Use TitledSingleSelectEnumSchema instead.
|
| 1710 |
+
* This interface will be removed in a future version.
|
| 1711 |
+
*/
|
| 1712 |
+
exports.LegacyTitledEnumSchemaSchema = z.object({
|
| 1713 |
+
type: z.literal('string'),
|
| 1714 |
+
title: z.string().optional(),
|
| 1715 |
+
description: z.string().optional(),
|
| 1716 |
+
enum: z.array(z.string()),
|
| 1717 |
+
enumNames: z.array(z.string()).optional(),
|
| 1718 |
+
default: z.string().optional()
|
| 1719 |
+
});
|
| 1720 |
+
// Combined single selection enumeration
|
| 1721 |
+
exports.SingleSelectEnumSchemaSchema = z.union([exports.UntitledSingleSelectEnumSchemaSchema, exports.TitledSingleSelectEnumSchemaSchema]);
|
| 1722 |
+
/**
|
| 1723 |
+
* Schema for multiple-selection enumeration without display titles for options.
|
| 1724 |
+
*/
|
| 1725 |
+
exports.UntitledMultiSelectEnumSchemaSchema = z.object({
|
| 1726 |
+
type: z.literal('array'),
|
| 1727 |
+
title: z.string().optional(),
|
| 1728 |
+
description: z.string().optional(),
|
| 1729 |
+
minItems: z.number().optional(),
|
| 1730 |
+
maxItems: z.number().optional(),
|
| 1731 |
+
items: z.object({
|
| 1732 |
+
type: z.literal('string'),
|
| 1733 |
+
enum: z.array(z.string())
|
| 1734 |
+
}),
|
| 1735 |
+
default: z.array(z.string()).optional()
|
| 1736 |
+
});
|
| 1737 |
+
/**
|
| 1738 |
+
* Schema for multiple-selection enumeration with display titles for each option.
|
| 1739 |
+
*/
|
| 1740 |
+
exports.TitledMultiSelectEnumSchemaSchema = z.object({
|
| 1741 |
+
type: z.literal('array'),
|
| 1742 |
+
title: z.string().optional(),
|
| 1743 |
+
description: z.string().optional(),
|
| 1744 |
+
minItems: z.number().optional(),
|
| 1745 |
+
maxItems: z.number().optional(),
|
| 1746 |
+
items: z.object({
|
| 1747 |
+
anyOf: z.array(z.object({
|
| 1748 |
+
const: z.string(),
|
| 1749 |
+
title: z.string()
|
| 1750 |
+
}))
|
| 1751 |
+
}),
|
| 1752 |
+
default: z.array(z.string()).optional()
|
| 1753 |
+
});
|
| 1754 |
+
/**
|
| 1755 |
+
* Combined schema for multiple-selection enumeration
|
| 1756 |
+
*/
|
| 1757 |
+
exports.MultiSelectEnumSchemaSchema = z.union([exports.UntitledMultiSelectEnumSchemaSchema, exports.TitledMultiSelectEnumSchemaSchema]);
|
| 1758 |
+
/**
|
| 1759 |
+
* Primitive schema definition for enum fields.
|
| 1760 |
+
*/
|
| 1761 |
+
exports.EnumSchemaSchema = z.union([exports.LegacyTitledEnumSchemaSchema, exports.SingleSelectEnumSchemaSchema, exports.MultiSelectEnumSchemaSchema]);
|
| 1762 |
+
/**
|
| 1763 |
+
* Union of all primitive schema definitions.
|
| 1764 |
+
*/
|
| 1765 |
+
exports.PrimitiveSchemaDefinitionSchema = z.union([exports.EnumSchemaSchema, exports.BooleanSchemaSchema, exports.StringSchemaSchema, exports.NumberSchemaSchema]);
|
| 1766 |
+
/**
|
| 1767 |
+
* Parameters for an `elicitation/create` request for form-based elicitation.
|
| 1768 |
+
*/
|
| 1769 |
+
exports.ElicitRequestFormParamsSchema = exports.TaskAugmentedRequestParamsSchema.extend({
|
| 1770 |
+
/**
|
| 1771 |
+
* The elicitation mode.
|
| 1772 |
+
*
|
| 1773 |
+
* Optional for backward compatibility. Clients MUST treat missing mode as "form".
|
| 1774 |
+
*/
|
| 1775 |
+
mode: z.literal('form').optional(),
|
| 1776 |
+
/**
|
| 1777 |
+
* The message to present to the user describing what information is being requested.
|
| 1778 |
+
*/
|
| 1779 |
+
message: z.string(),
|
| 1780 |
+
/**
|
| 1781 |
+
* A restricted subset of JSON Schema.
|
| 1782 |
+
* Only top-level properties are allowed, without nesting.
|
| 1783 |
+
*/
|
| 1784 |
+
requestedSchema: z.object({
|
| 1785 |
+
type: z.literal('object'),
|
| 1786 |
+
properties: z.record(z.string(), exports.PrimitiveSchemaDefinitionSchema),
|
| 1787 |
+
required: z.array(z.string()).optional()
|
| 1788 |
+
})
|
| 1789 |
+
});
|
| 1790 |
+
/**
|
| 1791 |
+
* Parameters for an `elicitation/create` request for URL-based elicitation.
|
| 1792 |
+
*/
|
| 1793 |
+
exports.ElicitRequestURLParamsSchema = exports.TaskAugmentedRequestParamsSchema.extend({
|
| 1794 |
+
/**
|
| 1795 |
+
* The elicitation mode.
|
| 1796 |
+
*/
|
| 1797 |
+
mode: z.literal('url'),
|
| 1798 |
+
/**
|
| 1799 |
+
* The message to present to the user explaining why the interaction is needed.
|
| 1800 |
+
*/
|
| 1801 |
+
message: z.string(),
|
| 1802 |
+
/**
|
| 1803 |
+
* The ID of the elicitation, which must be unique within the context of the server.
|
| 1804 |
+
* The client MUST treat this ID as an opaque value.
|
| 1805 |
+
*/
|
| 1806 |
+
elicitationId: z.string(),
|
| 1807 |
+
/**
|
| 1808 |
+
* The URL that the user should navigate to.
|
| 1809 |
+
*/
|
| 1810 |
+
url: z.string().url()
|
| 1811 |
+
});
|
| 1812 |
+
/**
|
| 1813 |
+
* The parameters for a request to elicit additional information from the user via the client.
|
| 1814 |
+
*/
|
| 1815 |
+
exports.ElicitRequestParamsSchema = z.union([exports.ElicitRequestFormParamsSchema, exports.ElicitRequestURLParamsSchema]);
|
| 1816 |
+
/**
|
| 1817 |
+
* A request from the server to elicit user input via the client.
|
| 1818 |
+
* The client should present the message and form fields to the user (form mode)
|
| 1819 |
+
* or navigate to a URL (URL mode).
|
| 1820 |
+
*/
|
| 1821 |
+
exports.ElicitRequestSchema = exports.RequestSchema.extend({
|
| 1822 |
+
method: z.literal('elicitation/create'),
|
| 1823 |
+
params: exports.ElicitRequestParamsSchema
|
| 1824 |
+
});
|
| 1825 |
+
/**
|
| 1826 |
+
* Parameters for a `notifications/elicitation/complete` notification.
|
| 1827 |
+
*
|
| 1828 |
+
* @category notifications/elicitation/complete
|
| 1829 |
+
*/
|
| 1830 |
+
exports.ElicitationCompleteNotificationParamsSchema = NotificationsParamsSchema.extend({
|
| 1831 |
+
/**
|
| 1832 |
+
* The ID of the elicitation that completed.
|
| 1833 |
+
*/
|
| 1834 |
+
elicitationId: z.string()
|
| 1835 |
+
});
|
| 1836 |
+
/**
|
| 1837 |
+
* A notification from the server to the client, informing it of a completion of an out-of-band elicitation request.
|
| 1838 |
+
*
|
| 1839 |
+
* @category notifications/elicitation/complete
|
| 1840 |
+
*/
|
| 1841 |
+
exports.ElicitationCompleteNotificationSchema = exports.NotificationSchema.extend({
|
| 1842 |
+
method: z.literal('notifications/elicitation/complete'),
|
| 1843 |
+
params: exports.ElicitationCompleteNotificationParamsSchema
|
| 1844 |
+
});
|
| 1845 |
+
/**
|
| 1846 |
+
* The client's response to an elicitation/create request from the server.
|
| 1847 |
+
*/
|
| 1848 |
+
exports.ElicitResultSchema = exports.ResultSchema.extend({
|
| 1849 |
+
/**
|
| 1850 |
+
* The user action in response to the elicitation.
|
| 1851 |
+
* - "accept": User submitted the form/confirmed the action
|
| 1852 |
+
* - "decline": User explicitly decline the action
|
| 1853 |
+
* - "cancel": User dismissed without making an explicit choice
|
| 1854 |
+
*/
|
| 1855 |
+
action: z.enum(['accept', 'decline', 'cancel']),
|
| 1856 |
+
/**
|
| 1857 |
+
* The submitted form data, only present when action is "accept".
|
| 1858 |
+
* Contains values matching the requested schema.
|
| 1859 |
+
* Per MCP spec, content is "typically omitted" for decline/cancel actions.
|
| 1860 |
+
* We normalize null to undefined for leniency while maintaining type compatibility.
|
| 1861 |
+
*/
|
| 1862 |
+
content: z.preprocess(val => (val === null ? undefined : val), z.record(z.string(), z.union([z.string(), z.number(), z.boolean(), z.array(z.string())])).optional())
|
| 1863 |
+
});
|
| 1864 |
+
/* Autocomplete */
|
| 1865 |
+
/**
|
| 1866 |
+
* A reference to a resource or resource template definition.
|
| 1867 |
+
*/
|
| 1868 |
+
exports.ResourceTemplateReferenceSchema = z.object({
|
| 1869 |
+
type: z.literal('ref/resource'),
|
| 1870 |
+
/**
|
| 1871 |
+
* The URI or URI template of the resource.
|
| 1872 |
+
*/
|
| 1873 |
+
uri: z.string()
|
| 1874 |
+
});
|
| 1875 |
+
/**
|
| 1876 |
+
* @deprecated Use ResourceTemplateReferenceSchema instead
|
| 1877 |
+
*/
|
| 1878 |
+
exports.ResourceReferenceSchema = exports.ResourceTemplateReferenceSchema;
|
| 1879 |
+
/**
|
| 1880 |
+
* Identifies a prompt.
|
| 1881 |
+
*/
|
| 1882 |
+
exports.PromptReferenceSchema = z.object({
|
| 1883 |
+
type: z.literal('ref/prompt'),
|
| 1884 |
+
/**
|
| 1885 |
+
* The name of the prompt or prompt template
|
| 1886 |
+
*/
|
| 1887 |
+
name: z.string()
|
| 1888 |
+
});
|
| 1889 |
+
/**
|
| 1890 |
+
* Parameters for a `completion/complete` request.
|
| 1891 |
+
*/
|
| 1892 |
+
exports.CompleteRequestParamsSchema = BaseRequestParamsSchema.extend({
|
| 1893 |
+
ref: z.union([exports.PromptReferenceSchema, exports.ResourceTemplateReferenceSchema]),
|
| 1894 |
+
/**
|
| 1895 |
+
* The argument's information
|
| 1896 |
+
*/
|
| 1897 |
+
argument: z.object({
|
| 1898 |
+
/**
|
| 1899 |
+
* The name of the argument
|
| 1900 |
+
*/
|
| 1901 |
+
name: z.string(),
|
| 1902 |
+
/**
|
| 1903 |
+
* The value of the argument to use for completion matching.
|
| 1904 |
+
*/
|
| 1905 |
+
value: z.string()
|
| 1906 |
+
}),
|
| 1907 |
+
context: z
|
| 1908 |
+
.object({
|
| 1909 |
+
/**
|
| 1910 |
+
* Previously-resolved variables in a URI template or prompt.
|
| 1911 |
+
*/
|
| 1912 |
+
arguments: z.record(z.string(), z.string()).optional()
|
| 1913 |
+
})
|
| 1914 |
+
.optional()
|
| 1915 |
+
});
|
| 1916 |
+
/**
|
| 1917 |
+
* A request from the client to the server, to ask for completion options.
|
| 1918 |
+
*/
|
| 1919 |
+
exports.CompleteRequestSchema = exports.RequestSchema.extend({
|
| 1920 |
+
method: z.literal('completion/complete'),
|
| 1921 |
+
params: exports.CompleteRequestParamsSchema
|
| 1922 |
+
});
|
| 1923 |
+
function assertCompleteRequestPrompt(request) {
|
| 1924 |
+
if (request.params.ref.type !== 'ref/prompt') {
|
| 1925 |
+
throw new TypeError(`Expected CompleteRequestPrompt, but got ${request.params.ref.type}`);
|
| 1926 |
+
}
|
| 1927 |
+
void request;
|
| 1928 |
+
}
|
| 1929 |
+
function assertCompleteRequestResourceTemplate(request) {
|
| 1930 |
+
if (request.params.ref.type !== 'ref/resource') {
|
| 1931 |
+
throw new TypeError(`Expected CompleteRequestResourceTemplate, but got ${request.params.ref.type}`);
|
| 1932 |
+
}
|
| 1933 |
+
void request;
|
| 1934 |
+
}
|
| 1935 |
+
/**
|
| 1936 |
+
* The server's response to a completion/complete request
|
| 1937 |
+
*/
|
| 1938 |
+
exports.CompleteResultSchema = exports.ResultSchema.extend({
|
| 1939 |
+
completion: z.looseObject({
|
| 1940 |
+
/**
|
| 1941 |
+
* An array of completion values. Must not exceed 100 items.
|
| 1942 |
+
*/
|
| 1943 |
+
values: z.array(z.string()).max(100),
|
| 1944 |
+
/**
|
| 1945 |
+
* The total number of completion options available. This can exceed the number of values actually sent in the response.
|
| 1946 |
+
*/
|
| 1947 |
+
total: z.optional(z.number().int()),
|
| 1948 |
+
/**
|
| 1949 |
+
* Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown.
|
| 1950 |
+
*/
|
| 1951 |
+
hasMore: z.optional(z.boolean())
|
| 1952 |
+
})
|
| 1953 |
+
});
|
| 1954 |
+
/* Roots */
|
| 1955 |
+
/**
|
| 1956 |
+
* Represents a root directory or file that the server can operate on.
|
| 1957 |
+
*/
|
| 1958 |
+
exports.RootSchema = z.object({
|
| 1959 |
+
/**
|
| 1960 |
+
* The URI identifying the root. This *must* start with file:// for now.
|
| 1961 |
+
*/
|
| 1962 |
+
uri: z.string().startsWith('file://'),
|
| 1963 |
+
/**
|
| 1964 |
+
* An optional name for the root.
|
| 1965 |
+
*/
|
| 1966 |
+
name: z.string().optional(),
|
| 1967 |
+
/**
|
| 1968 |
+
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
| 1969 |
+
* for notes on _meta usage.
|
| 1970 |
+
*/
|
| 1971 |
+
_meta: z.record(z.string(), z.unknown()).optional()
|
| 1972 |
+
});
|
| 1973 |
+
/**
|
| 1974 |
+
* Sent from the server to request a list of root URIs from the client.
|
| 1975 |
+
*/
|
| 1976 |
+
exports.ListRootsRequestSchema = exports.RequestSchema.extend({
|
| 1977 |
+
method: z.literal('roots/list'),
|
| 1978 |
+
params: BaseRequestParamsSchema.optional()
|
| 1979 |
+
});
|
| 1980 |
+
/**
|
| 1981 |
+
* The client's response to a roots/list request from the server.
|
| 1982 |
+
*/
|
| 1983 |
+
exports.ListRootsResultSchema = exports.ResultSchema.extend({
|
| 1984 |
+
roots: z.array(exports.RootSchema)
|
| 1985 |
+
});
|
| 1986 |
+
/**
|
| 1987 |
+
* A notification from the client to the server, informing it that the list of roots has changed.
|
| 1988 |
+
*/
|
| 1989 |
+
exports.RootsListChangedNotificationSchema = exports.NotificationSchema.extend({
|
| 1990 |
+
method: z.literal('notifications/roots/list_changed'),
|
| 1991 |
+
params: NotificationsParamsSchema.optional()
|
| 1992 |
+
});
|
| 1993 |
+
/* Client messages */
|
| 1994 |
+
exports.ClientRequestSchema = z.union([
|
| 1995 |
+
exports.PingRequestSchema,
|
| 1996 |
+
exports.InitializeRequestSchema,
|
| 1997 |
+
exports.CompleteRequestSchema,
|
| 1998 |
+
exports.SetLevelRequestSchema,
|
| 1999 |
+
exports.GetPromptRequestSchema,
|
| 2000 |
+
exports.ListPromptsRequestSchema,
|
| 2001 |
+
exports.ListResourcesRequestSchema,
|
| 2002 |
+
exports.ListResourceTemplatesRequestSchema,
|
| 2003 |
+
exports.ReadResourceRequestSchema,
|
| 2004 |
+
exports.SubscribeRequestSchema,
|
| 2005 |
+
exports.UnsubscribeRequestSchema,
|
| 2006 |
+
exports.CallToolRequestSchema,
|
| 2007 |
+
exports.ListToolsRequestSchema,
|
| 2008 |
+
exports.GetTaskRequestSchema,
|
| 2009 |
+
exports.GetTaskPayloadRequestSchema,
|
| 2010 |
+
exports.ListTasksRequestSchema,
|
| 2011 |
+
exports.CancelTaskRequestSchema
|
| 2012 |
+
]);
|
| 2013 |
+
exports.ClientNotificationSchema = z.union([
|
| 2014 |
+
exports.CancelledNotificationSchema,
|
| 2015 |
+
exports.ProgressNotificationSchema,
|
| 2016 |
+
exports.InitializedNotificationSchema,
|
| 2017 |
+
exports.RootsListChangedNotificationSchema,
|
| 2018 |
+
exports.TaskStatusNotificationSchema
|
| 2019 |
+
]);
|
| 2020 |
+
exports.ClientResultSchema = z.union([
|
| 2021 |
+
exports.EmptyResultSchema,
|
| 2022 |
+
exports.CreateMessageResultSchema,
|
| 2023 |
+
exports.CreateMessageResultWithToolsSchema,
|
| 2024 |
+
exports.ElicitResultSchema,
|
| 2025 |
+
exports.ListRootsResultSchema,
|
| 2026 |
+
exports.GetTaskResultSchema,
|
| 2027 |
+
exports.ListTasksResultSchema,
|
| 2028 |
+
exports.CreateTaskResultSchema
|
| 2029 |
+
]);
|
| 2030 |
+
/* Server messages */
|
| 2031 |
+
exports.ServerRequestSchema = z.union([
|
| 2032 |
+
exports.PingRequestSchema,
|
| 2033 |
+
exports.CreateMessageRequestSchema,
|
| 2034 |
+
exports.ElicitRequestSchema,
|
| 2035 |
+
exports.ListRootsRequestSchema,
|
| 2036 |
+
exports.GetTaskRequestSchema,
|
| 2037 |
+
exports.GetTaskPayloadRequestSchema,
|
| 2038 |
+
exports.ListTasksRequestSchema,
|
| 2039 |
+
exports.CancelTaskRequestSchema
|
| 2040 |
+
]);
|
| 2041 |
+
exports.ServerNotificationSchema = z.union([
|
| 2042 |
+
exports.CancelledNotificationSchema,
|
| 2043 |
+
exports.ProgressNotificationSchema,
|
| 2044 |
+
exports.LoggingMessageNotificationSchema,
|
| 2045 |
+
exports.ResourceUpdatedNotificationSchema,
|
| 2046 |
+
exports.ResourceListChangedNotificationSchema,
|
| 2047 |
+
exports.ToolListChangedNotificationSchema,
|
| 2048 |
+
exports.PromptListChangedNotificationSchema,
|
| 2049 |
+
exports.TaskStatusNotificationSchema,
|
| 2050 |
+
exports.ElicitationCompleteNotificationSchema
|
| 2051 |
+
]);
|
| 2052 |
+
exports.ServerResultSchema = z.union([
|
| 2053 |
+
exports.EmptyResultSchema,
|
| 2054 |
+
exports.InitializeResultSchema,
|
| 2055 |
+
exports.CompleteResultSchema,
|
| 2056 |
+
exports.GetPromptResultSchema,
|
| 2057 |
+
exports.ListPromptsResultSchema,
|
| 2058 |
+
exports.ListResourcesResultSchema,
|
| 2059 |
+
exports.ListResourceTemplatesResultSchema,
|
| 2060 |
+
exports.ReadResourceResultSchema,
|
| 2061 |
+
exports.CallToolResultSchema,
|
| 2062 |
+
exports.ListToolsResultSchema,
|
| 2063 |
+
exports.GetTaskResultSchema,
|
| 2064 |
+
exports.ListTasksResultSchema,
|
| 2065 |
+
exports.CreateTaskResultSchema
|
| 2066 |
+
]);
|
| 2067 |
+
class McpError extends Error {
|
| 2068 |
+
constructor(code, message, data) {
|
| 2069 |
+
super(`MCP error ${code}: ${message}`);
|
| 2070 |
+
this.code = code;
|
| 2071 |
+
this.data = data;
|
| 2072 |
+
this.name = 'McpError';
|
| 2073 |
+
}
|
| 2074 |
+
/**
|
| 2075 |
+
* Factory method to create the appropriate error type based on the error code and data
|
| 2076 |
+
*/
|
| 2077 |
+
static fromError(code, message, data) {
|
| 2078 |
+
// Check for specific error types
|
| 2079 |
+
if (code === ErrorCode.UrlElicitationRequired && data) {
|
| 2080 |
+
const errorData = data;
|
| 2081 |
+
if (errorData.elicitations) {
|
| 2082 |
+
return new UrlElicitationRequiredError(errorData.elicitations, message);
|
| 2083 |
+
}
|
| 2084 |
+
}
|
| 2085 |
+
// Default to generic McpError
|
| 2086 |
+
return new McpError(code, message, data);
|
| 2087 |
+
}
|
| 2088 |
+
}
|
| 2089 |
+
exports.McpError = McpError;
|
| 2090 |
+
/**
|
| 2091 |
+
* Specialized error type when a tool requires a URL mode elicitation.
|
| 2092 |
+
* This makes it nicer for the client to handle since there is specific data to work with instead of just a code to check against.
|
| 2093 |
+
*/
|
| 2094 |
+
class UrlElicitationRequiredError extends McpError {
|
| 2095 |
+
constructor(elicitations, message = `URL elicitation${elicitations.length > 1 ? 's' : ''} required`) {
|
| 2096 |
+
super(ErrorCode.UrlElicitationRequired, message, {
|
| 2097 |
+
elicitations: elicitations
|
| 2098 |
+
});
|
| 2099 |
+
}
|
| 2100 |
+
get elicitations() {
|
| 2101 |
+
return this.data?.elicitations ?? [];
|
| 2102 |
+
}
|
| 2103 |
+
}
|
| 2104 |
+
exports.UrlElicitationRequiredError = UrlElicitationRequiredError;
|
| 2105 |
+
//# sourceMappingURL=types.js.map
|
node_modules/@modelcontextprotocol/sdk/dist/cjs/types.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAomEA,kEAKC;AAED,sFAKC;AAhnED,0CAA4B;AAGf,QAAA,uBAAuB,GAAG,YAAY,CAAC;AACvC,QAAA,mCAAmC,GAAG,YAAY,CAAC;AACnD,QAAA,2BAA2B,GAAG,CAAC,+BAAuB,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,CAAC,CAAC;AAEhH,QAAA,qBAAqB,GAAG,sCAAsC,CAAC;AAE5E,oBAAoB;AACP,QAAA,eAAe,GAAG,KAAK,CAAC;AAMrC;;;;GAIG;AACH,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAS,CAAC,CAAC,EAAe,EAAE,CAAC,CAAC,KAAK,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,QAAQ,IAAI,OAAO,CAAC,KAAK,UAAU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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* AJV-based JSON Schema validator provider
|
| 3 |
+
*/
|
| 4 |
+
import Ajv from 'ajv';
|
| 5 |
+
import type { JsonSchemaType, JsonSchemaValidator, jsonSchemaValidator } from './types.js';
|
| 6 |
+
/**
|
| 7 |
+
* @example
|
| 8 |
+
* ```typescript
|
| 9 |
+
* // Use with default AJV instance (recommended)
|
| 10 |
+
* import { AjvJsonSchemaValidator } from '@modelcontextprotocol/sdk/validation/ajv';
|
| 11 |
+
* const validator = new AjvJsonSchemaValidator();
|
| 12 |
+
*
|
| 13 |
+
* // Use with custom AJV instance
|
| 14 |
+
* import { Ajv } from 'ajv';
|
| 15 |
+
* const ajv = new Ajv({ strict: true, allErrors: true });
|
| 16 |
+
* const validator = new AjvJsonSchemaValidator(ajv);
|
| 17 |
+
* ```
|
| 18 |
+
*/
|
| 19 |
+
export declare class AjvJsonSchemaValidator implements jsonSchemaValidator {
|
| 20 |
+
private _ajv;
|
| 21 |
+
/**
|
| 22 |
+
* Create an AJV validator
|
| 23 |
+
*
|
| 24 |
+
* @param ajv - Optional pre-configured AJV instance. If not provided, a default instance will be created.
|
| 25 |
+
*
|
| 26 |
+
* @example
|
| 27 |
+
* ```typescript
|
| 28 |
+
* // Use default configuration (recommended for most cases)
|
| 29 |
+
* import { AjvJsonSchemaValidator } from '@modelcontextprotocol/sdk/validation/ajv';
|
| 30 |
+
* const validator = new AjvJsonSchemaValidator();
|
| 31 |
+
*
|
| 32 |
+
* // Or provide custom AJV instance for advanced configuration
|
| 33 |
+
* import { Ajv } from 'ajv';
|
| 34 |
+
* import addFormats from 'ajv-formats';
|
| 35 |
+
*
|
| 36 |
+
* const ajv = new Ajv({ validateFormats: true });
|
| 37 |
+
* addFormats(ajv);
|
| 38 |
+
* const validator = new AjvJsonSchemaValidator(ajv);
|
| 39 |
+
* ```
|
| 40 |
+
*/
|
| 41 |
+
constructor(ajv?: Ajv);
|
| 42 |
+
/**
|
| 43 |
+
* Create a validator for the given JSON Schema
|
| 44 |
+
*
|
| 45 |
+
* The validator is compiled once and can be reused multiple times.
|
| 46 |
+
* If the schema has an $id, it will be cached by AJV automatically.
|
| 47 |
+
*
|
| 48 |
+
* @param schema - Standard JSON Schema object
|
| 49 |
+
* @returns A validator function that validates input data
|
| 50 |
+
*/
|
| 51 |
+
getValidator<T>(schema: JsonSchemaType): JsonSchemaValidator<T>;
|
| 52 |
+
}
|
| 53 |
+
//# sourceMappingURL=ajv-provider.d.ts.map
|
node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/ajv-provider.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"ajv-provider.d.ts","sourceRoot":"","sources":["../../../src/validation/ajv-provider.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,GAAG,MAAM,KAAK,CAAC;AAEtB,OAAO,KAAK,EAAE,cAAc,EAAE,mBAAmB,EAA6B,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAgBtH;;;;;;;;;;;;GAYG;AACH,qBAAa,sBAAuB,YAAW,mBAAmB;IAC9D,OAAO,CAAC,IAAI,CAAM;IAElB;;;;;;;;;;;;;;;;;;;OAmBG;gBACS,GAAG,CAAC,EAAE,GAAG;IAIrB;;;;;;;;OAQG;IACH,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,cAAc,GAAG,mBAAmB,CAAC,CAAC,CAAC;CAyBlE"}
|
node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/ajv-provider.js
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
/**
|
| 3 |
+
* AJV-based JSON Schema validator provider
|
| 4 |
+
*/
|
| 5 |
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
| 6 |
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
| 7 |
+
};
|
| 8 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 9 |
+
exports.AjvJsonSchemaValidator = void 0;
|
| 10 |
+
const ajv_1 = __importDefault(require("ajv"));
|
| 11 |
+
const ajv_formats_1 = __importDefault(require("ajv-formats"));
|
| 12 |
+
function createDefaultAjvInstance() {
|
| 13 |
+
const ajv = new ajv_1.default({
|
| 14 |
+
strict: false,
|
| 15 |
+
validateFormats: true,
|
| 16 |
+
validateSchema: false,
|
| 17 |
+
allErrors: true
|
| 18 |
+
});
|
| 19 |
+
const addFormats = ajv_formats_1.default;
|
| 20 |
+
addFormats(ajv);
|
| 21 |
+
return ajv;
|
| 22 |
+
}
|
| 23 |
+
/**
|
| 24 |
+
* @example
|
| 25 |
+
* ```typescript
|
| 26 |
+
* // Use with default AJV instance (recommended)
|
| 27 |
+
* import { AjvJsonSchemaValidator } from '@modelcontextprotocol/sdk/validation/ajv';
|
| 28 |
+
* const validator = new AjvJsonSchemaValidator();
|
| 29 |
+
*
|
| 30 |
+
* // Use with custom AJV instance
|
| 31 |
+
* import { Ajv } from 'ajv';
|
| 32 |
+
* const ajv = new Ajv({ strict: true, allErrors: true });
|
| 33 |
+
* const validator = new AjvJsonSchemaValidator(ajv);
|
| 34 |
+
* ```
|
| 35 |
+
*/
|
| 36 |
+
class AjvJsonSchemaValidator {
|
| 37 |
+
/**
|
| 38 |
+
* Create an AJV validator
|
| 39 |
+
*
|
| 40 |
+
* @param ajv - Optional pre-configured AJV instance. If not provided, a default instance will be created.
|
| 41 |
+
*
|
| 42 |
+
* @example
|
| 43 |
+
* ```typescript
|
| 44 |
+
* // Use default configuration (recommended for most cases)
|
| 45 |
+
* import { AjvJsonSchemaValidator } from '@modelcontextprotocol/sdk/validation/ajv';
|
| 46 |
+
* const validator = new AjvJsonSchemaValidator();
|
| 47 |
+
*
|
| 48 |
+
* // Or provide custom AJV instance for advanced configuration
|
| 49 |
+
* import { Ajv } from 'ajv';
|
| 50 |
+
* import addFormats from 'ajv-formats';
|
| 51 |
+
*
|
| 52 |
+
* const ajv = new Ajv({ validateFormats: true });
|
| 53 |
+
* addFormats(ajv);
|
| 54 |
+
* const validator = new AjvJsonSchemaValidator(ajv);
|
| 55 |
+
* ```
|
| 56 |
+
*/
|
| 57 |
+
constructor(ajv) {
|
| 58 |
+
this._ajv = ajv ?? createDefaultAjvInstance();
|
| 59 |
+
}
|
| 60 |
+
/**
|
| 61 |
+
* Create a validator for the given JSON Schema
|
| 62 |
+
*
|
| 63 |
+
* The validator is compiled once and can be reused multiple times.
|
| 64 |
+
* If the schema has an $id, it will be cached by AJV automatically.
|
| 65 |
+
*
|
| 66 |
+
* @param schema - Standard JSON Schema object
|
| 67 |
+
* @returns A validator function that validates input data
|
| 68 |
+
*/
|
| 69 |
+
getValidator(schema) {
|
| 70 |
+
// Check if schema has $id and is already compiled/cached
|
| 71 |
+
const ajvValidator = '$id' in schema && typeof schema.$id === 'string'
|
| 72 |
+
? (this._ajv.getSchema(schema.$id) ?? this._ajv.compile(schema))
|
| 73 |
+
: this._ajv.compile(schema);
|
| 74 |
+
return (input) => {
|
| 75 |
+
const valid = ajvValidator(input);
|
| 76 |
+
if (valid) {
|
| 77 |
+
return {
|
| 78 |
+
valid: true,
|
| 79 |
+
data: input,
|
| 80 |
+
errorMessage: undefined
|
| 81 |
+
};
|
| 82 |
+
}
|
| 83 |
+
else {
|
| 84 |
+
return {
|
| 85 |
+
valid: false,
|
| 86 |
+
data: undefined,
|
| 87 |
+
errorMessage: this._ajv.errorsText(ajvValidator.errors)
|
| 88 |
+
};
|
| 89 |
+
}
|
| 90 |
+
};
|
| 91 |
+
}
|
| 92 |
+
}
|
| 93 |
+
exports.AjvJsonSchemaValidator = AjvJsonSchemaValidator;
|
| 94 |
+
//# sourceMappingURL=ajv-provider.js.map
|
node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/ajv-provider.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"ajv-provider.js","sourceRoot":"","sources":["../../../src/validation/ajv-provider.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;AAEH,8CAAsB;AACtB,8DAAsC;AAGtC,SAAS,wBAAwB;IAC7B,MAAM,GAAG,GAAG,IAAI,aAAG,CAAC;QAChB,MAAM,EAAE,KAAK;QACb,eAAe,EAAE,IAAI;QACrB,cAAc,EAAE,KAAK;QACrB,SAAS,EAAE,IA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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* Cloudflare Worker-compatible JSON Schema validator provider
|
| 3 |
+
*
|
| 4 |
+
* This provider uses @cfworker/json-schema for validation without code generation,
|
| 5 |
+
* making it compatible with edge runtimes like Cloudflare Workers that restrict
|
| 6 |
+
* eval and new Function.
|
| 7 |
+
*/
|
| 8 |
+
import type { JsonSchemaType, JsonSchemaValidator, jsonSchemaValidator } from './types.js';
|
| 9 |
+
/**
|
| 10 |
+
* JSON Schema draft version supported by @cfworker/json-schema
|
| 11 |
+
*/
|
| 12 |
+
export type CfWorkerSchemaDraft = '4' | '7' | '2019-09' | '2020-12';
|
| 13 |
+
/**
|
| 14 |
+
*
|
| 15 |
+
* @example
|
| 16 |
+
* ```typescript
|
| 17 |
+
* // Use with default configuration (2020-12, shortcircuit)
|
| 18 |
+
* const validator = new CfWorkerJsonSchemaValidator();
|
| 19 |
+
*
|
| 20 |
+
* // Use with custom configuration
|
| 21 |
+
* const validator = new CfWorkerJsonSchemaValidator({
|
| 22 |
+
* draft: '2020-12',
|
| 23 |
+
* shortcircuit: false // Report all errors
|
| 24 |
+
* });
|
| 25 |
+
* ```
|
| 26 |
+
*/
|
| 27 |
+
export declare class CfWorkerJsonSchemaValidator implements jsonSchemaValidator {
|
| 28 |
+
private shortcircuit;
|
| 29 |
+
private draft;
|
| 30 |
+
/**
|
| 31 |
+
* Create a validator
|
| 32 |
+
*
|
| 33 |
+
* @param options - Configuration options
|
| 34 |
+
* @param options.shortcircuit - If true, stop validation after first error (default: true)
|
| 35 |
+
* @param options.draft - JSON Schema draft version to use (default: '2020-12')
|
| 36 |
+
*/
|
| 37 |
+
constructor(options?: {
|
| 38 |
+
shortcircuit?: boolean;
|
| 39 |
+
draft?: CfWorkerSchemaDraft;
|
| 40 |
+
});
|
| 41 |
+
/**
|
| 42 |
+
* Create a validator for the given JSON Schema
|
| 43 |
+
*
|
| 44 |
+
* Unlike AJV, this validator is not cached internally
|
| 45 |
+
*
|
| 46 |
+
* @param schema - Standard JSON Schema object
|
| 47 |
+
* @returns A validator function that validates input data
|
| 48 |
+
*/
|
| 49 |
+
getValidator<T>(schema: JsonSchemaType): JsonSchemaValidator<T>;
|
| 50 |
+
}
|
| 51 |
+
//# sourceMappingURL=cfworker-provider.d.ts.map
|
node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/cfworker-provider.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"cfworker-provider.d.ts","sourceRoot":"","sources":["../../../src/validation/cfworker-provider.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,mBAAmB,EAA6B,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEtH;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,GAAG,GAAG,GAAG,GAAG,SAAS,GAAG,SAAS,CAAC;AAEpE;;;;;;;;;;;;;GAaG;AACH,qBAAa,2BAA4B,YAAW,mBAAmB;IACnE,OAAO,CAAC,YAAY,CAAU;IAC9B,OAAO,CAAC,KAAK,CAAsB;IAEnC;;;;;;OAMG;gBACS,OAAO,CAAC,EAAE;QAAE,YAAY,CAAC,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,mBAAmB,CAAA;KAAE;IAK7E;;;;;;;OAOG;IACH,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,cAAc,GAAG,mBAAmB,CAAC,CAAC,CAAC;CAsBlE"}
|
node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/cfworker-provider.js
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
/**
|
| 3 |
+
* Cloudflare Worker-compatible JSON Schema validator provider
|
| 4 |
+
*
|
| 5 |
+
* This provider uses @cfworker/json-schema for validation without code generation,
|
| 6 |
+
* making it compatible with edge runtimes like Cloudflare Workers that restrict
|
| 7 |
+
* eval and new Function.
|
| 8 |
+
*/
|
| 9 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 10 |
+
exports.CfWorkerJsonSchemaValidator = void 0;
|
| 11 |
+
const json_schema_1 = require("@cfworker/json-schema");
|
| 12 |
+
/**
|
| 13 |
+
*
|
| 14 |
+
* @example
|
| 15 |
+
* ```typescript
|
| 16 |
+
* // Use with default configuration (2020-12, shortcircuit)
|
| 17 |
+
* const validator = new CfWorkerJsonSchemaValidator();
|
| 18 |
+
*
|
| 19 |
+
* // Use with custom configuration
|
| 20 |
+
* const validator = new CfWorkerJsonSchemaValidator({
|
| 21 |
+
* draft: '2020-12',
|
| 22 |
+
* shortcircuit: false // Report all errors
|
| 23 |
+
* });
|
| 24 |
+
* ```
|
| 25 |
+
*/
|
| 26 |
+
class CfWorkerJsonSchemaValidator {
|
| 27 |
+
/**
|
| 28 |
+
* Create a validator
|
| 29 |
+
*
|
| 30 |
+
* @param options - Configuration options
|
| 31 |
+
* @param options.shortcircuit - If true, stop validation after first error (default: true)
|
| 32 |
+
* @param options.draft - JSON Schema draft version to use (default: '2020-12')
|
| 33 |
+
*/
|
| 34 |
+
constructor(options) {
|
| 35 |
+
this.shortcircuit = options?.shortcircuit ?? true;
|
| 36 |
+
this.draft = options?.draft ?? '2020-12';
|
| 37 |
+
}
|
| 38 |
+
/**
|
| 39 |
+
* Create a validator for the given JSON Schema
|
| 40 |
+
*
|
| 41 |
+
* Unlike AJV, this validator is not cached internally
|
| 42 |
+
*
|
| 43 |
+
* @param schema - Standard JSON Schema object
|
| 44 |
+
* @returns A validator function that validates input data
|
| 45 |
+
*/
|
| 46 |
+
getValidator(schema) {
|
| 47 |
+
// Cast to the cfworker Schema type - our JsonSchemaType is structurally compatible
|
| 48 |
+
const validator = new json_schema_1.Validator(schema, this.draft, this.shortcircuit);
|
| 49 |
+
return (input) => {
|
| 50 |
+
const result = validator.validate(input);
|
| 51 |
+
if (result.valid) {
|
| 52 |
+
return {
|
| 53 |
+
valid: true,
|
| 54 |
+
data: input,
|
| 55 |
+
errorMessage: undefined
|
| 56 |
+
};
|
| 57 |
+
}
|
| 58 |
+
else {
|
| 59 |
+
return {
|
| 60 |
+
valid: false,
|
| 61 |
+
data: undefined,
|
| 62 |
+
errorMessage: result.errors.map(err => `${err.instanceLocation}: ${err.error}`).join('; ')
|
| 63 |
+
};
|
| 64 |
+
}
|
| 65 |
+
};
|
| 66 |
+
}
|
| 67 |
+
}
|
| 68 |
+
exports.CfWorkerJsonSchemaValidator = CfWorkerJsonSchemaValidator;
|
| 69 |
+
//# sourceMappingURL=cfworker-provider.js.map
|
node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/cfworker-provider.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"cfworker-provider.js","sourceRoot":"","sources":["../../../src/validation/cfworker-provider.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,uDAAkD;AAQlD;;;;;;;;;;;;;GAaG;AACH,MAAa,2BAA2B;IAIpC;;;;;;OAMG;IACH,YAAY,OAAiE;QACzE,IAAI,CAAC,YAAY,GAAG,OAAO,EAAE,YAAY,IAAI,IAAI,CAAC;QAClD,IAAI,CAAC,KAAK,GAAG,OAAO,EAAE,KAAK,IAAI,SAAS,CAAC;IAC7C,CAAC;IAED;;;;;;;OAOG;IACH,YAAY,CAAI,MAAsB;QAClC,mFAAmF;QACnF,MAAM,SAAS,GAAG,IAAI,uBAAS,CAAC,MAAoD,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;QAErH,OAAO,CAAC,KAAc,EAAgC,EAAE;YACpD,MAAM,MAAM,GAAG,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;YAEzC,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;gBACf,OAAO;oBACH,KAAK,EAAE,IAAI;oBACX,IAAI,EAAE,KAAU;oBAChB,YAAY,EAAE,SAAS;iBAC1B,CAAC;YACN,CAAC;iBAAM,CAAC;gBACJ,OAAO;oBACH,KAAK,EAAE,KAAK;oBACZ,IAAI,EAAE,SAAS;oBACf,YAAY,EAAE,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,gBAAgB,KAAK,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;iBAC7F,CAAC;YACN,CAAC;QACL,CAAC,CAAC;IACN,CAAC;CACJ;AA9CD,kEA8CC"}
|
node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/index.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* JSON Schema validation
|
| 3 |
+
*
|
| 4 |
+
* This module provides configurable JSON Schema validation for the MCP SDK.
|
| 5 |
+
* Choose a validator based on your runtime environment:
|
| 6 |
+
*
|
| 7 |
+
* - AjvJsonSchemaValidator: Best for Node.js (default, fastest)
|
| 8 |
+
* Import from: @modelcontextprotocol/sdk/validation/ajv
|
| 9 |
+
* Requires peer dependencies: ajv, ajv-formats
|
| 10 |
+
*
|
| 11 |
+
* - CfWorkerJsonSchemaValidator: Best for edge runtimes
|
| 12 |
+
* Import from: @modelcontextprotocol/sdk/validation/cfworker
|
| 13 |
+
* Requires peer dependency: @cfworker/json-schema
|
| 14 |
+
*
|
| 15 |
+
* @example
|
| 16 |
+
* ```typescript
|
| 17 |
+
* // For Node.js with AJV
|
| 18 |
+
* import { AjvJsonSchemaValidator } from '@modelcontextprotocol/sdk/validation/ajv';
|
| 19 |
+
* const validator = new AjvJsonSchemaValidator();
|
| 20 |
+
*
|
| 21 |
+
* // For Cloudflare Workers
|
| 22 |
+
* import { CfWorkerJsonSchemaValidator } from '@modelcontextprotocol/sdk/validation/cfworker';
|
| 23 |
+
* const validator = new CfWorkerJsonSchemaValidator();
|
| 24 |
+
* ```
|
| 25 |
+
*
|
| 26 |
+
* @module validation
|
| 27 |
+
*/
|
| 28 |
+
export type { JsonSchemaType, JsonSchemaValidator, JsonSchemaValidatorResult, jsonSchemaValidator } from './types.js';
|
| 29 |
+
//# sourceMappingURL=index.d.ts.map
|
node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/index.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/validation/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAGH,YAAY,EAAE,cAAc,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC"}
|
node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/index.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
/**
|
| 3 |
+
* JSON Schema validation
|
| 4 |
+
*
|
| 5 |
+
* This module provides configurable JSON Schema validation for the MCP SDK.
|
| 6 |
+
* Choose a validator based on your runtime environment:
|
| 7 |
+
*
|
| 8 |
+
* - AjvJsonSchemaValidator: Best for Node.js (default, fastest)
|
| 9 |
+
* Import from: @modelcontextprotocol/sdk/validation/ajv
|
| 10 |
+
* Requires peer dependencies: ajv, ajv-formats
|
| 11 |
+
*
|
| 12 |
+
* - CfWorkerJsonSchemaValidator: Best for edge runtimes
|
| 13 |
+
* Import from: @modelcontextprotocol/sdk/validation/cfworker
|
| 14 |
+
* Requires peer dependency: @cfworker/json-schema
|
| 15 |
+
*
|
| 16 |
+
* @example
|
| 17 |
+
* ```typescript
|
| 18 |
+
* // For Node.js with AJV
|
| 19 |
+
* import { AjvJsonSchemaValidator } from '@modelcontextprotocol/sdk/validation/ajv';
|
| 20 |
+
* const validator = new AjvJsonSchemaValidator();
|
| 21 |
+
*
|
| 22 |
+
* // For Cloudflare Workers
|
| 23 |
+
* import { CfWorkerJsonSchemaValidator } from '@modelcontextprotocol/sdk/validation/cfworker';
|
| 24 |
+
* const validator = new CfWorkerJsonSchemaValidator();
|
| 25 |
+
* ```
|
| 26 |
+
*
|
| 27 |
+
* @module validation
|
| 28 |
+
*/
|
| 29 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 30 |
+
//# sourceMappingURL=index.js.map
|
node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/validation/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG"}
|
node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/types.d.ts
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import type { JSONSchema } from 'json-schema-typed';
|
| 2 |
+
/**
|
| 3 |
+
* JSON Schema type definition (JSON Schema Draft 2020-12)
|
| 4 |
+
*
|
| 5 |
+
* This uses the object form of JSON Schema (excluding boolean schemas).
|
| 6 |
+
* While `true` and `false` are valid JSON Schemas, this SDK uses the
|
| 7 |
+
* object form for practical type safety.
|
| 8 |
+
*
|
| 9 |
+
* Re-exported from json-schema-typed for convenience.
|
| 10 |
+
* @see https://json-schema.org/draft/2020-12/json-schema-core.html
|
| 11 |
+
*/
|
| 12 |
+
export type JsonSchemaType = JSONSchema.Interface;
|
| 13 |
+
/**
|
| 14 |
+
* Result of a JSON Schema validation operation
|
| 15 |
+
*/
|
| 16 |
+
export type JsonSchemaValidatorResult<T> = {
|
| 17 |
+
valid: true;
|
| 18 |
+
data: T;
|
| 19 |
+
errorMessage: undefined;
|
| 20 |
+
} | {
|
| 21 |
+
valid: false;
|
| 22 |
+
data: undefined;
|
| 23 |
+
errorMessage: string;
|
| 24 |
+
};
|
| 25 |
+
/**
|
| 26 |
+
* A validator function that validates data against a JSON Schema
|
| 27 |
+
*/
|
| 28 |
+
export type JsonSchemaValidator<T> = (input: unknown) => JsonSchemaValidatorResult<T>;
|
| 29 |
+
/**
|
| 30 |
+
* Provider interface for creating validators from JSON Schemas
|
| 31 |
+
*
|
| 32 |
+
* This is the main extension point for custom validator implementations.
|
| 33 |
+
* Implementations should:
|
| 34 |
+
* - Support JSON Schema Draft 2020-12 (or be compatible with it)
|
| 35 |
+
* - Return validator functions that can be called multiple times
|
| 36 |
+
* - Handle schema compilation/caching internally
|
| 37 |
+
* - Provide clear error messages on validation failure
|
| 38 |
+
*
|
| 39 |
+
* @example
|
| 40 |
+
* ```typescript
|
| 41 |
+
* class MyValidatorProvider implements jsonSchemaValidator {
|
| 42 |
+
* getValidator<T>(schema: JsonSchemaType<T>): JsonSchemaValidator<T> {
|
| 43 |
+
* // Compile/cache validator from schema
|
| 44 |
+
* return (input: unknown) => {
|
| 45 |
+
* // Validate input against schema
|
| 46 |
+
* if (valid) {
|
| 47 |
+
* return { valid: true, data: input as T, errorMessage: undefined };
|
| 48 |
+
* } else {
|
| 49 |
+
* return { valid: false, data: undefined, errorMessage: 'Error details' };
|
| 50 |
+
* }
|
| 51 |
+
* };
|
| 52 |
+
* }
|
| 53 |
+
* }
|
| 54 |
+
* ```
|
| 55 |
+
*/
|
| 56 |
+
export interface jsonSchemaValidator {
|
| 57 |
+
/**
|
| 58 |
+
* Create a validator for the given JSON Schema
|
| 59 |
+
*
|
| 60 |
+
* @param schema - Standard JSON Schema object
|
| 61 |
+
* @returns A validator function that can be called multiple times
|
| 62 |
+
*/
|
| 63 |
+
getValidator<T>(schema: JsonSchemaType): JsonSchemaValidator<T>;
|
| 64 |
+
}
|
| 65 |
+
//# sourceMappingURL=types.d.ts.map
|
node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/types.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/validation/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD;;;;;;;;;GASG;AACH,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC,SAAS,CAAC;AAElD;;GAEG;AACH,MAAM,MAAM,yBAAyB,CAAC,CAAC,IACjC;IAAE,KAAK,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,CAAC,CAAC;IAAC,YAAY,EAAE,SAAS,CAAA;CAAE,GACjD;IAAE,KAAK,EAAE,KAAK,CAAC;IAAC,IAAI,EAAE,SAAS,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,CAAC;AAE9D;;GAEG;AACH,MAAM,MAAM,mBAAmB,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,KAAK,yBAAyB,CAAC,CAAC,CAAC,CAAC;AAEtF;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,WAAW,mBAAmB;IAChC;;;;;OAKG;IACH,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,cAAc,GAAG,mBAAmB,CAAC,CAAC,CAAC,CAAC;CACnE"}
|
node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/types.js
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 3 |
+
//# sourceMappingURL=types.js.map
|
node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/types.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/validation/types.ts"],"names":[],"mappings":""}
|
node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth-extensions.d.ts
ADDED
|
@@ -0,0 +1,190 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* OAuth provider extensions for specialized authentication flows.
|
| 3 |
+
*
|
| 4 |
+
* This module provides ready-to-use OAuthClientProvider implementations
|
| 5 |
+
* for common machine-to-machine authentication scenarios.
|
| 6 |
+
*/
|
| 7 |
+
import { OAuthClientInformation, OAuthClientMetadata, OAuthTokens } from '../shared/auth.js';
|
| 8 |
+
import { AddClientAuthentication, OAuthClientProvider } from './auth.js';
|
| 9 |
+
/**
|
| 10 |
+
* Helper to produce a private_key_jwt client authentication function.
|
| 11 |
+
*
|
| 12 |
+
* Usage:
|
| 13 |
+
* const addClientAuth = createPrivateKeyJwtAuth({ issuer, subject, privateKey, alg, audience? });
|
| 14 |
+
* // pass addClientAuth as provider.addClientAuthentication implementation
|
| 15 |
+
*/
|
| 16 |
+
export declare function createPrivateKeyJwtAuth(options: {
|
| 17 |
+
issuer: string;
|
| 18 |
+
subject: string;
|
| 19 |
+
privateKey: string | Uint8Array | Record<string, unknown>;
|
| 20 |
+
alg: string;
|
| 21 |
+
audience?: string | URL;
|
| 22 |
+
lifetimeSeconds?: number;
|
| 23 |
+
claims?: Record<string, unknown>;
|
| 24 |
+
}): AddClientAuthentication;
|
| 25 |
+
/**
|
| 26 |
+
* Options for creating a ClientCredentialsProvider.
|
| 27 |
+
*/
|
| 28 |
+
export interface ClientCredentialsProviderOptions {
|
| 29 |
+
/**
|
| 30 |
+
* The client_id for this OAuth client.
|
| 31 |
+
*/
|
| 32 |
+
clientId: string;
|
| 33 |
+
/**
|
| 34 |
+
* The client_secret for client_secret_basic authentication.
|
| 35 |
+
*/
|
| 36 |
+
clientSecret: string;
|
| 37 |
+
/**
|
| 38 |
+
* Optional client name for metadata.
|
| 39 |
+
*/
|
| 40 |
+
clientName?: string;
|
| 41 |
+
/**
|
| 42 |
+
* Space-separated scopes values requested by the client.
|
| 43 |
+
*/
|
| 44 |
+
scope?: string;
|
| 45 |
+
}
|
| 46 |
+
/**
|
| 47 |
+
* OAuth provider for client_credentials grant with client_secret_basic authentication.
|
| 48 |
+
*
|
| 49 |
+
* This provider is designed for machine-to-machine authentication where
|
| 50 |
+
* the client authenticates using a client_id and client_secret.
|
| 51 |
+
*
|
| 52 |
+
* @example
|
| 53 |
+
* const provider = new ClientCredentialsProvider({
|
| 54 |
+
* clientId: 'my-client',
|
| 55 |
+
* clientSecret: 'my-secret'
|
| 56 |
+
* });
|
| 57 |
+
*
|
| 58 |
+
* const transport = new StreamableHTTPClientTransport(serverUrl, {
|
| 59 |
+
* authProvider: provider
|
| 60 |
+
* });
|
| 61 |
+
*/
|
| 62 |
+
export declare class ClientCredentialsProvider implements OAuthClientProvider {
|
| 63 |
+
private _tokens?;
|
| 64 |
+
private _clientInfo;
|
| 65 |
+
private _clientMetadata;
|
| 66 |
+
constructor(options: ClientCredentialsProviderOptions);
|
| 67 |
+
get redirectUrl(): undefined;
|
| 68 |
+
get clientMetadata(): OAuthClientMetadata;
|
| 69 |
+
clientInformation(): OAuthClientInformation;
|
| 70 |
+
saveClientInformation(info: OAuthClientInformation): void;
|
| 71 |
+
tokens(): OAuthTokens | undefined;
|
| 72 |
+
saveTokens(tokens: OAuthTokens): void;
|
| 73 |
+
redirectToAuthorization(): void;
|
| 74 |
+
saveCodeVerifier(): void;
|
| 75 |
+
codeVerifier(): string;
|
| 76 |
+
prepareTokenRequest(scope?: string): URLSearchParams;
|
| 77 |
+
}
|
| 78 |
+
/**
|
| 79 |
+
* Options for creating a PrivateKeyJwtProvider.
|
| 80 |
+
*/
|
| 81 |
+
export interface PrivateKeyJwtProviderOptions {
|
| 82 |
+
/**
|
| 83 |
+
* The client_id for this OAuth client.
|
| 84 |
+
*/
|
| 85 |
+
clientId: string;
|
| 86 |
+
/**
|
| 87 |
+
* The private key for signing JWT assertions.
|
| 88 |
+
* Can be a PEM string, Uint8Array, or JWK object.
|
| 89 |
+
*/
|
| 90 |
+
privateKey: string | Uint8Array | Record<string, unknown>;
|
| 91 |
+
/**
|
| 92 |
+
* The algorithm to use for signing (e.g., 'RS256', 'ES256').
|
| 93 |
+
*/
|
| 94 |
+
algorithm: string;
|
| 95 |
+
/**
|
| 96 |
+
* Optional client name for metadata.
|
| 97 |
+
*/
|
| 98 |
+
clientName?: string;
|
| 99 |
+
/**
|
| 100 |
+
* Optional JWT lifetime in seconds (default: 300).
|
| 101 |
+
*/
|
| 102 |
+
jwtLifetimeSeconds?: number;
|
| 103 |
+
/**
|
| 104 |
+
* Space-separated scopes values requested by the client.
|
| 105 |
+
*/
|
| 106 |
+
scope?: string;
|
| 107 |
+
}
|
| 108 |
+
/**
|
| 109 |
+
* OAuth provider for client_credentials grant with private_key_jwt authentication.
|
| 110 |
+
*
|
| 111 |
+
* This provider is designed for machine-to-machine authentication where
|
| 112 |
+
* the client authenticates using a signed JWT assertion (RFC 7523 Section 2.2).
|
| 113 |
+
*
|
| 114 |
+
* @example
|
| 115 |
+
* const provider = new PrivateKeyJwtProvider({
|
| 116 |
+
* clientId: 'my-client',
|
| 117 |
+
* privateKey: pemEncodedPrivateKey,
|
| 118 |
+
* algorithm: 'RS256'
|
| 119 |
+
* });
|
| 120 |
+
*
|
| 121 |
+
* const transport = new StreamableHTTPClientTransport(serverUrl, {
|
| 122 |
+
* authProvider: provider
|
| 123 |
+
* });
|
| 124 |
+
*/
|
| 125 |
+
export declare class PrivateKeyJwtProvider implements OAuthClientProvider {
|
| 126 |
+
private _tokens?;
|
| 127 |
+
private _clientInfo;
|
| 128 |
+
private _clientMetadata;
|
| 129 |
+
addClientAuthentication: AddClientAuthentication;
|
| 130 |
+
constructor(options: PrivateKeyJwtProviderOptions);
|
| 131 |
+
get redirectUrl(): undefined;
|
| 132 |
+
get clientMetadata(): OAuthClientMetadata;
|
| 133 |
+
clientInformation(): OAuthClientInformation;
|
| 134 |
+
saveClientInformation(info: OAuthClientInformation): void;
|
| 135 |
+
tokens(): OAuthTokens | undefined;
|
| 136 |
+
saveTokens(tokens: OAuthTokens): void;
|
| 137 |
+
redirectToAuthorization(): void;
|
| 138 |
+
saveCodeVerifier(): void;
|
| 139 |
+
codeVerifier(): string;
|
| 140 |
+
prepareTokenRequest(scope?: string): URLSearchParams;
|
| 141 |
+
}
|
| 142 |
+
/**
|
| 143 |
+
* Options for creating a StaticPrivateKeyJwtProvider.
|
| 144 |
+
*/
|
| 145 |
+
export interface StaticPrivateKeyJwtProviderOptions {
|
| 146 |
+
/**
|
| 147 |
+
* The client_id for this OAuth client.
|
| 148 |
+
*/
|
| 149 |
+
clientId: string;
|
| 150 |
+
/**
|
| 151 |
+
* A pre-built JWT client assertion to use for authentication.
|
| 152 |
+
*
|
| 153 |
+
* This token should already contain the appropriate claims
|
| 154 |
+
* (iss, sub, aud, exp, etc.) and be signed by the client's key.
|
| 155 |
+
*/
|
| 156 |
+
jwtBearerAssertion: string;
|
| 157 |
+
/**
|
| 158 |
+
* Optional client name for metadata.
|
| 159 |
+
*/
|
| 160 |
+
clientName?: string;
|
| 161 |
+
/**
|
| 162 |
+
* Space-separated scopes values requested by the client.
|
| 163 |
+
*/
|
| 164 |
+
scope?: string;
|
| 165 |
+
}
|
| 166 |
+
/**
|
| 167 |
+
* OAuth provider for client_credentials grant with a static private_key_jwt assertion.
|
| 168 |
+
*
|
| 169 |
+
* This provider mirrors {@link PrivateKeyJwtProvider} but instead of constructing and
|
| 170 |
+
* signing a JWT on each request, it accepts a pre-built JWT assertion string and
|
| 171 |
+
* uses it directly for authentication.
|
| 172 |
+
*/
|
| 173 |
+
export declare class StaticPrivateKeyJwtProvider implements OAuthClientProvider {
|
| 174 |
+
private _tokens?;
|
| 175 |
+
private _clientInfo;
|
| 176 |
+
private _clientMetadata;
|
| 177 |
+
addClientAuthentication: AddClientAuthentication;
|
| 178 |
+
constructor(options: StaticPrivateKeyJwtProviderOptions);
|
| 179 |
+
get redirectUrl(): undefined;
|
| 180 |
+
get clientMetadata(): OAuthClientMetadata;
|
| 181 |
+
clientInformation(): OAuthClientInformation;
|
| 182 |
+
saveClientInformation(info: OAuthClientInformation): void;
|
| 183 |
+
tokens(): OAuthTokens | undefined;
|
| 184 |
+
saveTokens(tokens: OAuthTokens): void;
|
| 185 |
+
redirectToAuthorization(): void;
|
| 186 |
+
saveCodeVerifier(): void;
|
| 187 |
+
codeVerifier(): string;
|
| 188 |
+
prepareTokenRequest(scope?: string): URLSearchParams;
|
| 189 |
+
}
|
| 190 |
+
//# sourceMappingURL=auth-extensions.d.ts.map
|
node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth-extensions.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"auth-extensions.d.ts","sourceRoot":"","sources":["../../../src/client/auth-extensions.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAC7F,OAAO,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAEzE;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE;IAC7C,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,GAAG,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IA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ialized authentication flows.
|
| 3 |
+
*
|
| 4 |
+
* This module provides ready-to-use OAuthClientProvider implementations
|
| 5 |
+
* for common machine-to-machine authentication scenarios.
|
| 6 |
+
*/
|
| 7 |
+
/**
|
| 8 |
+
* Helper to produce a private_key_jwt client authentication function.
|
| 9 |
+
*
|
| 10 |
+
* Usage:
|
| 11 |
+
* const addClientAuth = createPrivateKeyJwtAuth({ issuer, subject, privateKey, alg, audience? });
|
| 12 |
+
* // pass addClientAuth as provider.addClientAuthentication implementation
|
| 13 |
+
*/
|
| 14 |
+
export function createPrivateKeyJwtAuth(options) {
|
| 15 |
+
return async (_headers, params, url, metadata) => {
|
| 16 |
+
// Lazy import to avoid heavy dependency unless used
|
| 17 |
+
if (typeof globalThis.crypto === 'undefined') {
|
| 18 |
+
throw new TypeError('crypto is not available, please ensure you add have Web Crypto API support for older Node.js versions (see https://github.com/modelcontextprotocol/typescript-sdk#nodejs-web-crypto-globalthiscrypto-compatibility)');
|
| 19 |
+
}
|
| 20 |
+
const jose = await import('jose');
|
| 21 |
+
const audience = String(options.audience ?? metadata?.issuer ?? url);
|
| 22 |
+
const lifetimeSeconds = options.lifetimeSeconds ?? 300;
|
| 23 |
+
const now = Math.floor(Date.now() / 1000);
|
| 24 |
+
const jti = `${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
| 25 |
+
const baseClaims = {
|
| 26 |
+
iss: options.issuer,
|
| 27 |
+
sub: options.subject,
|
| 28 |
+
aud: audience,
|
| 29 |
+
exp: now + lifetimeSeconds,
|
| 30 |
+
iat: now,
|
| 31 |
+
jti
|
| 32 |
+
};
|
| 33 |
+
const claims = options.claims ? { ...baseClaims, ...options.claims } : baseClaims;
|
| 34 |
+
// Import key for the requested algorithm
|
| 35 |
+
const alg = options.alg;
|
| 36 |
+
let key;
|
| 37 |
+
if (typeof options.privateKey === 'string') {
|
| 38 |
+
if (alg.startsWith('RS') || alg.startsWith('ES') || alg.startsWith('PS')) {
|
| 39 |
+
key = await jose.importPKCS8(options.privateKey, alg);
|
| 40 |
+
}
|
| 41 |
+
else if (alg.startsWith('HS')) {
|
| 42 |
+
key = new TextEncoder().encode(options.privateKey);
|
| 43 |
+
}
|
| 44 |
+
else {
|
| 45 |
+
throw new Error(`Unsupported algorithm ${alg}`);
|
| 46 |
+
}
|
| 47 |
+
}
|
| 48 |
+
else if (options.privateKey instanceof Uint8Array) {
|
| 49 |
+
if (alg.startsWith('HS')) {
|
| 50 |
+
key = options.privateKey;
|
| 51 |
+
}
|
| 52 |
+
else {
|
| 53 |
+
// Assume PKCS#8 DER in Uint8Array for asymmetric algorithms
|
| 54 |
+
key = await jose.importPKCS8(new TextDecoder().decode(options.privateKey), alg);
|
| 55 |
+
}
|
| 56 |
+
}
|
| 57 |
+
else {
|
| 58 |
+
// Treat as JWK
|
| 59 |
+
key = await jose.importJWK(options.privateKey, alg);
|
| 60 |
+
}
|
| 61 |
+
// Sign JWT
|
| 62 |
+
const assertion = await new jose.SignJWT(claims)
|
| 63 |
+
.setProtectedHeader({ alg, typ: 'JWT' })
|
| 64 |
+
.setIssuer(options.issuer)
|
| 65 |
+
.setSubject(options.subject)
|
| 66 |
+
.setAudience(audience)
|
| 67 |
+
.setIssuedAt(now)
|
| 68 |
+
.setExpirationTime(now + lifetimeSeconds)
|
| 69 |
+
.setJti(jti)
|
| 70 |
+
.sign(key);
|
| 71 |
+
params.set('client_assertion', assertion);
|
| 72 |
+
params.set('client_assertion_type', 'urn:ietf:params:oauth:client-assertion-type:jwt-bearer');
|
| 73 |
+
};
|
| 74 |
+
}
|
| 75 |
+
/**
|
| 76 |
+
* OAuth provider for client_credentials grant with client_secret_basic authentication.
|
| 77 |
+
*
|
| 78 |
+
* This provider is designed for machine-to-machine authentication where
|
| 79 |
+
* the client authenticates using a client_id and client_secret.
|
| 80 |
+
*
|
| 81 |
+
* @example
|
| 82 |
+
* const provider = new ClientCredentialsProvider({
|
| 83 |
+
* clientId: 'my-client',
|
| 84 |
+
* clientSecret: 'my-secret'
|
| 85 |
+
* });
|
| 86 |
+
*
|
| 87 |
+
* const transport = new StreamableHTTPClientTransport(serverUrl, {
|
| 88 |
+
* authProvider: provider
|
| 89 |
+
* });
|
| 90 |
+
*/
|
| 91 |
+
export class ClientCredentialsProvider {
|
| 92 |
+
constructor(options) {
|
| 93 |
+
this._clientInfo = {
|
| 94 |
+
client_id: options.clientId,
|
| 95 |
+
client_secret: options.clientSecret
|
| 96 |
+
};
|
| 97 |
+
this._clientMetadata = {
|
| 98 |
+
client_name: options.clientName ?? 'client-credentials-client',
|
| 99 |
+
redirect_uris: [],
|
| 100 |
+
grant_types: ['client_credentials'],
|
| 101 |
+
token_endpoint_auth_method: 'client_secret_basic',
|
| 102 |
+
scope: options.scope
|
| 103 |
+
};
|
| 104 |
+
}
|
| 105 |
+
get redirectUrl() {
|
| 106 |
+
return undefined;
|
| 107 |
+
}
|
| 108 |
+
get clientMetadata() {
|
| 109 |
+
return this._clientMetadata;
|
| 110 |
+
}
|
| 111 |
+
clientInformation() {
|
| 112 |
+
return this._clientInfo;
|
| 113 |
+
}
|
| 114 |
+
saveClientInformation(info) {
|
| 115 |
+
this._clientInfo = info;
|
| 116 |
+
}
|
| 117 |
+
tokens() {
|
| 118 |
+
return this._tokens;
|
| 119 |
+
}
|
| 120 |
+
saveTokens(tokens) {
|
| 121 |
+
this._tokens = tokens;
|
| 122 |
+
}
|
| 123 |
+
redirectToAuthorization() {
|
| 124 |
+
throw new Error('redirectToAuthorization is not used for client_credentials flow');
|
| 125 |
+
}
|
| 126 |
+
saveCodeVerifier() {
|
| 127 |
+
// Not used for client_credentials
|
| 128 |
+
}
|
| 129 |
+
codeVerifier() {
|
| 130 |
+
throw new Error('codeVerifier is not used for client_credentials flow');
|
| 131 |
+
}
|
| 132 |
+
prepareTokenRequest(scope) {
|
| 133 |
+
const params = new URLSearchParams({ grant_type: 'client_credentials' });
|
| 134 |
+
if (scope)
|
| 135 |
+
params.set('scope', scope);
|
| 136 |
+
return params;
|
| 137 |
+
}
|
| 138 |
+
}
|
| 139 |
+
/**
|
| 140 |
+
* OAuth provider for client_credentials grant with private_key_jwt authentication.
|
| 141 |
+
*
|
| 142 |
+
* This provider is designed for machine-to-machine authentication where
|
| 143 |
+
* the client authenticates using a signed JWT assertion (RFC 7523 Section 2.2).
|
| 144 |
+
*
|
| 145 |
+
* @example
|
| 146 |
+
* const provider = new PrivateKeyJwtProvider({
|
| 147 |
+
* clientId: 'my-client',
|
| 148 |
+
* privateKey: pemEncodedPrivateKey,
|
| 149 |
+
* algorithm: 'RS256'
|
| 150 |
+
* });
|
| 151 |
+
*
|
| 152 |
+
* const transport = new StreamableHTTPClientTransport(serverUrl, {
|
| 153 |
+
* authProvider: provider
|
| 154 |
+
* });
|
| 155 |
+
*/
|
| 156 |
+
export class PrivateKeyJwtProvider {
|
| 157 |
+
constructor(options) {
|
| 158 |
+
this._clientInfo = {
|
| 159 |
+
client_id: options.clientId
|
| 160 |
+
};
|
| 161 |
+
this._clientMetadata = {
|
| 162 |
+
client_name: options.clientName ?? 'private-key-jwt-client',
|
| 163 |
+
redirect_uris: [],
|
| 164 |
+
grant_types: ['client_credentials'],
|
| 165 |
+
token_endpoint_auth_method: 'private_key_jwt',
|
| 166 |
+
scope: options.scope
|
| 167 |
+
};
|
| 168 |
+
this.addClientAuthentication = createPrivateKeyJwtAuth({
|
| 169 |
+
issuer: options.clientId,
|
| 170 |
+
subject: options.clientId,
|
| 171 |
+
privateKey: options.privateKey,
|
| 172 |
+
alg: options.algorithm,
|
| 173 |
+
lifetimeSeconds: options.jwtLifetimeSeconds
|
| 174 |
+
});
|
| 175 |
+
}
|
| 176 |
+
get redirectUrl() {
|
| 177 |
+
return undefined;
|
| 178 |
+
}
|
| 179 |
+
get clientMetadata() {
|
| 180 |
+
return this._clientMetadata;
|
| 181 |
+
}
|
| 182 |
+
clientInformation() {
|
| 183 |
+
return this._clientInfo;
|
| 184 |
+
}
|
| 185 |
+
saveClientInformation(info) {
|
| 186 |
+
this._clientInfo = info;
|
| 187 |
+
}
|
| 188 |
+
tokens() {
|
| 189 |
+
return this._tokens;
|
| 190 |
+
}
|
| 191 |
+
saveTokens(tokens) {
|
| 192 |
+
this._tokens = tokens;
|
| 193 |
+
}
|
| 194 |
+
redirectToAuthorization() {
|
| 195 |
+
throw new Error('redirectToAuthorization is not used for client_credentials flow');
|
| 196 |
+
}
|
| 197 |
+
saveCodeVerifier() {
|
| 198 |
+
// Not used for client_credentials
|
| 199 |
+
}
|
| 200 |
+
codeVerifier() {
|
| 201 |
+
throw new Error('codeVerifier is not used for client_credentials flow');
|
| 202 |
+
}
|
| 203 |
+
prepareTokenRequest(scope) {
|
| 204 |
+
const params = new URLSearchParams({ grant_type: 'client_credentials' });
|
| 205 |
+
if (scope)
|
| 206 |
+
params.set('scope', scope);
|
| 207 |
+
return params;
|
| 208 |
+
}
|
| 209 |
+
}
|
| 210 |
+
/**
|
| 211 |
+
* OAuth provider for client_credentials grant with a static private_key_jwt assertion.
|
| 212 |
+
*
|
| 213 |
+
* This provider mirrors {@link PrivateKeyJwtProvider} but instead of constructing and
|
| 214 |
+
* signing a JWT on each request, it accepts a pre-built JWT assertion string and
|
| 215 |
+
* uses it directly for authentication.
|
| 216 |
+
*/
|
| 217 |
+
export class StaticPrivateKeyJwtProvider {
|
| 218 |
+
constructor(options) {
|
| 219 |
+
this._clientInfo = {
|
| 220 |
+
client_id: options.clientId
|
| 221 |
+
};
|
| 222 |
+
this._clientMetadata = {
|
| 223 |
+
client_name: options.clientName ?? 'static-private-key-jwt-client',
|
| 224 |
+
redirect_uris: [],
|
| 225 |
+
grant_types: ['client_credentials'],
|
| 226 |
+
token_endpoint_auth_method: 'private_key_jwt',
|
| 227 |
+
scope: options.scope
|
| 228 |
+
};
|
| 229 |
+
const assertion = options.jwtBearerAssertion;
|
| 230 |
+
this.addClientAuthentication = async (_headers, params) => {
|
| 231 |
+
params.set('client_assertion', assertion);
|
| 232 |
+
params.set('client_assertion_type', 'urn:ietf:params:oauth:client-assertion-type:jwt-bearer');
|
| 233 |
+
};
|
| 234 |
+
}
|
| 235 |
+
get redirectUrl() {
|
| 236 |
+
return undefined;
|
| 237 |
+
}
|
| 238 |
+
get clientMetadata() {
|
| 239 |
+
return this._clientMetadata;
|
| 240 |
+
}
|
| 241 |
+
clientInformation() {
|
| 242 |
+
return this._clientInfo;
|
| 243 |
+
}
|
| 244 |
+
saveClientInformation(info) {
|
| 245 |
+
this._clientInfo = info;
|
| 246 |
+
}
|
| 247 |
+
tokens() {
|
| 248 |
+
return this._tokens;
|
| 249 |
+
}
|
| 250 |
+
saveTokens(tokens) {
|
| 251 |
+
this._tokens = tokens;
|
| 252 |
+
}
|
| 253 |
+
redirectToAuthorization() {
|
| 254 |
+
throw new Error('redirectToAuthorization is not used for client_credentials flow');
|
| 255 |
+
}
|
| 256 |
+
saveCodeVerifier() {
|
| 257 |
+
// Not used for client_credentials
|
| 258 |
+
}
|
| 259 |
+
codeVerifier() {
|
| 260 |
+
throw new Error('codeVerifier is not used for client_credentials flow');
|
| 261 |
+
}
|
| 262 |
+
prepareTokenRequest(scope) {
|
| 263 |
+
const params = new URLSearchParams({ grant_type: 'client_credentials' });
|
| 264 |
+
if (scope)
|
| 265 |
+
params.set('scope', scope);
|
| 266 |
+
return params;
|
| 267 |
+
}
|
| 268 |
+
}
|
| 269 |
+
//# sourceMappingURL=auth-extensions.js.map
|
node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth-extensions.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"auth-extensions.js","sourceRoot":"","sources":["../../../src/client/auth-extensions.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH;;;;;;GAMG;AACH,MAAM,UAAU,uBAAuB,CAAC,OAQvC;IACG,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,EAAE;QAC7C,oDAAoD;QACpD,IAAI,OAAO,UAAU,CAAC,MAAM,KAAK,WAAW,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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { OAuthClientMetadata, OAuthClientInformationMixed, OAuthTokens, OAuthMetadata, OAuthClientInformationFull, OAuthProtectedResourceMetadata, AuthorizationServerMetadata } from '../shared/auth.js';
|
| 2 |
+
import { OAuthError } from '../server/auth/errors.js';
|
| 3 |
+
import { FetchLike } from '../shared/transport.js';
|
| 4 |
+
/**
|
| 5 |
+
* Function type for adding client authentication to token requests.
|
| 6 |
+
*/
|
| 7 |
+
export type AddClientAuthentication = (headers: Headers, params: URLSearchParams, url: string | URL, metadata?: AuthorizationServerMetadata) => void | Promise<void>;
|
| 8 |
+
/**
|
| 9 |
+
* Implements an end-to-end OAuth client to be used with one MCP server.
|
| 10 |
+
*
|
| 11 |
+
* This client relies upon a concept of an authorized "session," the exact
|
| 12 |
+
* meaning of which is application-defined. Tokens, authorization codes, and
|
| 13 |
+
* code verifiers should not cross different sessions.
|
| 14 |
+
*/
|
| 15 |
+
export interface OAuthClientProvider {
|
| 16 |
+
/**
|
| 17 |
+
* The URL to redirect the user agent to after authorization.
|
| 18 |
+
* Return undefined for non-interactive flows that don't require user interaction
|
| 19 |
+
* (e.g., client_credentials, jwt-bearer).
|
| 20 |
+
*/
|
| 21 |
+
get redirectUrl(): string | URL | undefined;
|
| 22 |
+
/**
|
| 23 |
+
* External URL the server should use to fetch client metadata document
|
| 24 |
+
*/
|
| 25 |
+
clientMetadataUrl?: string;
|
| 26 |
+
/**
|
| 27 |
+
* Metadata about this OAuth client.
|
| 28 |
+
*/
|
| 29 |
+
get clientMetadata(): OAuthClientMetadata;
|
| 30 |
+
/**
|
| 31 |
+
* Returns a OAuth2 state parameter.
|
| 32 |
+
*/
|
| 33 |
+
state?(): string | Promise<string>;
|
| 34 |
+
/**
|
| 35 |
+
* Loads information about this OAuth client, as registered already with the
|
| 36 |
+
* server, or returns `undefined` if the client is not registered with the
|
| 37 |
+
* server.
|
| 38 |
+
*/
|
| 39 |
+
clientInformation(): OAuthClientInformationMixed | undefined | Promise<OAuthClientInformationMixed | undefined>;
|
| 40 |
+
/**
|
| 41 |
+
* If implemented, this permits the OAuth client to dynamically register with
|
| 42 |
+
* the server. Client information saved this way should later be read via
|
| 43 |
+
* `clientInformation()`.
|
| 44 |
+
*
|
| 45 |
+
* This method is not required to be implemented if client information is
|
| 46 |
+
* statically known (e.g., pre-registered).
|
| 47 |
+
*/
|
| 48 |
+
saveClientInformation?(clientInformation: OAuthClientInformationMixed): void | Promise<void>;
|
| 49 |
+
/**
|
| 50 |
+
* Loads any existing OAuth tokens for the current session, or returns
|
| 51 |
+
* `undefined` if there are no saved tokens.
|
| 52 |
+
*/
|
| 53 |
+
tokens(): OAuthTokens | undefined | Promise<OAuthTokens | undefined>;
|
| 54 |
+
/**
|
| 55 |
+
* Stores new OAuth tokens for the current session, after a successful
|
| 56 |
+
* authorization.
|
| 57 |
+
*/
|
| 58 |
+
saveTokens(tokens: OAuthTokens): void | Promise<void>;
|
| 59 |
+
/**
|
| 60 |
+
* Invoked to redirect the user agent to the given URL to begin the authorization flow.
|
| 61 |
+
*/
|
| 62 |
+
redirectToAuthorization(authorizationUrl: URL): void | Promise<void>;
|
| 63 |
+
/**
|
| 64 |
+
* Saves a PKCE code verifier for the current session, before redirecting to
|
| 65 |
+
* the authorization flow.
|
| 66 |
+
*/
|
| 67 |
+
saveCodeVerifier(codeVerifier: string): void | Promise<void>;
|
| 68 |
+
/**
|
| 69 |
+
* Loads the PKCE code verifier for the current session, necessary to validate
|
| 70 |
+
* the authorization result.
|
| 71 |
+
*/
|
| 72 |
+
codeVerifier(): string | Promise<string>;
|
| 73 |
+
/**
|
| 74 |
+
* Adds custom client authentication to OAuth token requests.
|
| 75 |
+
*
|
| 76 |
+
* This optional method allows implementations to customize how client credentials
|
| 77 |
+
* are included in token exchange and refresh requests. When provided, this method
|
| 78 |
+
* is called instead of the default authentication logic, giving full control over
|
| 79 |
+
* the authentication mechanism.
|
| 80 |
+
*
|
| 81 |
+
* Common use cases include:
|
| 82 |
+
* - Supporting authentication methods beyond the standard OAuth 2.0 methods
|
| 83 |
+
* - Adding custom headers for proprietary authentication schemes
|
| 84 |
+
* - Implementing client assertion-based authentication (e.g., JWT bearer tokens)
|
| 85 |
+
*
|
| 86 |
+
* @param headers - The request headers (can be modified to add authentication)
|
| 87 |
+
* @param params - The request body parameters (can be modified to add credentials)
|
| 88 |
+
* @param url - The token endpoint URL being called
|
| 89 |
+
* @param metadata - Optional OAuth metadata for the server, which may include supported authentication methods
|
| 90 |
+
*/
|
| 91 |
+
addClientAuthentication?: AddClientAuthentication;
|
| 92 |
+
/**
|
| 93 |
+
* If defined, overrides the selection and validation of the
|
| 94 |
+
* RFC 8707 Resource Indicator. If left undefined, default
|
| 95 |
+
* validation behavior will be used.
|
| 96 |
+
*
|
| 97 |
+
* Implementations must verify the returned resource matches the MCP server.
|
| 98 |
+
*/
|
| 99 |
+
validateResourceURL?(serverUrl: string | URL, resource?: string): Promise<URL | undefined>;
|
| 100 |
+
/**
|
| 101 |
+
* If implemented, provides a way for the client to invalidate (e.g. delete) the specified
|
| 102 |
+
* credentials, in the case where the server has indicated that they are no longer valid.
|
| 103 |
+
* This avoids requiring the user to intervene manually.
|
| 104 |
+
*/
|
| 105 |
+
invalidateCredentials?(scope: 'all' | 'client' | 'tokens' | 'verifier' | 'discovery'): void | Promise<void>;
|
| 106 |
+
/**
|
| 107 |
+
* Prepares grant-specific parameters for a token request.
|
| 108 |
+
*
|
| 109 |
+
* This optional method allows providers to customize the token request based on
|
| 110 |
+
* the grant type they support. When implemented, it returns the grant type and
|
| 111 |
+
* any grant-specific parameters needed for the token exchange.
|
| 112 |
+
*
|
| 113 |
+
* If not implemented, the default behavior depends on the flow:
|
| 114 |
+
* - For authorization code flow: uses code, code_verifier, and redirect_uri
|
| 115 |
+
* - For client_credentials: detected via grant_types in clientMetadata
|
| 116 |
+
*
|
| 117 |
+
* @param scope - Optional scope to request
|
| 118 |
+
* @returns Grant type and parameters, or undefined to use default behavior
|
| 119 |
+
*
|
| 120 |
+
* @example
|
| 121 |
+
* // For client_credentials grant:
|
| 122 |
+
* prepareTokenRequest(scope) {
|
| 123 |
+
* return {
|
| 124 |
+
* grantType: 'client_credentials',
|
| 125 |
+
* params: scope ? { scope } : {}
|
| 126 |
+
* };
|
| 127 |
+
* }
|
| 128 |
+
*
|
| 129 |
+
* @example
|
| 130 |
+
* // For authorization_code grant (default behavior):
|
| 131 |
+
* async prepareTokenRequest() {
|
| 132 |
+
* return {
|
| 133 |
+
* grantType: 'authorization_code',
|
| 134 |
+
* params: {
|
| 135 |
+
* code: this.authorizationCode,
|
| 136 |
+
* code_verifier: await this.codeVerifier(),
|
| 137 |
+
* redirect_uri: String(this.redirectUrl)
|
| 138 |
+
* }
|
| 139 |
+
* };
|
| 140 |
+
* }
|
| 141 |
+
*/
|
| 142 |
+
prepareTokenRequest?(scope?: string): URLSearchParams | Promise<URLSearchParams | undefined> | undefined;
|
| 143 |
+
/**
|
| 144 |
+
* Saves the OAuth discovery state after RFC 9728 and authorization server metadata
|
| 145 |
+
* discovery. Providers can persist this state to avoid redundant discovery requests
|
| 146 |
+
* on subsequent {@linkcode auth} calls.
|
| 147 |
+
*
|
| 148 |
+
* This state can also be provided out-of-band (e.g., from a previous session or
|
| 149 |
+
* external configuration) to bootstrap the OAuth flow without discovery.
|
| 150 |
+
*
|
| 151 |
+
* Called by {@linkcode auth} after successful discovery.
|
| 152 |
+
*/
|
| 153 |
+
saveDiscoveryState?(state: OAuthDiscoveryState): void | Promise<void>;
|
| 154 |
+
/**
|
| 155 |
+
* Returns previously saved discovery state, or `undefined` if none is cached.
|
| 156 |
+
*
|
| 157 |
+
* When available, {@linkcode auth} restores the discovery state (authorization server
|
| 158 |
+
* URL, resource metadata, etc.) instead of performing RFC 9728 discovery, reducing
|
| 159 |
+
* latency on subsequent calls.
|
| 160 |
+
*
|
| 161 |
+
* Providers should clear cached discovery state on repeated authentication failures
|
| 162 |
+
* (via {@linkcode invalidateCredentials} with scope `'discovery'` or `'all'`) to allow
|
| 163 |
+
* re-discovery in case the authorization server has changed.
|
| 164 |
+
*/
|
| 165 |
+
discoveryState?(): OAuthDiscoveryState | undefined | Promise<OAuthDiscoveryState | undefined>;
|
| 166 |
+
}
|
| 167 |
+
/**
|
| 168 |
+
* Discovery state that can be persisted across sessions by an {@linkcode OAuthClientProvider}.
|
| 169 |
+
*
|
| 170 |
+
* Contains the results of RFC 9728 protected resource metadata discovery and
|
| 171 |
+
* authorization server metadata discovery. Persisting this state avoids
|
| 172 |
+
* redundant discovery HTTP requests on subsequent {@linkcode auth} calls.
|
| 173 |
+
*/
|
| 174 |
+
export interface OAuthDiscoveryState extends OAuthServerInfo {
|
| 175 |
+
/** The URL at which the protected resource metadata was found, if available. */
|
| 176 |
+
resourceMetadataUrl?: string;
|
| 177 |
+
}
|
| 178 |
+
export type AuthResult = 'AUTHORIZED' | 'REDIRECT';
|
| 179 |
+
export declare class UnauthorizedError extends Error {
|
| 180 |
+
constructor(message?: string);
|
| 181 |
+
}
|
| 182 |
+
type ClientAuthMethod = 'client_secret_basic' | 'client_secret_post' | 'none';
|
| 183 |
+
/**
|
| 184 |
+
* Determines the best client authentication method to use based on server support and client configuration.
|
| 185 |
+
*
|
| 186 |
+
* Priority order (highest to lowest):
|
| 187 |
+
* 1. client_secret_basic (if client secret is available)
|
| 188 |
+
* 2. client_secret_post (if client secret is available)
|
| 189 |
+
* 3. none (for public clients)
|
| 190 |
+
*
|
| 191 |
+
* @param clientInformation - OAuth client information containing credentials
|
| 192 |
+
* @param supportedMethods - Authentication methods supported by the authorization server
|
| 193 |
+
* @returns The selected authentication method
|
| 194 |
+
*/
|
| 195 |
+
export declare function selectClientAuthMethod(clientInformation: OAuthClientInformationMixed, supportedMethods: string[]): ClientAuthMethod;
|
| 196 |
+
/**
|
| 197 |
+
* Parses an OAuth error response from a string or Response object.
|
| 198 |
+
*
|
| 199 |
+
* If the input is a standard OAuth2.0 error response, it will be parsed according to the spec
|
| 200 |
+
* and an instance of the appropriate OAuthError subclass will be returned.
|
| 201 |
+
* If parsing fails, it falls back to a generic ServerError that includes
|
| 202 |
+
* the response status (if available) and original content.
|
| 203 |
+
*
|
| 204 |
+
* @param input - A Response object or string containing the error response
|
| 205 |
+
* @returns A Promise that resolves to an OAuthError instance
|
| 206 |
+
*/
|
| 207 |
+
export declare function parseErrorResponse(input: Response | string): Promise<OAuthError>;
|
| 208 |
+
/**
|
| 209 |
+
* Orchestrates the full auth flow with a server.
|
| 210 |
+
*
|
| 211 |
+
* This can be used as a single entry point for all authorization functionality,
|
| 212 |
+
* instead of linking together the other lower-level functions in this module.
|
| 213 |
+
*/
|
| 214 |
+
export declare function auth(provider: OAuthClientProvider, options: {
|
| 215 |
+
serverUrl: string | URL;
|
| 216 |
+
authorizationCode?: string;
|
| 217 |
+
scope?: string;
|
| 218 |
+
resourceMetadataUrl?: URL;
|
| 219 |
+
fetchFn?: FetchLike;
|
| 220 |
+
}): Promise<AuthResult>;
|
| 221 |
+
/**
|
| 222 |
+
* SEP-991: URL-based Client IDs
|
| 223 |
+
* Validate that the client_id is a valid URL with https scheme
|
| 224 |
+
*/
|
| 225 |
+
export declare function isHttpsUrl(value?: string): boolean;
|
| 226 |
+
export declare function selectResourceURL(serverUrl: string | URL, provider: OAuthClientProvider, resourceMetadata?: OAuthProtectedResourceMetadata): Promise<URL | undefined>;
|
| 227 |
+
/**
|
| 228 |
+
* Extract resource_metadata, scope, and error from WWW-Authenticate header.
|
| 229 |
+
*/
|
| 230 |
+
export declare function extractWWWAuthenticateParams(res: Response): {
|
| 231 |
+
resourceMetadataUrl?: URL;
|
| 232 |
+
scope?: string;
|
| 233 |
+
error?: string;
|
| 234 |
+
};
|
| 235 |
+
/**
|
| 236 |
+
* Extract resource_metadata from response header.
|
| 237 |
+
* @deprecated Use `extractWWWAuthenticateParams` instead.
|
| 238 |
+
*/
|
| 239 |
+
export declare function extractResourceMetadataUrl(res: Response): URL | undefined;
|
| 240 |
+
/**
|
| 241 |
+
* Looks up RFC 9728 OAuth 2.0 Protected Resource Metadata.
|
| 242 |
+
*
|
| 243 |
+
* If the server returns a 404 for the well-known endpoint, this function will
|
| 244 |
+
* return `undefined`. Any other errors will be thrown as exceptions.
|
| 245 |
+
*/
|
| 246 |
+
export declare function discoverOAuthProtectedResourceMetadata(serverUrl: string | URL, opts?: {
|
| 247 |
+
protocolVersion?: string;
|
| 248 |
+
resourceMetadataUrl?: string | URL;
|
| 249 |
+
}, fetchFn?: FetchLike): Promise<OAuthProtectedResourceMetadata>;
|
| 250 |
+
/**
|
| 251 |
+
* Looks up RFC 8414 OAuth 2.0 Authorization Server Metadata.
|
| 252 |
+
*
|
| 253 |
+
* If the server returns a 404 for the well-known endpoint, this function will
|
| 254 |
+
* return `undefined`. Any other errors will be thrown as exceptions.
|
| 255 |
+
*
|
| 256 |
+
* @deprecated This function is deprecated in favor of `discoverAuthorizationServerMetadata`.
|
| 257 |
+
*/
|
| 258 |
+
export declare function discoverOAuthMetadata(issuer: string | URL, { authorizationServerUrl, protocolVersion }?: {
|
| 259 |
+
authorizationServerUrl?: string | URL;
|
| 260 |
+
protocolVersion?: string;
|
| 261 |
+
}, fetchFn?: FetchLike): Promise<OAuthMetadata | undefined>;
|
| 262 |
+
/**
|
| 263 |
+
* Builds a list of discovery URLs to try for authorization server metadata.
|
| 264 |
+
* URLs are returned in priority order:
|
| 265 |
+
* 1. OAuth metadata at the given URL
|
| 266 |
+
* 2. OIDC metadata endpoints at the given URL
|
| 267 |
+
*/
|
| 268 |
+
export declare function buildDiscoveryUrls(authorizationServerUrl: string | URL): {
|
| 269 |
+
url: URL;
|
| 270 |
+
type: 'oauth' | 'oidc';
|
| 271 |
+
}[];
|
| 272 |
+
/**
|
| 273 |
+
* Discovers authorization server metadata with support for RFC 8414 OAuth 2.0 Authorization Server Metadata
|
| 274 |
+
* and OpenID Connect Discovery 1.0 specifications.
|
| 275 |
+
*
|
| 276 |
+
* This function implements a fallback strategy for authorization server discovery:
|
| 277 |
+
* 1. Attempts RFC 8414 OAuth metadata discovery first
|
| 278 |
+
* 2. If OAuth discovery fails, falls back to OpenID Connect Discovery
|
| 279 |
+
*
|
| 280 |
+
* @param authorizationServerUrl - The authorization server URL obtained from the MCP Server's
|
| 281 |
+
* protected resource metadata, or the MCP server's URL if the
|
| 282 |
+
* metadata was not found.
|
| 283 |
+
* @param options - Configuration options
|
| 284 |
+
* @param options.fetchFn - Optional fetch function for making HTTP requests, defaults to global fetch
|
| 285 |
+
* @param options.protocolVersion - MCP protocol version to use, defaults to LATEST_PROTOCOL_VERSION
|
| 286 |
+
* @returns Promise resolving to authorization server metadata, or undefined if discovery fails
|
| 287 |
+
*/
|
| 288 |
+
export declare function discoverAuthorizationServerMetadata(authorizationServerUrl: string | URL, { fetchFn, protocolVersion }?: {
|
| 289 |
+
fetchFn?: FetchLike;
|
| 290 |
+
protocolVersion?: string;
|
| 291 |
+
}): Promise<AuthorizationServerMetadata | undefined>;
|
| 292 |
+
/**
|
| 293 |
+
* Result of {@linkcode discoverOAuthServerInfo}.
|
| 294 |
+
*/
|
| 295 |
+
export interface OAuthServerInfo {
|
| 296 |
+
/**
|
| 297 |
+
* The authorization server URL, either discovered via RFC 9728
|
| 298 |
+
* or derived from the MCP server URL as a fallback.
|
| 299 |
+
*/
|
| 300 |
+
authorizationServerUrl: string;
|
| 301 |
+
/**
|
| 302 |
+
* The authorization server metadata (endpoints, capabilities),
|
| 303 |
+
* or `undefined` if metadata discovery failed.
|
| 304 |
+
*/
|
| 305 |
+
authorizationServerMetadata?: AuthorizationServerMetadata;
|
| 306 |
+
/**
|
| 307 |
+
* The OAuth 2.0 Protected Resource Metadata from RFC 9728,
|
| 308 |
+
* or `undefined` if the server does not support it.
|
| 309 |
+
*/
|
| 310 |
+
resourceMetadata?: OAuthProtectedResourceMetadata;
|
| 311 |
+
}
|
| 312 |
+
/**
|
| 313 |
+
* Discovers the authorization server for an MCP server following
|
| 314 |
+
* {@link https://datatracker.ietf.org/doc/html/rfc9728 | RFC 9728} (OAuth 2.0 Protected
|
| 315 |
+
* Resource Metadata), with fallback to treating the server URL as the
|
| 316 |
+
* authorization server.
|
| 317 |
+
*
|
| 318 |
+
* This function combines two discovery steps into one call:
|
| 319 |
+
* 1. Probes `/.well-known/oauth-protected-resource` on the MCP server to find the
|
| 320 |
+
* authorization server URL (RFC 9728).
|
| 321 |
+
* 2. Fetches authorization server metadata from that URL (RFC 8414 / OpenID Connect Discovery).
|
| 322 |
+
*
|
| 323 |
+
* Use this when you need the authorization server metadata for operations outside the
|
| 324 |
+
* {@linkcode auth} orchestrator, such as token refresh or token revocation.
|
| 325 |
+
*
|
| 326 |
+
* @param serverUrl - The MCP resource server URL
|
| 327 |
+
* @param opts - Optional configuration
|
| 328 |
+
* @param opts.resourceMetadataUrl - Override URL for the protected resource metadata endpoint
|
| 329 |
+
* @param opts.fetchFn - Custom fetch function for HTTP requests
|
| 330 |
+
* @returns Authorization server URL, metadata, and resource metadata (if available)
|
| 331 |
+
*/
|
| 332 |
+
export declare function discoverOAuthServerInfo(serverUrl: string | URL, opts?: {
|
| 333 |
+
resourceMetadataUrl?: URL;
|
| 334 |
+
fetchFn?: FetchLike;
|
| 335 |
+
}): Promise<OAuthServerInfo>;
|
| 336 |
+
/**
|
| 337 |
+
* Begins the authorization flow with the given server, by generating a PKCE challenge and constructing the authorization URL.
|
| 338 |
+
*/
|
| 339 |
+
export declare function startAuthorization(authorizationServerUrl: string | URL, { metadata, clientInformation, redirectUrl, scope, state, resource }: {
|
| 340 |
+
metadata?: AuthorizationServerMetadata;
|
| 341 |
+
clientInformation: OAuthClientInformationMixed;
|
| 342 |
+
redirectUrl: string | URL;
|
| 343 |
+
scope?: string;
|
| 344 |
+
state?: string;
|
| 345 |
+
resource?: URL;
|
| 346 |
+
}): Promise<{
|
| 347 |
+
authorizationUrl: URL;
|
| 348 |
+
codeVerifier: string;
|
| 349 |
+
}>;
|
| 350 |
+
/**
|
| 351 |
+
* Prepares token request parameters for an authorization code exchange.
|
| 352 |
+
*
|
| 353 |
+
* This is the default implementation used by fetchToken when the provider
|
| 354 |
+
* doesn't implement prepareTokenRequest.
|
| 355 |
+
*
|
| 356 |
+
* @param authorizationCode - The authorization code received from the authorization endpoint
|
| 357 |
+
* @param codeVerifier - The PKCE code verifier
|
| 358 |
+
* @param redirectUri - The redirect URI used in the authorization request
|
| 359 |
+
* @returns URLSearchParams for the authorization_code grant
|
| 360 |
+
*/
|
| 361 |
+
export declare function prepareAuthorizationCodeRequest(authorizationCode: string, codeVerifier: string, redirectUri: string | URL): URLSearchParams;
|
| 362 |
+
/**
|
| 363 |
+
* Exchanges an authorization code for an access token with the given server.
|
| 364 |
+
*
|
| 365 |
+
* Supports multiple client authentication methods as specified in OAuth 2.1:
|
| 366 |
+
* - Automatically selects the best authentication method based on server support
|
| 367 |
+
* - Falls back to appropriate defaults when server metadata is unavailable
|
| 368 |
+
*
|
| 369 |
+
* @param authorizationServerUrl - The authorization server's base URL
|
| 370 |
+
* @param options - Configuration object containing client info, auth code, etc.
|
| 371 |
+
* @returns Promise resolving to OAuth tokens
|
| 372 |
+
* @throws {Error} When token exchange fails or authentication is invalid
|
| 373 |
+
*/
|
| 374 |
+
export declare function exchangeAuthorization(authorizationServerUrl: string | URL, { metadata, clientInformation, authorizationCode, codeVerifier, redirectUri, resource, addClientAuthentication, fetchFn }: {
|
| 375 |
+
metadata?: AuthorizationServerMetadata;
|
| 376 |
+
clientInformation: OAuthClientInformationMixed;
|
| 377 |
+
authorizationCode: string;
|
| 378 |
+
codeVerifier: string;
|
| 379 |
+
redirectUri: string | URL;
|
| 380 |
+
resource?: URL;
|
| 381 |
+
addClientAuthentication?: OAuthClientProvider['addClientAuthentication'];
|
| 382 |
+
fetchFn?: FetchLike;
|
| 383 |
+
}): Promise<OAuthTokens>;
|
| 384 |
+
/**
|
| 385 |
+
* Exchange a refresh token for an updated access token.
|
| 386 |
+
*
|
| 387 |
+
* Supports multiple client authentication methods as specified in OAuth 2.1:
|
| 388 |
+
* - Automatically selects the best authentication method based on server support
|
| 389 |
+
* - Preserves the original refresh token if a new one is not returned
|
| 390 |
+
*
|
| 391 |
+
* @param authorizationServerUrl - The authorization server's base URL
|
| 392 |
+
* @param options - Configuration object containing client info, refresh token, etc.
|
| 393 |
+
* @returns Promise resolving to OAuth tokens (preserves original refresh_token if not replaced)
|
| 394 |
+
* @throws {Error} When token refresh fails or authentication is invalid
|
| 395 |
+
*/
|
| 396 |
+
export declare function refreshAuthorization(authorizationServerUrl: string | URL, { metadata, clientInformation, refreshToken, resource, addClientAuthentication, fetchFn }: {
|
| 397 |
+
metadata?: AuthorizationServerMetadata;
|
| 398 |
+
clientInformation: OAuthClientInformationMixed;
|
| 399 |
+
refreshToken: string;
|
| 400 |
+
resource?: URL;
|
| 401 |
+
addClientAuthentication?: OAuthClientProvider['addClientAuthentication'];
|
| 402 |
+
fetchFn?: FetchLike;
|
| 403 |
+
}): Promise<OAuthTokens>;
|
| 404 |
+
/**
|
| 405 |
+
* Unified token fetching that works with any grant type via provider.prepareTokenRequest().
|
| 406 |
+
*
|
| 407 |
+
* This function provides a single entry point for obtaining tokens regardless of the
|
| 408 |
+
* OAuth grant type. The provider's prepareTokenRequest() method determines which grant
|
| 409 |
+
* to use and supplies the grant-specific parameters.
|
| 410 |
+
*
|
| 411 |
+
* @param provider - OAuth client provider that implements prepareTokenRequest()
|
| 412 |
+
* @param authorizationServerUrl - The authorization server's base URL
|
| 413 |
+
* @param options - Configuration for the token request
|
| 414 |
+
* @returns Promise resolving to OAuth tokens
|
| 415 |
+
* @throws {Error} When provider doesn't implement prepareTokenRequest or token fetch fails
|
| 416 |
+
*
|
| 417 |
+
* @example
|
| 418 |
+
* // Provider for client_credentials:
|
| 419 |
+
* class MyProvider implements OAuthClientProvider {
|
| 420 |
+
* prepareTokenRequest(scope) {
|
| 421 |
+
* const params = new URLSearchParams({ grant_type: 'client_credentials' });
|
| 422 |
+
* if (scope) params.set('scope', scope);
|
| 423 |
+
* return params;
|
| 424 |
+
* }
|
| 425 |
+
* // ... other methods
|
| 426 |
+
* }
|
| 427 |
+
*
|
| 428 |
+
* const tokens = await fetchToken(provider, authServerUrl, { metadata });
|
| 429 |
+
*/
|
| 430 |
+
export declare function fetchToken(provider: OAuthClientProvider, authorizationServerUrl: string | URL, { metadata, resource, authorizationCode, fetchFn }?: {
|
| 431 |
+
metadata?: AuthorizationServerMetadata;
|
| 432 |
+
resource?: URL;
|
| 433 |
+
/** Authorization code for the default authorization_code grant flow */
|
| 434 |
+
authorizationCode?: string;
|
| 435 |
+
fetchFn?: FetchLike;
|
| 436 |
+
}): Promise<OAuthTokens>;
|
| 437 |
+
/**
|
| 438 |
+
* Performs OAuth 2.0 Dynamic Client Registration according to RFC 7591.
|
| 439 |
+
*
|
| 440 |
+
* If `scope` is provided, it overrides `clientMetadata.scope` in the registration
|
| 441 |
+
* request body. This allows callers to apply the Scope Selection Strategy (SEP-835)
|
| 442 |
+
* consistently across both DCR and the subsequent authorization request.
|
| 443 |
+
*/
|
| 444 |
+
export declare function registerClient(authorizationServerUrl: string | URL, { metadata, clientMetadata, scope, fetchFn }: {
|
| 445 |
+
metadata?: AuthorizationServerMetadata;
|
| 446 |
+
clientMetadata: OAuthClientMetadata;
|
| 447 |
+
scope?: string;
|
| 448 |
+
fetchFn?: FetchLike;
|
| 449 |
+
}): Promise<OAuthClientInformationFull>;
|
| 450 |
+
export {};
|
| 451 |
+
//# sourceMappingURL=auth.d.ts.map
|
node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import pkceChallenge from 'pkce-challenge';
|
| 2 |
+
import { LATEST_PROTOCOL_VERSION } from '../types.js';
|
| 3 |
+
import { OAuthErrorResponseSchema, OpenIdProviderDiscoveryMetadataSchema } from '../shared/auth.js';
|
| 4 |
+
import { OAuthClientInformationFullSchema, OAuthMetadataSchema, OAuthProtectedResourceMetadataSchema, OAuthTokensSchema } from '../shared/auth.js';
|
| 5 |
+
import { checkResourceAllowed, resourceUrlFromServerUrl } from '../shared/auth-utils.js';
|
| 6 |
+
import { InvalidClientError, InvalidClientMetadataError, InvalidGrantError, OAUTH_ERRORS, OAuthError, ServerError, UnauthorizedClientError } from '../server/auth/errors.js';
|
| 7 |
+
export class UnauthorizedError extends Error {
|
| 8 |
+
constructor(message) {
|
| 9 |
+
super(message ?? 'Unauthorized');
|
| 10 |
+
}
|
| 11 |
+
}
|
| 12 |
+
function isClientAuthMethod(method) {
|
| 13 |
+
return ['client_secret_basic', 'client_secret_post', 'none'].includes(method);
|
| 14 |
+
}
|
| 15 |
+
const AUTHORIZATION_CODE_RESPONSE_TYPE = 'code';
|
| 16 |
+
const AUTHORIZATION_CODE_CHALLENGE_METHOD = 'S256';
|
| 17 |
+
/**
|
| 18 |
+
* Determines the best client authentication method to use based on server support and client configuration.
|
| 19 |
+
*
|
| 20 |
+
* Priority order (highest to lowest):
|
| 21 |
+
* 1. client_secret_basic (if client secret is available)
|
| 22 |
+
* 2. client_secret_post (if client secret is available)
|
| 23 |
+
* 3. none (for public clients)
|
| 24 |
+
*
|
| 25 |
+
* @param clientInformation - OAuth client information containing credentials
|
| 26 |
+
* @param supportedMethods - Authentication methods supported by the authorization server
|
| 27 |
+
* @returns The selected authentication method
|
| 28 |
+
*/
|
| 29 |
+
export function selectClientAuthMethod(clientInformation, supportedMethods) {
|
| 30 |
+
const hasClientSecret = clientInformation.client_secret !== undefined;
|
| 31 |
+
// Prefer the method returned by the server during client registration, if valid.
|
| 32 |
+
// When server metadata is present we also require the method to be listed as supported;
|
| 33 |
+
// when supportedMethods is empty (metadata omitted the field) the DCR hint stands alone.
|
| 34 |
+
if ('token_endpoint_auth_method' in clientInformation &&
|
| 35 |
+
clientInformation.token_endpoint_auth_method &&
|
| 36 |
+
isClientAuthMethod(clientInformation.token_endpoint_auth_method) &&
|
| 37 |
+
(supportedMethods.length === 0 || supportedMethods.includes(clientInformation.token_endpoint_auth_method))) {
|
| 38 |
+
return clientInformation.token_endpoint_auth_method;
|
| 39 |
+
}
|
| 40 |
+
// If server metadata omits token_endpoint_auth_methods_supported, RFC 8414 §2 says the
|
| 41 |
+
// default is client_secret_basic. RFC 6749 §2.3.1 also requires servers to support HTTP
|
| 42 |
+
// Basic authentication for clients with a secret, making it the safest default.
|
| 43 |
+
if (supportedMethods.length === 0) {
|
| 44 |
+
return hasClientSecret ? 'client_secret_basic' : 'none';
|
| 45 |
+
}
|
| 46 |
+
// Try methods in priority order (most secure first)
|
| 47 |
+
if (hasClientSecret && supportedMethods.includes('client_secret_basic')) {
|
| 48 |
+
return 'client_secret_basic';
|
| 49 |
+
}
|
| 50 |
+
if (hasClientSecret && supportedMethods.includes('client_secret_post')) {
|
| 51 |
+
return 'client_secret_post';
|
| 52 |
+
}
|
| 53 |
+
if (supportedMethods.includes('none')) {
|
| 54 |
+
return 'none';
|
| 55 |
+
}
|
| 56 |
+
// Fallback: use what we have
|
| 57 |
+
return hasClientSecret ? 'client_secret_post' : 'none';
|
| 58 |
+
}
|
| 59 |
+
/**
|
| 60 |
+
* Applies client authentication to the request based on the specified method.
|
| 61 |
+
*
|
| 62 |
+
* Implements OAuth 2.1 client authentication methods:
|
| 63 |
+
* - client_secret_basic: HTTP Basic authentication (RFC 6749 Section 2.3.1)
|
| 64 |
+
* - client_secret_post: Credentials in request body (RFC 6749 Section 2.3.1)
|
| 65 |
+
* - none: Public client authentication (RFC 6749 Section 2.1)
|
| 66 |
+
*
|
| 67 |
+
* @param method - The authentication method to use
|
| 68 |
+
* @param clientInformation - OAuth client information containing credentials
|
| 69 |
+
* @param headers - HTTP headers object to modify
|
| 70 |
+
* @param params - URL search parameters to modify
|
| 71 |
+
* @throws {Error} When required credentials are missing
|
| 72 |
+
*/
|
| 73 |
+
function applyClientAuthentication(method, clientInformation, headers, params) {
|
| 74 |
+
const { client_id, client_secret } = clientInformation;
|
| 75 |
+
switch (method) {
|
| 76 |
+
case 'client_secret_basic':
|
| 77 |
+
applyBasicAuth(client_id, client_secret, headers);
|
| 78 |
+
return;
|
| 79 |
+
case 'client_secret_post':
|
| 80 |
+
applyPostAuth(client_id, client_secret, params);
|
| 81 |
+
return;
|
| 82 |
+
case 'none':
|
| 83 |
+
applyPublicAuth(client_id, params);
|
| 84 |
+
return;
|
| 85 |
+
default:
|
| 86 |
+
throw new Error(`Unsupported client authentication method: ${method}`);
|
| 87 |
+
}
|
| 88 |
+
}
|
| 89 |
+
/**
|
| 90 |
+
* Applies HTTP Basic authentication (RFC 6749 Section 2.3.1)
|
| 91 |
+
*/
|
| 92 |
+
function applyBasicAuth(clientId, clientSecret, headers) {
|
| 93 |
+
if (!clientSecret) {
|
| 94 |
+
throw new Error('client_secret_basic authentication requires a client_secret');
|
| 95 |
+
}
|
| 96 |
+
const credentials = btoa(`${clientId}:${clientSecret}`);
|
| 97 |
+
headers.set('Authorization', `Basic ${credentials}`);
|
| 98 |
+
}
|
| 99 |
+
/**
|
| 100 |
+
* Applies POST body authentication (RFC 6749 Section 2.3.1)
|
| 101 |
+
*/
|
| 102 |
+
function applyPostAuth(clientId, clientSecret, params) {
|
| 103 |
+
params.set('client_id', clientId);
|
| 104 |
+
if (clientSecret) {
|
| 105 |
+
params.set('client_secret', clientSecret);
|
| 106 |
+
}
|
| 107 |
+
}
|
| 108 |
+
/**
|
| 109 |
+
* Applies public client authentication (RFC 6749 Section 2.1)
|
| 110 |
+
*/
|
| 111 |
+
function applyPublicAuth(clientId, params) {
|
| 112 |
+
params.set('client_id', clientId);
|
| 113 |
+
}
|
| 114 |
+
/**
|
| 115 |
+
* Parses an OAuth error response from a string or Response object.
|
| 116 |
+
*
|
| 117 |
+
* If the input is a standard OAuth2.0 error response, it will be parsed according to the spec
|
| 118 |
+
* and an instance of the appropriate OAuthError subclass will be returned.
|
| 119 |
+
* If parsing fails, it falls back to a generic ServerError that includes
|
| 120 |
+
* the response status (if available) and original content.
|
| 121 |
+
*
|
| 122 |
+
* @param input - A Response object or string containing the error response
|
| 123 |
+
* @returns A Promise that resolves to an OAuthError instance
|
| 124 |
+
*/
|
| 125 |
+
export async function parseErrorResponse(input) {
|
| 126 |
+
const statusCode = input instanceof Response ? input.status : undefined;
|
| 127 |
+
const body = input instanceof Response ? await input.text() : input;
|
| 128 |
+
try {
|
| 129 |
+
const result = OAuthErrorResponseSchema.parse(JSON.parse(body));
|
| 130 |
+
const { error, error_description, error_uri } = result;
|
| 131 |
+
const errorClass = OAUTH_ERRORS[error] || ServerError;
|
| 132 |
+
return new errorClass(error_description || '', error_uri);
|
| 133 |
+
}
|
| 134 |
+
catch (error) {
|
| 135 |
+
// Not a valid OAuth error response, but try to inform the user of the raw data anyway
|
| 136 |
+
const errorMessage = `${statusCode ? `HTTP ${statusCode}: ` : ''}Invalid OAuth error response: ${error}. Raw body: ${body}`;
|
| 137 |
+
return new ServerError(errorMessage);
|
| 138 |
+
}
|
| 139 |
+
}
|
| 140 |
+
/**
|
| 141 |
+
* Orchestrates the full auth flow with a server.
|
| 142 |
+
*
|
| 143 |
+
* This can be used as a single entry point for all authorization functionality,
|
| 144 |
+
* instead of linking together the other lower-level functions in this module.
|
| 145 |
+
*/
|
| 146 |
+
export async function auth(provider, options) {
|
| 147 |
+
try {
|
| 148 |
+
return await authInternal(provider, options);
|
| 149 |
+
}
|
| 150 |
+
catch (error) {
|
| 151 |
+
// Handle recoverable error types by invalidating credentials and retrying
|
| 152 |
+
if (error instanceof InvalidClientError || error instanceof UnauthorizedClientError) {
|
| 153 |
+
await provider.invalidateCredentials?.('all');
|
| 154 |
+
return await authInternal(provider, options);
|
| 155 |
+
}
|
| 156 |
+
else if (error instanceof InvalidGrantError) {
|
| 157 |
+
await provider.invalidateCredentials?.('tokens');
|
| 158 |
+
return await authInternal(provider, options);
|
| 159 |
+
}
|
| 160 |
+
// Throw otherwise
|
| 161 |
+
throw error;
|
| 162 |
+
}
|
| 163 |
+
}
|
| 164 |
+
async function authInternal(provider, { serverUrl, authorizationCode, scope, resourceMetadataUrl, fetchFn }) {
|
| 165 |
+
// Check if the provider has cached discovery state to skip discovery
|
| 166 |
+
const cachedState = await provider.discoveryState?.();
|
| 167 |
+
let resourceMetadata;
|
| 168 |
+
let authorizationServerUrl;
|
| 169 |
+
let metadata;
|
| 170 |
+
// If resourceMetadataUrl is not provided, try to load it from cached state
|
| 171 |
+
// This handles browser redirects where the URL was saved before navigation
|
| 172 |
+
let effectiveResourceMetadataUrl = resourceMetadataUrl;
|
| 173 |
+
if (!effectiveResourceMetadataUrl && cachedState?.resourceMetadataUrl) {
|
| 174 |
+
effectiveResourceMetadataUrl = new URL(cachedState.resourceMetadataUrl);
|
| 175 |
+
}
|
| 176 |
+
if (cachedState?.authorizationServerUrl) {
|
| 177 |
+
// Restore discovery state from cache
|
| 178 |
+
authorizationServerUrl = cachedState.authorizationServerUrl;
|
| 179 |
+
resourceMetadata = cachedState.resourceMetadata;
|
| 180 |
+
metadata =
|
| 181 |
+
cachedState.authorizationServerMetadata ?? (await discoverAuthorizationServerMetadata(authorizationServerUrl, { fetchFn }));
|
| 182 |
+
// If resource metadata wasn't cached, try to fetch it for selectResourceURL
|
| 183 |
+
if (!resourceMetadata) {
|
| 184 |
+
try {
|
| 185 |
+
resourceMetadata = await discoverOAuthProtectedResourceMetadata(serverUrl, { resourceMetadataUrl: effectiveResourceMetadataUrl }, fetchFn);
|
| 186 |
+
}
|
| 187 |
+
catch {
|
| 188 |
+
// RFC 9728 not available — selectResourceURL will handle undefined
|
| 189 |
+
}
|
| 190 |
+
}
|
| 191 |
+
// Re-save if we enriched the cached state with missing metadata
|
| 192 |
+
if (metadata !== cachedState.authorizationServerMetadata || resourceMetadata !== cachedState.resourceMetadata) {
|
| 193 |
+
await provider.saveDiscoveryState?.({
|
| 194 |
+
authorizationServerUrl: String(authorizationServerUrl),
|
| 195 |
+
resourceMetadataUrl: effectiveResourceMetadataUrl?.toString(),
|
| 196 |
+
resourceMetadata,
|
| 197 |
+
authorizationServerMetadata: metadata
|
| 198 |
+
});
|
| 199 |
+
}
|
| 200 |
+
}
|
| 201 |
+
else {
|
| 202 |
+
// Full discovery via RFC 9728
|
| 203 |
+
const serverInfo = await discoverOAuthServerInfo(serverUrl, { resourceMetadataUrl: effectiveResourceMetadataUrl, fetchFn });
|
| 204 |
+
authorizationServerUrl = serverInfo.authorizationServerUrl;
|
| 205 |
+
metadata = serverInfo.authorizationServerMetadata;
|
| 206 |
+
resourceMetadata = serverInfo.resourceMetadata;
|
| 207 |
+
// Persist discovery state for future use
|
| 208 |
+
// TODO: resourceMetadataUrl is only populated when explicitly provided via options
|
| 209 |
+
// or loaded from cached state. The URL derived internally by
|
| 210 |
+
// discoverOAuthProtectedResourceMetadata() is not captured back here.
|
| 211 |
+
await provider.saveDiscoveryState?.({
|
| 212 |
+
authorizationServerUrl: String(authorizationServerUrl),
|
| 213 |
+
resourceMetadataUrl: effectiveResourceMetadataUrl?.toString(),
|
| 214 |
+
resourceMetadata,
|
| 215 |
+
authorizationServerMetadata: metadata
|
| 216 |
+
});
|
| 217 |
+
}
|
| 218 |
+
const resource = await selectResourceURL(serverUrl, provider, resourceMetadata);
|
| 219 |
+
// Apply scope selection strategy (SEP-835):
|
| 220 |
+
// 1. WWW-Authenticate scope (passed via `scope` param)
|
| 221 |
+
// 2. PRM scopes_supported
|
| 222 |
+
// 3. Client metadata scope (user-configured fallback)
|
| 223 |
+
// The resolved scope is used consistently for both DCR and the authorization request.
|
| 224 |
+
const resolvedScope = scope || resourceMetadata?.scopes_supported?.join(' ') || provider.clientMetadata.scope;
|
| 225 |
+
// Handle client registration if needed
|
| 226 |
+
let clientInformation = await Promise.resolve(provider.clientInformation());
|
| 227 |
+
if (!clientInformation) {
|
| 228 |
+
if (authorizationCode !== undefined) {
|
| 229 |
+
throw new Error('Existing OAuth client information is required when exchanging an authorization code');
|
| 230 |
+
}
|
| 231 |
+
const supportsUrlBasedClientId = metadata?.client_id_metadata_document_supported === true;
|
| 232 |
+
const clientMetadataUrl = provider.clientMetadataUrl;
|
| 233 |
+
if (clientMetadataUrl && !isHttpsUrl(clientMetadataUrl)) {
|
| 234 |
+
throw new InvalidClientMetadataError(`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${clientMetadataUrl}`);
|
| 235 |
+
}
|
| 236 |
+
const shouldUseUrlBasedClientId = supportsUrlBasedClientId && clientMetadataUrl;
|
| 237 |
+
if (shouldUseUrlBasedClientId) {
|
| 238 |
+
// SEP-991: URL-based Client IDs
|
| 239 |
+
clientInformation = {
|
| 240 |
+
client_id: clientMetadataUrl
|
| 241 |
+
};
|
| 242 |
+
await provider.saveClientInformation?.(clientInformation);
|
| 243 |
+
}
|
| 244 |
+
else {
|
| 245 |
+
// Fallback to dynamic registration
|
| 246 |
+
if (!provider.saveClientInformation) {
|
| 247 |
+
throw new Error('OAuth client information must be saveable for dynamic registration');
|
| 248 |
+
}
|
| 249 |
+
const fullInformation = await registerClient(authorizationServerUrl, {
|
| 250 |
+
metadata,
|
| 251 |
+
clientMetadata: provider.clientMetadata,
|
| 252 |
+
scope: resolvedScope,
|
| 253 |
+
fetchFn
|
| 254 |
+
});
|
| 255 |
+
await provider.saveClientInformation(fullInformation);
|
| 256 |
+
clientInformation = fullInformation;
|
| 257 |
+
}
|
| 258 |
+
}
|
| 259 |
+
// Non-interactive flows (e.g., client_credentials, jwt-bearer) don't need a redirect URL
|
| 260 |
+
const nonInteractiveFlow = !provider.redirectUrl;
|
| 261 |
+
// Exchange authorization code for tokens, or fetch tokens directly for non-interactive flows
|
| 262 |
+
if (authorizationCode !== undefined || nonInteractiveFlow) {
|
| 263 |
+
const tokens = await fetchToken(provider, authorizationServerUrl, {
|
| 264 |
+
metadata,
|
| 265 |
+
resource,
|
| 266 |
+
authorizationCode,
|
| 267 |
+
fetchFn
|
| 268 |
+
});
|
| 269 |
+
await provider.saveTokens(tokens);
|
| 270 |
+
return 'AUTHORIZED';
|
| 271 |
+
}
|
| 272 |
+
const tokens = await provider.tokens();
|
| 273 |
+
// Handle token refresh or new authorization
|
| 274 |
+
if (tokens?.refresh_token) {
|
| 275 |
+
try {
|
| 276 |
+
// Attempt to refresh the token
|
| 277 |
+
const newTokens = await refreshAuthorization(authorizationServerUrl, {
|
| 278 |
+
metadata,
|
| 279 |
+
clientInformation,
|
| 280 |
+
refreshToken: tokens.refresh_token,
|
| 281 |
+
resource,
|
| 282 |
+
addClientAuthentication: provider.addClientAuthentication,
|
| 283 |
+
fetchFn
|
| 284 |
+
});
|
| 285 |
+
await provider.saveTokens(newTokens);
|
| 286 |
+
return 'AUTHORIZED';
|
| 287 |
+
}
|
| 288 |
+
catch (error) {
|
| 289 |
+
// If this is a ServerError, or an unknown type, log it out and try to continue. Otherwise, escalate so we can fix things and retry.
|
| 290 |
+
if (!(error instanceof OAuthError) || error instanceof ServerError) {
|
| 291 |
+
// Could not refresh OAuth tokens
|
| 292 |
+
}
|
| 293 |
+
else {
|
| 294 |
+
// Refresh failed for another reason, re-throw
|
| 295 |
+
throw error;
|
| 296 |
+
}
|
| 297 |
+
}
|
| 298 |
+
}
|
| 299 |
+
const state = provider.state ? await provider.state() : undefined;
|
| 300 |
+
// Start new authorization flow
|
| 301 |
+
const { authorizationUrl, codeVerifier } = await startAuthorization(authorizationServerUrl, {
|
| 302 |
+
metadata,
|
| 303 |
+
clientInformation,
|
| 304 |
+
state,
|
| 305 |
+
redirectUrl: provider.redirectUrl,
|
| 306 |
+
scope: resolvedScope,
|
| 307 |
+
resource
|
| 308 |
+
});
|
| 309 |
+
await provider.saveCodeVerifier(codeVerifier);
|
| 310 |
+
await provider.redirectToAuthorization(authorizationUrl);
|
| 311 |
+
return 'REDIRECT';
|
| 312 |
+
}
|
| 313 |
+
/**
|
| 314 |
+
* SEP-991: URL-based Client IDs
|
| 315 |
+
* Validate that the client_id is a valid URL with https scheme
|
| 316 |
+
*/
|
| 317 |
+
export function isHttpsUrl(value) {
|
| 318 |
+
if (!value)
|
| 319 |
+
return false;
|
| 320 |
+
try {
|
| 321 |
+
const url = new URL(value);
|
| 322 |
+
return url.protocol === 'https:' && url.pathname !== '/';
|
| 323 |
+
}
|
| 324 |
+
catch {
|
| 325 |
+
return false;
|
| 326 |
+
}
|
| 327 |
+
}
|
| 328 |
+
export async function selectResourceURL(serverUrl, provider, resourceMetadata) {
|
| 329 |
+
const defaultResource = resourceUrlFromServerUrl(serverUrl);
|
| 330 |
+
// If provider has custom validation, delegate to it
|
| 331 |
+
if (provider.validateResourceURL) {
|
| 332 |
+
return await provider.validateResourceURL(defaultResource, resourceMetadata?.resource);
|
| 333 |
+
}
|
| 334 |
+
// Only include resource parameter when Protected Resource Metadata is present
|
| 335 |
+
if (!resourceMetadata) {
|
| 336 |
+
return undefined;
|
| 337 |
+
}
|
| 338 |
+
// Validate that the metadata's resource is compatible with our request
|
| 339 |
+
if (!checkResourceAllowed({ requestedResource: defaultResource, configuredResource: resourceMetadata.resource })) {
|
| 340 |
+
throw new Error(`Protected resource ${resourceMetadata.resource} does not match expected ${defaultResource} (or origin)`);
|
| 341 |
+
}
|
| 342 |
+
// Prefer the resource from metadata since it's what the server is telling us to request
|
| 343 |
+
return new URL(resourceMetadata.resource);
|
| 344 |
+
}
|
| 345 |
+
/**
|
| 346 |
+
* Extract resource_metadata, scope, and error from WWW-Authenticate header.
|
| 347 |
+
*/
|
| 348 |
+
export function extractWWWAuthenticateParams(res) {
|
| 349 |
+
const authenticateHeader = res.headers.get('WWW-Authenticate');
|
| 350 |
+
if (!authenticateHeader) {
|
| 351 |
+
return {};
|
| 352 |
+
}
|
| 353 |
+
const [type, scheme] = authenticateHeader.split(' ');
|
| 354 |
+
if (type.toLowerCase() !== 'bearer' || !scheme) {
|
| 355 |
+
return {};
|
| 356 |
+
}
|
| 357 |
+
const resourceMetadataMatch = extractFieldFromWwwAuth(res, 'resource_metadata') || undefined;
|
| 358 |
+
let resourceMetadataUrl;
|
| 359 |
+
if (resourceMetadataMatch) {
|
| 360 |
+
try {
|
| 361 |
+
resourceMetadataUrl = new URL(resourceMetadataMatch);
|
| 362 |
+
}
|
| 363 |
+
catch {
|
| 364 |
+
// Ignore invalid URL
|
| 365 |
+
}
|
| 366 |
+
}
|
| 367 |
+
const scope = extractFieldFromWwwAuth(res, 'scope') || undefined;
|
| 368 |
+
const error = extractFieldFromWwwAuth(res, 'error') || undefined;
|
| 369 |
+
return {
|
| 370 |
+
resourceMetadataUrl,
|
| 371 |
+
scope,
|
| 372 |
+
error
|
| 373 |
+
};
|
| 374 |
+
}
|
| 375 |
+
/**
|
| 376 |
+
* Extracts a specific field's value from the WWW-Authenticate header string.
|
| 377 |
+
*
|
| 378 |
+
* @param response The HTTP response object containing the headers.
|
| 379 |
+
* @param fieldName The name of the field to extract (e.g., "realm", "nonce").
|
| 380 |
+
* @returns The field value
|
| 381 |
+
*/
|
| 382 |
+
function extractFieldFromWwwAuth(response, fieldName) {
|
| 383 |
+
const wwwAuthHeader = response.headers.get('WWW-Authenticate');
|
| 384 |
+
if (!wwwAuthHeader) {
|
| 385 |
+
return null;
|
| 386 |
+
}
|
| 387 |
+
const pattern = new RegExp(`${fieldName}=(?:"([^"]+)"|([^\\s,]+))`);
|
| 388 |
+
const match = wwwAuthHeader.match(pattern);
|
| 389 |
+
if (match) {
|
| 390 |
+
// Pattern matches: field_name="value" or field_name=value (unquoted)
|
| 391 |
+
return match[1] || match[2];
|
| 392 |
+
}
|
| 393 |
+
return null;
|
| 394 |
+
}
|
| 395 |
+
/**
|
| 396 |
+
* Extract resource_metadata from response header.
|
| 397 |
+
* @deprecated Use `extractWWWAuthenticateParams` instead.
|
| 398 |
+
*/
|
| 399 |
+
export function extractResourceMetadataUrl(res) {
|
| 400 |
+
const authenticateHeader = res.headers.get('WWW-Authenticate');
|
| 401 |
+
if (!authenticateHeader) {
|
| 402 |
+
return undefined;
|
| 403 |
+
}
|
| 404 |
+
const [type, scheme] = authenticateHeader.split(' ');
|
| 405 |
+
if (type.toLowerCase() !== 'bearer' || !scheme) {
|
| 406 |
+
return undefined;
|
| 407 |
+
}
|
| 408 |
+
const regex = /resource_metadata="([^"]*)"/;
|
| 409 |
+
const match = regex.exec(authenticateHeader);
|
| 410 |
+
if (!match) {
|
| 411 |
+
return undefined;
|
| 412 |
+
}
|
| 413 |
+
try {
|
| 414 |
+
return new URL(match[1]);
|
| 415 |
+
}
|
| 416 |
+
catch {
|
| 417 |
+
return undefined;
|
| 418 |
+
}
|
| 419 |
+
}
|
| 420 |
+
/**
|
| 421 |
+
* Looks up RFC 9728 OAuth 2.0 Protected Resource Metadata.
|
| 422 |
+
*
|
| 423 |
+
* If the server returns a 404 for the well-known endpoint, this function will
|
| 424 |
+
* return `undefined`. Any other errors will be thrown as exceptions.
|
| 425 |
+
*/
|
| 426 |
+
export async function discoverOAuthProtectedResourceMetadata(serverUrl, opts, fetchFn = fetch) {
|
| 427 |
+
const response = await discoverMetadataWithFallback(serverUrl, 'oauth-protected-resource', fetchFn, {
|
| 428 |
+
protocolVersion: opts?.protocolVersion,
|
| 429 |
+
metadataUrl: opts?.resourceMetadataUrl
|
| 430 |
+
});
|
| 431 |
+
if (!response || response.status === 404) {
|
| 432 |
+
await response?.body?.cancel();
|
| 433 |
+
throw new Error(`Resource server does not implement OAuth 2.0 Protected Resource Metadata.`);
|
| 434 |
+
}
|
| 435 |
+
if (!response.ok) {
|
| 436 |
+
await response.body?.cancel();
|
| 437 |
+
throw new Error(`HTTP ${response.status} trying to load well-known OAuth protected resource metadata.`);
|
| 438 |
+
}
|
| 439 |
+
return OAuthProtectedResourceMetadataSchema.parse(await response.json());
|
| 440 |
+
}
|
| 441 |
+
/**
|
| 442 |
+
* Helper function to handle fetch with CORS retry logic
|
| 443 |
+
*/
|
| 444 |
+
async function fetchWithCorsRetry(url, headers, fetchFn = fetch) {
|
| 445 |
+
try {
|
| 446 |
+
return await fetchFn(url, { headers });
|
| 447 |
+
}
|
| 448 |
+
catch (error) {
|
| 449 |
+
if (error instanceof TypeError) {
|
| 450 |
+
if (headers) {
|
| 451 |
+
// CORS errors come back as TypeError, retry without headers
|
| 452 |
+
return fetchWithCorsRetry(url, undefined, fetchFn);
|
| 453 |
+
}
|
| 454 |
+
else {
|
| 455 |
+
// We're getting CORS errors on retry too, return undefined
|
| 456 |
+
return undefined;
|
| 457 |
+
}
|
| 458 |
+
}
|
| 459 |
+
throw error;
|
| 460 |
+
}
|
| 461 |
+
}
|
| 462 |
+
/**
|
| 463 |
+
* Constructs the well-known path for auth-related metadata discovery
|
| 464 |
+
*/
|
| 465 |
+
function buildWellKnownPath(wellKnownPrefix, pathname = '', options = {}) {
|
| 466 |
+
// Strip trailing slash from pathname to avoid double slashes
|
| 467 |
+
if (pathname.endsWith('/')) {
|
| 468 |
+
pathname = pathname.slice(0, -1);
|
| 469 |
+
}
|
| 470 |
+
return options.prependPathname ? `${pathname}/.well-known/${wellKnownPrefix}` : `/.well-known/${wellKnownPrefix}${pathname}`;
|
| 471 |
+
}
|
| 472 |
+
/**
|
| 473 |
+
* Tries to discover OAuth metadata at a specific URL
|
| 474 |
+
*/
|
| 475 |
+
async function tryMetadataDiscovery(url, protocolVersion, fetchFn = fetch) {
|
| 476 |
+
const headers = {
|
| 477 |
+
'MCP-Protocol-Version': protocolVersion
|
| 478 |
+
};
|
| 479 |
+
return await fetchWithCorsRetry(url, headers, fetchFn);
|
| 480 |
+
}
|
| 481 |
+
/**
|
| 482 |
+
* Determines if fallback to root discovery should be attempted
|
| 483 |
+
*/
|
| 484 |
+
function shouldAttemptFallback(response, pathname) {
|
| 485 |
+
return !response || (response.status >= 400 && response.status < 500 && pathname !== '/');
|
| 486 |
+
}
|
| 487 |
+
/**
|
| 488 |
+
* Generic function for discovering OAuth metadata with fallback support
|
| 489 |
+
*/
|
| 490 |
+
async function discoverMetadataWithFallback(serverUrl, wellKnownType, fetchFn, opts) {
|
| 491 |
+
const issuer = new URL(serverUrl);
|
| 492 |
+
const protocolVersion = opts?.protocolVersion ?? LATEST_PROTOCOL_VERSION;
|
| 493 |
+
let url;
|
| 494 |
+
if (opts?.metadataUrl) {
|
| 495 |
+
url = new URL(opts.metadataUrl);
|
| 496 |
+
}
|
| 497 |
+
else {
|
| 498 |
+
// Try path-aware discovery first
|
| 499 |
+
const wellKnownPath = buildWellKnownPath(wellKnownType, issuer.pathname);
|
| 500 |
+
url = new URL(wellKnownPath, opts?.metadataServerUrl ?? issuer);
|
| 501 |
+
url.search = issuer.search;
|
| 502 |
+
}
|
| 503 |
+
let response = await tryMetadataDiscovery(url, protocolVersion, fetchFn);
|
| 504 |
+
// If path-aware discovery fails with 404 and we're not already at root, try fallback to root discovery
|
| 505 |
+
if (!opts?.metadataUrl && shouldAttemptFallback(response, issuer.pathname)) {
|
| 506 |
+
const rootUrl = new URL(`/.well-known/${wellKnownType}`, issuer);
|
| 507 |
+
response = await tryMetadataDiscovery(rootUrl, protocolVersion, fetchFn);
|
| 508 |
+
}
|
| 509 |
+
return response;
|
| 510 |
+
}
|
| 511 |
+
/**
|
| 512 |
+
* Looks up RFC 8414 OAuth 2.0 Authorization Server Metadata.
|
| 513 |
+
*
|
| 514 |
+
* If the server returns a 404 for the well-known endpoint, this function will
|
| 515 |
+
* return `undefined`. Any other errors will be thrown as exceptions.
|
| 516 |
+
*
|
| 517 |
+
* @deprecated This function is deprecated in favor of `discoverAuthorizationServerMetadata`.
|
| 518 |
+
*/
|
| 519 |
+
export async function discoverOAuthMetadata(issuer, { authorizationServerUrl, protocolVersion } = {}, fetchFn = fetch) {
|
| 520 |
+
if (typeof issuer === 'string') {
|
| 521 |
+
issuer = new URL(issuer);
|
| 522 |
+
}
|
| 523 |
+
if (!authorizationServerUrl) {
|
| 524 |
+
authorizationServerUrl = issuer;
|
| 525 |
+
}
|
| 526 |
+
if (typeof authorizationServerUrl === 'string') {
|
| 527 |
+
authorizationServerUrl = new URL(authorizationServerUrl);
|
| 528 |
+
}
|
| 529 |
+
protocolVersion ?? (protocolVersion = LATEST_PROTOCOL_VERSION);
|
| 530 |
+
const response = await discoverMetadataWithFallback(authorizationServerUrl, 'oauth-authorization-server', fetchFn, {
|
| 531 |
+
protocolVersion,
|
| 532 |
+
metadataServerUrl: authorizationServerUrl
|
| 533 |
+
});
|
| 534 |
+
if (!response || response.status === 404) {
|
| 535 |
+
await response?.body?.cancel();
|
| 536 |
+
return undefined;
|
| 537 |
+
}
|
| 538 |
+
if (!response.ok) {
|
| 539 |
+
await response.body?.cancel();
|
| 540 |
+
throw new Error(`HTTP ${response.status} trying to load well-known OAuth metadata`);
|
| 541 |
+
}
|
| 542 |
+
return OAuthMetadataSchema.parse(await response.json());
|
| 543 |
+
}
|
| 544 |
+
/**
|
| 545 |
+
* Builds a list of discovery URLs to try for authorization server metadata.
|
| 546 |
+
* URLs are returned in priority order:
|
| 547 |
+
* 1. OAuth metadata at the given URL
|
| 548 |
+
* 2. OIDC metadata endpoints at the given URL
|
| 549 |
+
*/
|
| 550 |
+
export function buildDiscoveryUrls(authorizationServerUrl) {
|
| 551 |
+
const url = typeof authorizationServerUrl === 'string' ? new URL(authorizationServerUrl) : authorizationServerUrl;
|
| 552 |
+
const hasPath = url.pathname !== '/';
|
| 553 |
+
const urlsToTry = [];
|
| 554 |
+
if (!hasPath) {
|
| 555 |
+
// Root path: https://example.com/.well-known/oauth-authorization-server
|
| 556 |
+
urlsToTry.push({
|
| 557 |
+
url: new URL('/.well-known/oauth-authorization-server', url.origin),
|
| 558 |
+
type: 'oauth'
|
| 559 |
+
});
|
| 560 |
+
// OIDC: https://example.com/.well-known/openid-configuration
|
| 561 |
+
urlsToTry.push({
|
| 562 |
+
url: new URL(`/.well-known/openid-configuration`, url.origin),
|
| 563 |
+
type: 'oidc'
|
| 564 |
+
});
|
| 565 |
+
return urlsToTry;
|
| 566 |
+
}
|
| 567 |
+
// Strip trailing slash from pathname to avoid double slashes
|
| 568 |
+
let pathname = url.pathname;
|
| 569 |
+
if (pathname.endsWith('/')) {
|
| 570 |
+
pathname = pathname.slice(0, -1);
|
| 571 |
+
}
|
| 572 |
+
// 1. OAuth metadata at the given URL
|
| 573 |
+
// Insert well-known before the path: https://example.com/.well-known/oauth-authorization-server/tenant1
|
| 574 |
+
urlsToTry.push({
|
| 575 |
+
url: new URL(`/.well-known/oauth-authorization-server${pathname}`, url.origin),
|
| 576 |
+
type: 'oauth'
|
| 577 |
+
});
|
| 578 |
+
// 2. OIDC metadata endpoints
|
| 579 |
+
// RFC 8414 style: Insert /.well-known/openid-configuration before the path
|
| 580 |
+
urlsToTry.push({
|
| 581 |
+
url: new URL(`/.well-known/openid-configuration${pathname}`, url.origin),
|
| 582 |
+
type: 'oidc'
|
| 583 |
+
});
|
| 584 |
+
// OIDC Discovery 1.0 style: Append /.well-known/openid-configuration after the path
|
| 585 |
+
urlsToTry.push({
|
| 586 |
+
url: new URL(`${pathname}/.well-known/openid-configuration`, url.origin),
|
| 587 |
+
type: 'oidc'
|
| 588 |
+
});
|
| 589 |
+
return urlsToTry;
|
| 590 |
+
}
|
| 591 |
+
/**
|
| 592 |
+
* Discovers authorization server metadata with support for RFC 8414 OAuth 2.0 Authorization Server Metadata
|
| 593 |
+
* and OpenID Connect Discovery 1.0 specifications.
|
| 594 |
+
*
|
| 595 |
+
* This function implements a fallback strategy for authorization server discovery:
|
| 596 |
+
* 1. Attempts RFC 8414 OAuth metadata discovery first
|
| 597 |
+
* 2. If OAuth discovery fails, falls back to OpenID Connect Discovery
|
| 598 |
+
*
|
| 599 |
+
* @param authorizationServerUrl - The authorization server URL obtained from the MCP Server's
|
| 600 |
+
* protected resource metadata, or the MCP server's URL if the
|
| 601 |
+
* metadata was not found.
|
| 602 |
+
* @param options - Configuration options
|
| 603 |
+
* @param options.fetchFn - Optional fetch function for making HTTP requests, defaults to global fetch
|
| 604 |
+
* @param options.protocolVersion - MCP protocol version to use, defaults to LATEST_PROTOCOL_VERSION
|
| 605 |
+
* @returns Promise resolving to authorization server metadata, or undefined if discovery fails
|
| 606 |
+
*/
|
| 607 |
+
export async function discoverAuthorizationServerMetadata(authorizationServerUrl, { fetchFn = fetch, protocolVersion = LATEST_PROTOCOL_VERSION } = {}) {
|
| 608 |
+
const headers = {
|
| 609 |
+
'MCP-Protocol-Version': protocolVersion,
|
| 610 |
+
Accept: 'application/json'
|
| 611 |
+
};
|
| 612 |
+
// Get the list of URLs to try
|
| 613 |
+
const urlsToTry = buildDiscoveryUrls(authorizationServerUrl);
|
| 614 |
+
// Try each URL in order
|
| 615 |
+
for (const { url: endpointUrl, type } of urlsToTry) {
|
| 616 |
+
const response = await fetchWithCorsRetry(endpointUrl, headers, fetchFn);
|
| 617 |
+
if (!response) {
|
| 618 |
+
/**
|
| 619 |
+
* CORS error occurred - don't throw as the endpoint may not allow CORS,
|
| 620 |
+
* continue trying other possible endpoints
|
| 621 |
+
*/
|
| 622 |
+
continue;
|
| 623 |
+
}
|
| 624 |
+
if (!response.ok) {
|
| 625 |
+
await response.body?.cancel();
|
| 626 |
+
// Continue looking for any 4xx response code.
|
| 627 |
+
if (response.status >= 400 && response.status < 500) {
|
| 628 |
+
continue; // Try next URL
|
| 629 |
+
}
|
| 630 |
+
throw new Error(`HTTP ${response.status} trying to load ${type === 'oauth' ? 'OAuth' : 'OpenID provider'} metadata from ${endpointUrl}`);
|
| 631 |
+
}
|
| 632 |
+
// Parse and validate based on type
|
| 633 |
+
if (type === 'oauth') {
|
| 634 |
+
return OAuthMetadataSchema.parse(await response.json());
|
| 635 |
+
}
|
| 636 |
+
else {
|
| 637 |
+
return OpenIdProviderDiscoveryMetadataSchema.parse(await response.json());
|
| 638 |
+
}
|
| 639 |
+
}
|
| 640 |
+
return undefined;
|
| 641 |
+
}
|
| 642 |
+
/**
|
| 643 |
+
* Discovers the authorization server for an MCP server following
|
| 644 |
+
* {@link https://datatracker.ietf.org/doc/html/rfc9728 | RFC 9728} (OAuth 2.0 Protected
|
| 645 |
+
* Resource Metadata), with fallback to treating the server URL as the
|
| 646 |
+
* authorization server.
|
| 647 |
+
*
|
| 648 |
+
* This function combines two discovery steps into one call:
|
| 649 |
+
* 1. Probes `/.well-known/oauth-protected-resource` on the MCP server to find the
|
| 650 |
+
* authorization server URL (RFC 9728).
|
| 651 |
+
* 2. Fetches authorization server metadata from that URL (RFC 8414 / OpenID Connect Discovery).
|
| 652 |
+
*
|
| 653 |
+
* Use this when you need the authorization server metadata for operations outside the
|
| 654 |
+
* {@linkcode auth} orchestrator, such as token refresh or token revocation.
|
| 655 |
+
*
|
| 656 |
+
* @param serverUrl - The MCP resource server URL
|
| 657 |
+
* @param opts - Optional configuration
|
| 658 |
+
* @param opts.resourceMetadataUrl - Override URL for the protected resource metadata endpoint
|
| 659 |
+
* @param opts.fetchFn - Custom fetch function for HTTP requests
|
| 660 |
+
* @returns Authorization server URL, metadata, and resource metadata (if available)
|
| 661 |
+
*/
|
| 662 |
+
export async function discoverOAuthServerInfo(serverUrl, opts) {
|
| 663 |
+
let resourceMetadata;
|
| 664 |
+
let authorizationServerUrl;
|
| 665 |
+
try {
|
| 666 |
+
resourceMetadata = await discoverOAuthProtectedResourceMetadata(serverUrl, { resourceMetadataUrl: opts?.resourceMetadataUrl }, opts?.fetchFn);
|
| 667 |
+
if (resourceMetadata.authorization_servers && resourceMetadata.authorization_servers.length > 0) {
|
| 668 |
+
authorizationServerUrl = resourceMetadata.authorization_servers[0];
|
| 669 |
+
}
|
| 670 |
+
}
|
| 671 |
+
catch {
|
| 672 |
+
// RFC 9728 not supported -- fall back to treating the server URL as the authorization server
|
| 673 |
+
}
|
| 674 |
+
// If we don't get a valid authorization server from protected resource metadata,
|
| 675 |
+
// fall back to the legacy MCP spec behavior: MCP server base URL acts as the authorization server
|
| 676 |
+
if (!authorizationServerUrl) {
|
| 677 |
+
authorizationServerUrl = String(new URL('/', serverUrl));
|
| 678 |
+
}
|
| 679 |
+
const authorizationServerMetadata = await discoverAuthorizationServerMetadata(authorizationServerUrl, { fetchFn: opts?.fetchFn });
|
| 680 |
+
return {
|
| 681 |
+
authorizationServerUrl,
|
| 682 |
+
authorizationServerMetadata,
|
| 683 |
+
resourceMetadata
|
| 684 |
+
};
|
| 685 |
+
}
|
| 686 |
+
/**
|
| 687 |
+
* Begins the authorization flow with the given server, by generating a PKCE challenge and constructing the authorization URL.
|
| 688 |
+
*/
|
| 689 |
+
export async function startAuthorization(authorizationServerUrl, { metadata, clientInformation, redirectUrl, scope, state, resource }) {
|
| 690 |
+
let authorizationUrl;
|
| 691 |
+
if (metadata) {
|
| 692 |
+
authorizationUrl = new URL(metadata.authorization_endpoint);
|
| 693 |
+
if (!metadata.response_types_supported.includes(AUTHORIZATION_CODE_RESPONSE_TYPE)) {
|
| 694 |
+
throw new Error(`Incompatible auth server: does not support response type ${AUTHORIZATION_CODE_RESPONSE_TYPE}`);
|
| 695 |
+
}
|
| 696 |
+
if (metadata.code_challenge_methods_supported &&
|
| 697 |
+
!metadata.code_challenge_methods_supported.includes(AUTHORIZATION_CODE_CHALLENGE_METHOD)) {
|
| 698 |
+
throw new Error(`Incompatible auth server: does not support code challenge method ${AUTHORIZATION_CODE_CHALLENGE_METHOD}`);
|
| 699 |
+
}
|
| 700 |
+
}
|
| 701 |
+
else {
|
| 702 |
+
authorizationUrl = new URL('/authorize', authorizationServerUrl);
|
| 703 |
+
}
|
| 704 |
+
// Generate PKCE challenge
|
| 705 |
+
const challenge = await pkceChallenge();
|
| 706 |
+
const codeVerifier = challenge.code_verifier;
|
| 707 |
+
const codeChallenge = challenge.code_challenge;
|
| 708 |
+
authorizationUrl.searchParams.set('response_type', AUTHORIZATION_CODE_RESPONSE_TYPE);
|
| 709 |
+
authorizationUrl.searchParams.set('client_id', clientInformation.client_id);
|
| 710 |
+
authorizationUrl.searchParams.set('code_challenge', codeChallenge);
|
| 711 |
+
authorizationUrl.searchParams.set('code_challenge_method', AUTHORIZATION_CODE_CHALLENGE_METHOD);
|
| 712 |
+
authorizationUrl.searchParams.set('redirect_uri', String(redirectUrl));
|
| 713 |
+
if (state) {
|
| 714 |
+
authorizationUrl.searchParams.set('state', state);
|
| 715 |
+
}
|
| 716 |
+
if (scope) {
|
| 717 |
+
authorizationUrl.searchParams.set('scope', scope);
|
| 718 |
+
}
|
| 719 |
+
if (scope?.includes('offline_access')) {
|
| 720 |
+
// if the request includes the OIDC-only "offline_access" scope,
|
| 721 |
+
// we need to set the prompt to "consent" to ensure the user is prompted to grant offline access
|
| 722 |
+
// https://openid.net/specs/openid-connect-core-1_0.html#OfflineAccess
|
| 723 |
+
authorizationUrl.searchParams.append('prompt', 'consent');
|
| 724 |
+
}
|
| 725 |
+
if (resource) {
|
| 726 |
+
authorizationUrl.searchParams.set('resource', resource.href);
|
| 727 |
+
}
|
| 728 |
+
return { authorizationUrl, codeVerifier };
|
| 729 |
+
}
|
| 730 |
+
/**
|
| 731 |
+
* Prepares token request parameters for an authorization code exchange.
|
| 732 |
+
*
|
| 733 |
+
* This is the default implementation used by fetchToken when the provider
|
| 734 |
+
* doesn't implement prepareTokenRequest.
|
| 735 |
+
*
|
| 736 |
+
* @param authorizationCode - The authorization code received from the authorization endpoint
|
| 737 |
+
* @param codeVerifier - The PKCE code verifier
|
| 738 |
+
* @param redirectUri - The redirect URI used in the authorization request
|
| 739 |
+
* @returns URLSearchParams for the authorization_code grant
|
| 740 |
+
*/
|
| 741 |
+
export function prepareAuthorizationCodeRequest(authorizationCode, codeVerifier, redirectUri) {
|
| 742 |
+
return new URLSearchParams({
|
| 743 |
+
grant_type: 'authorization_code',
|
| 744 |
+
code: authorizationCode,
|
| 745 |
+
code_verifier: codeVerifier,
|
| 746 |
+
redirect_uri: String(redirectUri)
|
| 747 |
+
});
|
| 748 |
+
}
|
| 749 |
+
/**
|
| 750 |
+
* Internal helper to execute a token request with the given parameters.
|
| 751 |
+
* Used by exchangeAuthorization, refreshAuthorization, and fetchToken.
|
| 752 |
+
*/
|
| 753 |
+
async function executeTokenRequest(authorizationServerUrl, { metadata, tokenRequestParams, clientInformation, addClientAuthentication, resource, fetchFn }) {
|
| 754 |
+
const tokenUrl = metadata?.token_endpoint ? new URL(metadata.token_endpoint) : new URL('/token', authorizationServerUrl);
|
| 755 |
+
const headers = new Headers({
|
| 756 |
+
'Content-Type': 'application/x-www-form-urlencoded',
|
| 757 |
+
Accept: 'application/json'
|
| 758 |
+
});
|
| 759 |
+
if (resource) {
|
| 760 |
+
tokenRequestParams.set('resource', resource.href);
|
| 761 |
+
}
|
| 762 |
+
if (addClientAuthentication) {
|
| 763 |
+
await addClientAuthentication(headers, tokenRequestParams, tokenUrl, metadata);
|
| 764 |
+
}
|
| 765 |
+
else if (clientInformation) {
|
| 766 |
+
const supportedMethods = metadata?.token_endpoint_auth_methods_supported ?? [];
|
| 767 |
+
const authMethod = selectClientAuthMethod(clientInformation, supportedMethods);
|
| 768 |
+
applyClientAuthentication(authMethod, clientInformation, headers, tokenRequestParams);
|
| 769 |
+
}
|
| 770 |
+
const response = await (fetchFn ?? fetch)(tokenUrl, {
|
| 771 |
+
method: 'POST',
|
| 772 |
+
headers,
|
| 773 |
+
body: tokenRequestParams
|
| 774 |
+
});
|
| 775 |
+
if (!response.ok) {
|
| 776 |
+
throw await parseErrorResponse(response);
|
| 777 |
+
}
|
| 778 |
+
return OAuthTokensSchema.parse(await response.json());
|
| 779 |
+
}
|
| 780 |
+
/**
|
| 781 |
+
* Exchanges an authorization code for an access token with the given server.
|
| 782 |
+
*
|
| 783 |
+
* Supports multiple client authentication methods as specified in OAuth 2.1:
|
| 784 |
+
* - Automatically selects the best authentication method based on server support
|
| 785 |
+
* - Falls back to appropriate defaults when server metadata is unavailable
|
| 786 |
+
*
|
| 787 |
+
* @param authorizationServerUrl - The authorization server's base URL
|
| 788 |
+
* @param options - Configuration object containing client info, auth code, etc.
|
| 789 |
+
* @returns Promise resolving to OAuth tokens
|
| 790 |
+
* @throws {Error} When token exchange fails or authentication is invalid
|
| 791 |
+
*/
|
| 792 |
+
export async function exchangeAuthorization(authorizationServerUrl, { metadata, clientInformation, authorizationCode, codeVerifier, redirectUri, resource, addClientAuthentication, fetchFn }) {
|
| 793 |
+
const tokenRequestParams = prepareAuthorizationCodeRequest(authorizationCode, codeVerifier, redirectUri);
|
| 794 |
+
return executeTokenRequest(authorizationServerUrl, {
|
| 795 |
+
metadata,
|
| 796 |
+
tokenRequestParams,
|
| 797 |
+
clientInformation,
|
| 798 |
+
addClientAuthentication,
|
| 799 |
+
resource,
|
| 800 |
+
fetchFn
|
| 801 |
+
});
|
| 802 |
+
}
|
| 803 |
+
/**
|
| 804 |
+
* Exchange a refresh token for an updated access token.
|
| 805 |
+
*
|
| 806 |
+
* Supports multiple client authentication methods as specified in OAuth 2.1:
|
| 807 |
+
* - Automatically selects the best authentication method based on server support
|
| 808 |
+
* - Preserves the original refresh token if a new one is not returned
|
| 809 |
+
*
|
| 810 |
+
* @param authorizationServerUrl - The authorization server's base URL
|
| 811 |
+
* @param options - Configuration object containing client info, refresh token, etc.
|
| 812 |
+
* @returns Promise resolving to OAuth tokens (preserves original refresh_token if not replaced)
|
| 813 |
+
* @throws {Error} When token refresh fails or authentication is invalid
|
| 814 |
+
*/
|
| 815 |
+
export async function refreshAuthorization(authorizationServerUrl, { metadata, clientInformation, refreshToken, resource, addClientAuthentication, fetchFn }) {
|
| 816 |
+
const tokenRequestParams = new URLSearchParams({
|
| 817 |
+
grant_type: 'refresh_token',
|
| 818 |
+
refresh_token: refreshToken
|
| 819 |
+
});
|
| 820 |
+
const tokens = await executeTokenRequest(authorizationServerUrl, {
|
| 821 |
+
metadata,
|
| 822 |
+
tokenRequestParams,
|
| 823 |
+
clientInformation,
|
| 824 |
+
addClientAuthentication,
|
| 825 |
+
resource,
|
| 826 |
+
fetchFn
|
| 827 |
+
});
|
| 828 |
+
// Preserve original refresh token if server didn't return a new one
|
| 829 |
+
return { refresh_token: refreshToken, ...tokens };
|
| 830 |
+
}
|
| 831 |
+
/**
|
| 832 |
+
* Unified token fetching that works with any grant type via provider.prepareTokenRequest().
|
| 833 |
+
*
|
| 834 |
+
* This function provides a single entry point for obtaining tokens regardless of the
|
| 835 |
+
* OAuth grant type. The provider's prepareTokenRequest() method determines which grant
|
| 836 |
+
* to use and supplies the grant-specific parameters.
|
| 837 |
+
*
|
| 838 |
+
* @param provider - OAuth client provider that implements prepareTokenRequest()
|
| 839 |
+
* @param authorizationServerUrl - The authorization server's base URL
|
| 840 |
+
* @param options - Configuration for the token request
|
| 841 |
+
* @returns Promise resolving to OAuth tokens
|
| 842 |
+
* @throws {Error} When provider doesn't implement prepareTokenRequest or token fetch fails
|
| 843 |
+
*
|
| 844 |
+
* @example
|
| 845 |
+
* // Provider for client_credentials:
|
| 846 |
+
* class MyProvider implements OAuthClientProvider {
|
| 847 |
+
* prepareTokenRequest(scope) {
|
| 848 |
+
* const params = new URLSearchParams({ grant_type: 'client_credentials' });
|
| 849 |
+
* if (scope) params.set('scope', scope);
|
| 850 |
+
* return params;
|
| 851 |
+
* }
|
| 852 |
+
* // ... other methods
|
| 853 |
+
* }
|
| 854 |
+
*
|
| 855 |
+
* const tokens = await fetchToken(provider, authServerUrl, { metadata });
|
| 856 |
+
*/
|
| 857 |
+
export async function fetchToken(provider, authorizationServerUrl, { metadata, resource, authorizationCode, fetchFn } = {}) {
|
| 858 |
+
const scope = provider.clientMetadata.scope;
|
| 859 |
+
// Use provider's prepareTokenRequest if available, otherwise fall back to authorization_code
|
| 860 |
+
let tokenRequestParams;
|
| 861 |
+
if (provider.prepareTokenRequest) {
|
| 862 |
+
tokenRequestParams = await provider.prepareTokenRequest(scope);
|
| 863 |
+
}
|
| 864 |
+
// Default to authorization_code grant if no custom prepareTokenRequest
|
| 865 |
+
if (!tokenRequestParams) {
|
| 866 |
+
if (!authorizationCode) {
|
| 867 |
+
throw new Error('Either provider.prepareTokenRequest() or authorizationCode is required');
|
| 868 |
+
}
|
| 869 |
+
if (!provider.redirectUrl) {
|
| 870 |
+
throw new Error('redirectUrl is required for authorization_code flow');
|
| 871 |
+
}
|
| 872 |
+
const codeVerifier = await provider.codeVerifier();
|
| 873 |
+
tokenRequestParams = prepareAuthorizationCodeRequest(authorizationCode, codeVerifier, provider.redirectUrl);
|
| 874 |
+
}
|
| 875 |
+
const clientInformation = await provider.clientInformation();
|
| 876 |
+
return executeTokenRequest(authorizationServerUrl, {
|
| 877 |
+
metadata,
|
| 878 |
+
tokenRequestParams,
|
| 879 |
+
clientInformation: clientInformation ?? undefined,
|
| 880 |
+
addClientAuthentication: provider.addClientAuthentication,
|
| 881 |
+
resource,
|
| 882 |
+
fetchFn
|
| 883 |
+
});
|
| 884 |
+
}
|
| 885 |
+
/**
|
| 886 |
+
* Performs OAuth 2.0 Dynamic Client Registration according to RFC 7591.
|
| 887 |
+
*
|
| 888 |
+
* If `scope` is provided, it overrides `clientMetadata.scope` in the registration
|
| 889 |
+
* request body. This allows callers to apply the Scope Selection Strategy (SEP-835)
|
| 890 |
+
* consistently across both DCR and the subsequent authorization request.
|
| 891 |
+
*/
|
| 892 |
+
export async function registerClient(authorizationServerUrl, { metadata, clientMetadata, scope, fetchFn }) {
|
| 893 |
+
let registrationUrl;
|
| 894 |
+
if (metadata) {
|
| 895 |
+
if (!metadata.registration_endpoint) {
|
| 896 |
+
throw new Error('Incompatible auth server: does not support dynamic client registration');
|
| 897 |
+
}
|
| 898 |
+
registrationUrl = new URL(metadata.registration_endpoint);
|
| 899 |
+
}
|
| 900 |
+
else {
|
| 901 |
+
registrationUrl = new URL('/register', authorizationServerUrl);
|
| 902 |
+
}
|
| 903 |
+
const response = await (fetchFn ?? fetch)(registrationUrl, {
|
| 904 |
+
method: 'POST',
|
| 905 |
+
headers: {
|
| 906 |
+
'Content-Type': 'application/json'
|
| 907 |
+
},
|
| 908 |
+
body: JSON.stringify({
|
| 909 |
+
...clientMetadata,
|
| 910 |
+
...(scope !== undefined ? { scope } : {})
|
| 911 |
+
})
|
| 912 |
+
});
|
| 913 |
+
if (!response.ok) {
|
| 914 |
+
throw await parseErrorResponse(response);
|
| 915 |
+
}
|
| 916 |
+
return OAuthClientInformationFullSchema.parse(await response.json());
|
| 917 |
+
}
|
| 918 |
+
//# sourceMappingURL=auth.js.map
|
node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../src/client/auth.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAQH,wBAAwB,EAExB,qCAAqC,EACxC,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACH,gCAAgC,EAChC,mBAAmB,EACnB,oCAAoC,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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { Protocol, type ProtocolOptions, type RequestOptions } from '../shared/protocol.js';
|
| 2 |
+
import type { Transport } from '../shared/transport.js';
|
| 3 |
+
import { type CallToolRequest, CallToolResultSchema, type ClientCapabilities, type ClientNotification, type ClientRequest, type ClientResult, type CompatibilityCallToolResultSchema, type CompleteRequest, type GetPromptRequest, type Implementation, type ListPromptsRequest, type ListResourcesRequest, type ListResourceTemplatesRequest, type ListToolsRequest, type LoggingLevel, type ReadResourceRequest, type ServerCapabilities, type SubscribeRequest, type UnsubscribeRequest, type ListChangedHandlers, type Request, type Notification, type Result } from '../types.js';
|
| 4 |
+
import type { jsonSchemaValidator } from '../validation/types.js';
|
| 5 |
+
import { AnyObjectSchema, SchemaOutput } from '../server/zod-compat.js';
|
| 6 |
+
import type { RequestHandlerExtra } from '../shared/protocol.js';
|
| 7 |
+
import { ExperimentalClientTasks } from '../experimental/tasks/client.js';
|
| 8 |
+
/**
|
| 9 |
+
* Determines which elicitation modes are supported based on declared client capabilities.
|
| 10 |
+
*
|
| 11 |
+
* According to the spec:
|
| 12 |
+
* - An empty elicitation capability object defaults to form mode support (backwards compatibility)
|
| 13 |
+
* - URL mode is only supported if explicitly declared
|
| 14 |
+
*
|
| 15 |
+
* @param capabilities - The client's elicitation capabilities
|
| 16 |
+
* @returns An object indicating which modes are supported
|
| 17 |
+
*/
|
| 18 |
+
export declare function getSupportedElicitationModes(capabilities: ClientCapabilities['elicitation']): {
|
| 19 |
+
supportsFormMode: boolean;
|
| 20 |
+
supportsUrlMode: boolean;
|
| 21 |
+
};
|
| 22 |
+
export type ClientOptions = ProtocolOptions & {
|
| 23 |
+
/**
|
| 24 |
+
* Capabilities to advertise as being supported by this client.
|
| 25 |
+
*/
|
| 26 |
+
capabilities?: ClientCapabilities;
|
| 27 |
+
/**
|
| 28 |
+
* JSON Schema validator for tool output validation.
|
| 29 |
+
*
|
| 30 |
+
* The validator is used to validate structured content returned by tools
|
| 31 |
+
* against their declared output schemas.
|
| 32 |
+
*
|
| 33 |
+
* @default AjvJsonSchemaValidator
|
| 34 |
+
*
|
| 35 |
+
* @example
|
| 36 |
+
* ```typescript
|
| 37 |
+
* // ajv
|
| 38 |
+
* const client = new Client(
|
| 39 |
+
* { name: 'my-client', version: '1.0.0' },
|
| 40 |
+
* {
|
| 41 |
+
* capabilities: {},
|
| 42 |
+
* jsonSchemaValidator: new AjvJsonSchemaValidator()
|
| 43 |
+
* }
|
| 44 |
+
* );
|
| 45 |
+
*
|
| 46 |
+
* // @cfworker/json-schema
|
| 47 |
+
* const client = new Client(
|
| 48 |
+
* { name: 'my-client', version: '1.0.0' },
|
| 49 |
+
* {
|
| 50 |
+
* capabilities: {},
|
| 51 |
+
* jsonSchemaValidator: new CfWorkerJsonSchemaValidator()
|
| 52 |
+
* }
|
| 53 |
+
* );
|
| 54 |
+
* ```
|
| 55 |
+
*/
|
| 56 |
+
jsonSchemaValidator?: jsonSchemaValidator;
|
| 57 |
+
/**
|
| 58 |
+
* Configure handlers for list changed notifications (tools, prompts, resources).
|
| 59 |
+
*
|
| 60 |
+
* @example
|
| 61 |
+
* ```typescript
|
| 62 |
+
* const client = new Client(
|
| 63 |
+
* { name: 'my-client', version: '1.0.0' },
|
| 64 |
+
* {
|
| 65 |
+
* listChanged: {
|
| 66 |
+
* tools: {
|
| 67 |
+
* onChanged: (error, tools) => {
|
| 68 |
+
* if (error) {
|
| 69 |
+
* console.error('Failed to refresh tools:', error);
|
| 70 |
+
* return;
|
| 71 |
+
* }
|
| 72 |
+
* console.log('Tools updated:', tools);
|
| 73 |
+
* }
|
| 74 |
+
* },
|
| 75 |
+
* prompts: {
|
| 76 |
+
* onChanged: (error, prompts) => console.log('Prompts updated:', prompts)
|
| 77 |
+
* }
|
| 78 |
+
* }
|
| 79 |
+
* }
|
| 80 |
+
* );
|
| 81 |
+
* ```
|
| 82 |
+
*/
|
| 83 |
+
listChanged?: ListChangedHandlers;
|
| 84 |
+
};
|
| 85 |
+
/**
|
| 86 |
+
* An MCP client on top of a pluggable transport.
|
| 87 |
+
*
|
| 88 |
+
* The client will automatically begin the initialization flow with the server when connect() is called.
|
| 89 |
+
*
|
| 90 |
+
* To use with custom types, extend the base Request/Notification/Result types and pass them as type parameters:
|
| 91 |
+
*
|
| 92 |
+
* ```typescript
|
| 93 |
+
* // Custom schemas
|
| 94 |
+
* const CustomRequestSchema = RequestSchema.extend({...})
|
| 95 |
+
* const CustomNotificationSchema = NotificationSchema.extend({...})
|
| 96 |
+
* const CustomResultSchema = ResultSchema.extend({...})
|
| 97 |
+
*
|
| 98 |
+
* // Type aliases
|
| 99 |
+
* type CustomRequest = z.infer<typeof CustomRequestSchema>
|
| 100 |
+
* type CustomNotification = z.infer<typeof CustomNotificationSchema>
|
| 101 |
+
* type CustomResult = z.infer<typeof CustomResultSchema>
|
| 102 |
+
*
|
| 103 |
+
* // Create typed client
|
| 104 |
+
* const client = new Client<CustomRequest, CustomNotification, CustomResult>({
|
| 105 |
+
* name: "CustomClient",
|
| 106 |
+
* version: "1.0.0"
|
| 107 |
+
* })
|
| 108 |
+
* ```
|
| 109 |
+
*/
|
| 110 |
+
export declare class Client<RequestT extends Request = Request, NotificationT extends Notification = Notification, ResultT extends Result = Result> extends Protocol<ClientRequest | RequestT, ClientNotification | NotificationT, ClientResult | ResultT> {
|
| 111 |
+
private _clientInfo;
|
| 112 |
+
private _serverCapabilities?;
|
| 113 |
+
private _serverVersion?;
|
| 114 |
+
private _capabilities;
|
| 115 |
+
private _instructions?;
|
| 116 |
+
private _jsonSchemaValidator;
|
| 117 |
+
private _cachedToolOutputValidators;
|
| 118 |
+
private _cachedKnownTaskTools;
|
| 119 |
+
private _cachedRequiredTaskTools;
|
| 120 |
+
private _experimental?;
|
| 121 |
+
private _listChangedDebounceTimers;
|
| 122 |
+
private _pendingListChangedConfig?;
|
| 123 |
+
/**
|
| 124 |
+
* Initializes this client with the given name and version information.
|
| 125 |
+
*/
|
| 126 |
+
constructor(_clientInfo: Implementation, options?: ClientOptions);
|
| 127 |
+
/**
|
| 128 |
+
* Set up handlers for list changed notifications based on config and server capabilities.
|
| 129 |
+
* This should only be called after initialization when server capabilities are known.
|
| 130 |
+
* Handlers are silently skipped if the server doesn't advertise the corresponding listChanged capability.
|
| 131 |
+
* @internal
|
| 132 |
+
*/
|
| 133 |
+
private _setupListChangedHandlers;
|
| 134 |
+
/**
|
| 135 |
+
* Access experimental features.
|
| 136 |
+
*
|
| 137 |
+
* WARNING: These APIs are experimental and may change without notice.
|
| 138 |
+
*
|
| 139 |
+
* @experimental
|
| 140 |
+
*/
|
| 141 |
+
get experimental(): {
|
| 142 |
+
tasks: ExperimentalClientTasks<RequestT, NotificationT, ResultT>;
|
| 143 |
+
};
|
| 144 |
+
/**
|
| 145 |
+
* Registers new capabilities. This can only be called before connecting to a transport.
|
| 146 |
+
*
|
| 147 |
+
* The new capabilities will be merged with any existing capabilities previously given (e.g., at initialization).
|
| 148 |
+
*/
|
| 149 |
+
registerCapabilities(capabilities: ClientCapabilities): void;
|
| 150 |
+
/**
|
| 151 |
+
* Override request handler registration to enforce client-side validation for elicitation.
|
| 152 |
+
*/
|
| 153 |
+
setRequestHandler<T extends AnyObjectSchema>(requestSchema: T, handler: (request: SchemaOutput<T>, extra: RequestHandlerExtra<ClientRequest | RequestT, ClientNotification | NotificationT>) => ClientResult | ResultT | Promise<ClientResult | ResultT>): void;
|
| 154 |
+
protected assertCapability(capability: keyof ServerCapabilities, method: string): void;
|
| 155 |
+
connect(transport: Transport, options?: RequestOptions): Promise<void>;
|
| 156 |
+
/**
|
| 157 |
+
* After initialization has completed, this will be populated with the server's reported capabilities.
|
| 158 |
+
*/
|
| 159 |
+
getServerCapabilities(): ServerCapabilities | undefined;
|
| 160 |
+
/**
|
| 161 |
+
* After initialization has completed, this will be populated with information about the server's name and version.
|
| 162 |
+
*/
|
| 163 |
+
getServerVersion(): Implementation | undefined;
|
| 164 |
+
/**
|
| 165 |
+
* After initialization has completed, this may be populated with information about the server's instructions.
|
| 166 |
+
*/
|
| 167 |
+
getInstructions(): string | undefined;
|
| 168 |
+
protected assertCapabilityForMethod(method: RequestT['method']): void;
|
| 169 |
+
protected assertNotificationCapability(method: NotificationT['method']): void;
|
| 170 |
+
protected assertRequestHandlerCapability(method: string): void;
|
| 171 |
+
protected assertTaskCapability(method: string): void;
|
| 172 |
+
protected assertTaskHandlerCapability(method: string): void;
|
| 173 |
+
ping(options?: RequestOptions): Promise<{
|
| 174 |
+
_meta?: {
|
| 175 |
+
[x: string]: unknown;
|
| 176 |
+
progressToken?: string | number | undefined;
|
| 177 |
+
"io.modelcontextprotocol/related-task"?: {
|
| 178 |
+
taskId: string;
|
| 179 |
+
} | undefined;
|
| 180 |
+
} | undefined;
|
| 181 |
+
}>;
|
| 182 |
+
complete(params: CompleteRequest['params'], options?: RequestOptions): Promise<{
|
| 183 |
+
[x: string]: unknown;
|
| 184 |
+
completion: {
|
| 185 |
+
[x: string]: unknown;
|
| 186 |
+
values: string[];
|
| 187 |
+
total?: number | undefined;
|
| 188 |
+
hasMore?: boolean | undefined;
|
| 189 |
+
};
|
| 190 |
+
_meta?: {
|
| 191 |
+
[x: string]: unknown;
|
| 192 |
+
progressToken?: string | number | undefined;
|
| 193 |
+
"io.modelcontextprotocol/related-task"?: {
|
| 194 |
+
taskId: string;
|
| 195 |
+
} | undefined;
|
| 196 |
+
} | undefined;
|
| 197 |
+
}>;
|
| 198 |
+
setLoggingLevel(level: LoggingLevel, options?: RequestOptions): Promise<{
|
| 199 |
+
_meta?: {
|
| 200 |
+
[x: string]: unknown;
|
| 201 |
+
progressToken?: string | number | undefined;
|
| 202 |
+
"io.modelcontextprotocol/related-task"?: {
|
| 203 |
+
taskId: string;
|
| 204 |
+
} | undefined;
|
| 205 |
+
} | undefined;
|
| 206 |
+
}>;
|
| 207 |
+
getPrompt(params: GetPromptRequest['params'], options?: RequestOptions): Promise<{
|
| 208 |
+
[x: string]: unknown;
|
| 209 |
+
messages: {
|
| 210 |
+
role: "user" | "assistant";
|
| 211 |
+
content: {
|
| 212 |
+
type: "text";
|
| 213 |
+
text: string;
|
| 214 |
+
annotations?: {
|
| 215 |
+
audience?: ("user" | "assistant")[] | undefined;
|
| 216 |
+
priority?: number | undefined;
|
| 217 |
+
lastModified?: string | undefined;
|
| 218 |
+
} | undefined;
|
| 219 |
+
_meta?: Record<string, unknown> | undefined;
|
| 220 |
+
} | {
|
| 221 |
+
type: "image";
|
| 222 |
+
data: string;
|
| 223 |
+
mimeType: string;
|
| 224 |
+
annotations?: {
|
| 225 |
+
audience?: ("user" | "assistant")[] | undefined;
|
| 226 |
+
priority?: number | undefined;
|
| 227 |
+
lastModified?: string | undefined;
|
| 228 |
+
} | undefined;
|
| 229 |
+
_meta?: Record<string, unknown> | undefined;
|
| 230 |
+
} | {
|
| 231 |
+
type: "audio";
|
| 232 |
+
data: string;
|
| 233 |
+
mimeType: string;
|
| 234 |
+
annotations?: {
|
| 235 |
+
audience?: ("user" | "assistant")[] | undefined;
|
| 236 |
+
priority?: number | undefined;
|
| 237 |
+
lastModified?: string | undefined;
|
| 238 |
+
} | undefined;
|
| 239 |
+
_meta?: Record<string, unknown> | undefined;
|
| 240 |
+
} | {
|
| 241 |
+
type: "resource";
|
| 242 |
+
resource: {
|
| 243 |
+
uri: string;
|
| 244 |
+
text: string;
|
| 245 |
+
mimeType?: string | undefined;
|
| 246 |
+
_meta?: Record<string, unknown> | undefined;
|
| 247 |
+
} | {
|
| 248 |
+
uri: string;
|
| 249 |
+
blob: string;
|
| 250 |
+
mimeType?: string | undefined;
|
| 251 |
+
_meta?: Record<string, unknown> | undefined;
|
| 252 |
+
};
|
| 253 |
+
annotations?: {
|
| 254 |
+
audience?: ("user" | "assistant")[] | undefined;
|
| 255 |
+
priority?: number | undefined;
|
| 256 |
+
lastModified?: string | undefined;
|
| 257 |
+
} | undefined;
|
| 258 |
+
_meta?: Record<string, unknown> | undefined;
|
| 259 |
+
} | {
|
| 260 |
+
uri: string;
|
| 261 |
+
name: string;
|
| 262 |
+
type: "resource_link";
|
| 263 |
+
description?: string | undefined;
|
| 264 |
+
mimeType?: string | undefined;
|
| 265 |
+
size?: number | undefined;
|
| 266 |
+
annotations?: {
|
| 267 |
+
audience?: ("user" | "assistant")[] | undefined;
|
| 268 |
+
priority?: number | undefined;
|
| 269 |
+
lastModified?: string | undefined;
|
| 270 |
+
} | undefined;
|
| 271 |
+
_meta?: {
|
| 272 |
+
[x: string]: unknown;
|
| 273 |
+
} | undefined;
|
| 274 |
+
icons?: {
|
| 275 |
+
src: string;
|
| 276 |
+
mimeType?: string | undefined;
|
| 277 |
+
sizes?: string[] | undefined;
|
| 278 |
+
theme?: "light" | "dark" | undefined;
|
| 279 |
+
}[] | undefined;
|
| 280 |
+
title?: string | undefined;
|
| 281 |
+
};
|
| 282 |
+
}[];
|
| 283 |
+
_meta?: {
|
| 284 |
+
[x: string]: unknown;
|
| 285 |
+
progressToken?: string | number | undefined;
|
| 286 |
+
"io.modelcontextprotocol/related-task"?: {
|
| 287 |
+
taskId: string;
|
| 288 |
+
} | undefined;
|
| 289 |
+
} | undefined;
|
| 290 |
+
description?: string | undefined;
|
| 291 |
+
}>;
|
| 292 |
+
listPrompts(params?: ListPromptsRequest['params'], options?: RequestOptions): Promise<{
|
| 293 |
+
[x: string]: unknown;
|
| 294 |
+
prompts: {
|
| 295 |
+
name: string;
|
| 296 |
+
description?: string | undefined;
|
| 297 |
+
arguments?: {
|
| 298 |
+
name: string;
|
| 299 |
+
description?: string | undefined;
|
| 300 |
+
required?: boolean | undefined;
|
| 301 |
+
}[] | undefined;
|
| 302 |
+
_meta?: {
|
| 303 |
+
[x: string]: unknown;
|
| 304 |
+
} | undefined;
|
| 305 |
+
icons?: {
|
| 306 |
+
src: string;
|
| 307 |
+
mimeType?: string | undefined;
|
| 308 |
+
sizes?: string[] | undefined;
|
| 309 |
+
theme?: "light" | "dark" | undefined;
|
| 310 |
+
}[] | undefined;
|
| 311 |
+
title?: string | undefined;
|
| 312 |
+
}[];
|
| 313 |
+
_meta?: {
|
| 314 |
+
[x: string]: unknown;
|
| 315 |
+
progressToken?: string | number | undefined;
|
| 316 |
+
"io.modelcontextprotocol/related-task"?: {
|
| 317 |
+
taskId: string;
|
| 318 |
+
} | undefined;
|
| 319 |
+
} | undefined;
|
| 320 |
+
nextCursor?: string | undefined;
|
| 321 |
+
}>;
|
| 322 |
+
listResources(params?: ListResourcesRequest['params'], options?: RequestOptions): Promise<{
|
| 323 |
+
[x: string]: unknown;
|
| 324 |
+
resources: {
|
| 325 |
+
uri: string;
|
| 326 |
+
name: string;
|
| 327 |
+
description?: string | undefined;
|
| 328 |
+
mimeType?: string | undefined;
|
| 329 |
+
size?: number | undefined;
|
| 330 |
+
annotations?: {
|
| 331 |
+
audience?: ("user" | "assistant")[] | undefined;
|
| 332 |
+
priority?: number | undefined;
|
| 333 |
+
lastModified?: string | undefined;
|
| 334 |
+
} | undefined;
|
| 335 |
+
_meta?: {
|
| 336 |
+
[x: string]: unknown;
|
| 337 |
+
} | undefined;
|
| 338 |
+
icons?: {
|
| 339 |
+
src: string;
|
| 340 |
+
mimeType?: string | undefined;
|
| 341 |
+
sizes?: string[] | undefined;
|
| 342 |
+
theme?: "light" | "dark" | undefined;
|
| 343 |
+
}[] | undefined;
|
| 344 |
+
title?: string | undefined;
|
| 345 |
+
}[];
|
| 346 |
+
_meta?: {
|
| 347 |
+
[x: string]: unknown;
|
| 348 |
+
progressToken?: string | number | undefined;
|
| 349 |
+
"io.modelcontextprotocol/related-task"?: {
|
| 350 |
+
taskId: string;
|
| 351 |
+
} | undefined;
|
| 352 |
+
} | undefined;
|
| 353 |
+
nextCursor?: string | undefined;
|
| 354 |
+
}>;
|
| 355 |
+
listResourceTemplates(params?: ListResourceTemplatesRequest['params'], options?: RequestOptions): Promise<{
|
| 356 |
+
[x: string]: unknown;
|
| 357 |
+
resourceTemplates: {
|
| 358 |
+
uriTemplate: string;
|
| 359 |
+
name: string;
|
| 360 |
+
description?: string | undefined;
|
| 361 |
+
mimeType?: string | undefined;
|
| 362 |
+
annotations?: {
|
| 363 |
+
audience?: ("user" | "assistant")[] | undefined;
|
| 364 |
+
priority?: number | undefined;
|
| 365 |
+
lastModified?: string | undefined;
|
| 366 |
+
} | undefined;
|
| 367 |
+
_meta?: {
|
| 368 |
+
[x: string]: unknown;
|
| 369 |
+
} | undefined;
|
| 370 |
+
icons?: {
|
| 371 |
+
src: string;
|
| 372 |
+
mimeType?: string | undefined;
|
| 373 |
+
sizes?: string[] | undefined;
|
| 374 |
+
theme?: "light" | "dark" | undefined;
|
| 375 |
+
}[] | undefined;
|
| 376 |
+
title?: string | undefined;
|
| 377 |
+
}[];
|
| 378 |
+
_meta?: {
|
| 379 |
+
[x: string]: unknown;
|
| 380 |
+
progressToken?: string | number | undefined;
|
| 381 |
+
"io.modelcontextprotocol/related-task"?: {
|
| 382 |
+
taskId: string;
|
| 383 |
+
} | undefined;
|
| 384 |
+
} | undefined;
|
| 385 |
+
nextCursor?: string | undefined;
|
| 386 |
+
}>;
|
| 387 |
+
readResource(params: ReadResourceRequest['params'], options?: RequestOptions): Promise<{
|
| 388 |
+
[x: string]: unknown;
|
| 389 |
+
contents: ({
|
| 390 |
+
uri: string;
|
| 391 |
+
text: string;
|
| 392 |
+
mimeType?: string | undefined;
|
| 393 |
+
_meta?: Record<string, unknown> | undefined;
|
| 394 |
+
} | {
|
| 395 |
+
uri: string;
|
| 396 |
+
blob: string;
|
| 397 |
+
mimeType?: string | undefined;
|
| 398 |
+
_meta?: Record<string, unknown> | undefined;
|
| 399 |
+
})[];
|
| 400 |
+
_meta?: {
|
| 401 |
+
[x: string]: unknown;
|
| 402 |
+
progressToken?: string | number | undefined;
|
| 403 |
+
"io.modelcontextprotocol/related-task"?: {
|
| 404 |
+
taskId: string;
|
| 405 |
+
} | undefined;
|
| 406 |
+
} | undefined;
|
| 407 |
+
}>;
|
| 408 |
+
subscribeResource(params: SubscribeRequest['params'], options?: RequestOptions): Promise<{
|
| 409 |
+
_meta?: {
|
| 410 |
+
[x: string]: unknown;
|
| 411 |
+
progressToken?: string | number | undefined;
|
| 412 |
+
"io.modelcontextprotocol/related-task"?: {
|
| 413 |
+
taskId: string;
|
| 414 |
+
} | undefined;
|
| 415 |
+
} | undefined;
|
| 416 |
+
}>;
|
| 417 |
+
unsubscribeResource(params: UnsubscribeRequest['params'], options?: RequestOptions): Promise<{
|
| 418 |
+
_meta?: {
|
| 419 |
+
[x: string]: unknown;
|
| 420 |
+
progressToken?: string | number | undefined;
|
| 421 |
+
"io.modelcontextprotocol/related-task"?: {
|
| 422 |
+
taskId: string;
|
| 423 |
+
} | undefined;
|
| 424 |
+
} | undefined;
|
| 425 |
+
}>;
|
| 426 |
+
/**
|
| 427 |
+
* Calls a tool and waits for the result. Automatically validates structured output if the tool has an outputSchema.
|
| 428 |
+
*
|
| 429 |
+
* For task-based execution with streaming behavior, use client.experimental.tasks.callToolStream() instead.
|
| 430 |
+
*/
|
| 431 |
+
callTool(params: CallToolRequest['params'], resultSchema?: typeof CallToolResultSchema | typeof CompatibilityCallToolResultSchema, options?: RequestOptions): Promise<{
|
| 432 |
+
[x: string]: unknown;
|
| 433 |
+
content: ({
|
| 434 |
+
type: "text";
|
| 435 |
+
text: string;
|
| 436 |
+
annotations?: {
|
| 437 |
+
audience?: ("user" | "assistant")[] | undefined;
|
| 438 |
+
priority?: number | undefined;
|
| 439 |
+
lastModified?: string | undefined;
|
| 440 |
+
} | undefined;
|
| 441 |
+
_meta?: Record<string, unknown> | undefined;
|
| 442 |
+
} | {
|
| 443 |
+
type: "image";
|
| 444 |
+
data: string;
|
| 445 |
+
mimeType: string;
|
| 446 |
+
annotations?: {
|
| 447 |
+
audience?: ("user" | "assistant")[] | undefined;
|
| 448 |
+
priority?: number | undefined;
|
| 449 |
+
lastModified?: string | undefined;
|
| 450 |
+
} | undefined;
|
| 451 |
+
_meta?: Record<string, unknown> | undefined;
|
| 452 |
+
} | {
|
| 453 |
+
type: "audio";
|
| 454 |
+
data: string;
|
| 455 |
+
mimeType: string;
|
| 456 |
+
annotations?: {
|
| 457 |
+
audience?: ("user" | "assistant")[] | undefined;
|
| 458 |
+
priority?: number | undefined;
|
| 459 |
+
lastModified?: string | undefined;
|
| 460 |
+
} | undefined;
|
| 461 |
+
_meta?: Record<string, unknown> | undefined;
|
| 462 |
+
} | {
|
| 463 |
+
type: "resource";
|
| 464 |
+
resource: {
|
| 465 |
+
uri: string;
|
| 466 |
+
text: string;
|
| 467 |
+
mimeType?: string | undefined;
|
| 468 |
+
_meta?: Record<string, unknown> | undefined;
|
| 469 |
+
} | {
|
| 470 |
+
uri: string;
|
| 471 |
+
blob: string;
|
| 472 |
+
mimeType?: string | undefined;
|
| 473 |
+
_meta?: Record<string, unknown> | undefined;
|
| 474 |
+
};
|
| 475 |
+
annotations?: {
|
| 476 |
+
audience?: ("user" | "assistant")[] | undefined;
|
| 477 |
+
priority?: number | undefined;
|
| 478 |
+
lastModified?: string | undefined;
|
| 479 |
+
} | undefined;
|
| 480 |
+
_meta?: Record<string, unknown> | undefined;
|
| 481 |
+
} | {
|
| 482 |
+
uri: string;
|
| 483 |
+
name: string;
|
| 484 |
+
type: "resource_link";
|
| 485 |
+
description?: string | undefined;
|
| 486 |
+
mimeType?: string | undefined;
|
| 487 |
+
size?: number | undefined;
|
| 488 |
+
annotations?: {
|
| 489 |
+
audience?: ("user" | "assistant")[] | undefined;
|
| 490 |
+
priority?: number | undefined;
|
| 491 |
+
lastModified?: string | undefined;
|
| 492 |
+
} | undefined;
|
| 493 |
+
_meta?: {
|
| 494 |
+
[x: string]: unknown;
|
| 495 |
+
} | undefined;
|
| 496 |
+
icons?: {
|
| 497 |
+
src: string;
|
| 498 |
+
mimeType?: string | undefined;
|
| 499 |
+
sizes?: string[] | undefined;
|
| 500 |
+
theme?: "light" | "dark" | undefined;
|
| 501 |
+
}[] | undefined;
|
| 502 |
+
title?: string | undefined;
|
| 503 |
+
})[];
|
| 504 |
+
_meta?: {
|
| 505 |
+
[x: string]: unknown;
|
| 506 |
+
progressToken?: string | number | undefined;
|
| 507 |
+
"io.modelcontextprotocol/related-task"?: {
|
| 508 |
+
taskId: string;
|
| 509 |
+
} | undefined;
|
| 510 |
+
} | undefined;
|
| 511 |
+
structuredContent?: Record<string, unknown> | undefined;
|
| 512 |
+
isError?: boolean | undefined;
|
| 513 |
+
} | {
|
| 514 |
+
[x: string]: unknown;
|
| 515 |
+
toolResult: unknown;
|
| 516 |
+
_meta?: {
|
| 517 |
+
[x: string]: unknown;
|
| 518 |
+
progressToken?: string | number | undefined;
|
| 519 |
+
"io.modelcontextprotocol/related-task"?: {
|
| 520 |
+
taskId: string;
|
| 521 |
+
} | undefined;
|
| 522 |
+
} | undefined;
|
| 523 |
+
}>;
|
| 524 |
+
private isToolTask;
|
| 525 |
+
/**
|
| 526 |
+
* Check if a tool requires task-based execution.
|
| 527 |
+
* Unlike isToolTask which includes 'optional' tools, this only checks for 'required'.
|
| 528 |
+
*/
|
| 529 |
+
private isToolTaskRequired;
|
| 530 |
+
/**
|
| 531 |
+
* Cache validators for tool output schemas.
|
| 532 |
+
* Called after listTools() to pre-compile validators for better performance.
|
| 533 |
+
*/
|
| 534 |
+
private cacheToolMetadata;
|
| 535 |
+
/**
|
| 536 |
+
* Get cached validator for a tool
|
| 537 |
+
*/
|
| 538 |
+
private getToolOutputValidator;
|
| 539 |
+
listTools(params?: ListToolsRequest['params'], options?: RequestOptions): Promise<{
|
| 540 |
+
[x: string]: unknown;
|
| 541 |
+
tools: {
|
| 542 |
+
inputSchema: {
|
| 543 |
+
[x: string]: unknown;
|
| 544 |
+
type: "object";
|
| 545 |
+
properties?: Record<string, object> | undefined;
|
| 546 |
+
required?: string[] | undefined;
|
| 547 |
+
};
|
| 548 |
+
name: string;
|
| 549 |
+
description?: string | undefined;
|
| 550 |
+
outputSchema?: {
|
| 551 |
+
[x: string]: unknown;
|
| 552 |
+
type: "object";
|
| 553 |
+
properties?: Record<string, object> | undefined;
|
| 554 |
+
required?: string[] | undefined;
|
| 555 |
+
} | undefined;
|
| 556 |
+
annotations?: {
|
| 557 |
+
title?: string | undefined;
|
| 558 |
+
readOnlyHint?: boolean | undefined;
|
| 559 |
+
destructiveHint?: boolean | undefined;
|
| 560 |
+
idempotentHint?: boolean | undefined;
|
| 561 |
+
openWorldHint?: boolean | undefined;
|
| 562 |
+
} | undefined;
|
| 563 |
+
execution?: {
|
| 564 |
+
taskSupport?: "optional" | "required" | "forbidden" | undefined;
|
| 565 |
+
} | undefined;
|
| 566 |
+
_meta?: Record<string, unknown> | undefined;
|
| 567 |
+
icons?: {
|
| 568 |
+
src: string;
|
| 569 |
+
mimeType?: string | undefined;
|
| 570 |
+
sizes?: string[] | undefined;
|
| 571 |
+
theme?: "light" | "dark" | undefined;
|
| 572 |
+
}[] | undefined;
|
| 573 |
+
title?: string | undefined;
|
| 574 |
+
}[];
|
| 575 |
+
_meta?: {
|
| 576 |
+
[x: string]: unknown;
|
| 577 |
+
progressToken?: string | number | undefined;
|
| 578 |
+
"io.modelcontextprotocol/related-task"?: {
|
| 579 |
+
taskId: string;
|
| 580 |
+
} | undefined;
|
| 581 |
+
} | undefined;
|
| 582 |
+
nextCursor?: string | undefined;
|
| 583 |
+
}>;
|
| 584 |
+
/**
|
| 585 |
+
* Set up a single list changed handler.
|
| 586 |
+
* @internal
|
| 587 |
+
*/
|
| 588 |
+
private _setupListChangedHandler;
|
| 589 |
+
sendRootsListChanged(): Promise<void>;
|
| 590 |
+
}
|
| 591 |
+
//# sourceMappingURL=index.d.ts.map
|
node_modules/@modelcontextprotocol/sdk/dist/esm/client/index.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,QAAQ,EAAE,KAAK,eAAe,EAAE,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC/G,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAExD,OAAO,EACH,KAAK,eAAe,EACpB,oBAAoB,EACpB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,iCAAiC,EACtC,KAAK,eAAe,EAIpB,KAAK,gBAAgB,EAErB,KAAK,cAAc,EAGnB,KAAK,kBAAkB,EAEvB,KAAK,oBAAoB,EAEzB,KAAK,4BAA4B,EAEjC,KAAK,gBAAgB,EAErB,KAAK,YAAY,EAEjB,KAAK,mBAAmB,EAExB,KAAK,kBAAkB,EAEvB,KA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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { mergeCapabilities, Protocol } from '../shared/protocol.js';
|
| 2 |
+
import { CallToolResultSchema, CompleteResultSchema, EmptyResultSchema, ErrorCode, GetPromptResultSchema, InitializeResultSchema, LATEST_PROTOCOL_VERSION, ListPromptsResultSchema, ListResourcesResultSchema, ListResourceTemplatesResultSchema, ListToolsResultSchema, McpError, ReadResourceResultSchema, SUPPORTED_PROTOCOL_VERSIONS, ElicitResultSchema, ElicitRequestSchema, CreateTaskResultSchema, CreateMessageRequestSchema, CreateMessageResultSchema, CreateMessageResultWithToolsSchema, ToolListChangedNotificationSchema, PromptListChangedNotificationSchema, ResourceListChangedNotificationSchema, ListChangedOptionsBaseSchema } from '../types.js';
|
| 3 |
+
import { AjvJsonSchemaValidator } from '../validation/ajv-provider.js';
|
| 4 |
+
import { getObjectShape, isZ4Schema, safeParse } from '../server/zod-compat.js';
|
| 5 |
+
import { ExperimentalClientTasks } from '../experimental/tasks/client.js';
|
| 6 |
+
import { assertToolsCallTaskCapability, assertClientRequestTaskCapability } from '../experimental/tasks/helpers.js';
|
| 7 |
+
/**
|
| 8 |
+
* Elicitation default application helper. Applies defaults to the data based on the schema.
|
| 9 |
+
*
|
| 10 |
+
* @param schema - The schema to apply defaults to.
|
| 11 |
+
* @param data - The data to apply defaults to.
|
| 12 |
+
*/
|
| 13 |
+
function applyElicitationDefaults(schema, data) {
|
| 14 |
+
if (!schema || data === null || typeof data !== 'object')
|
| 15 |
+
return;
|
| 16 |
+
// Handle object properties
|
| 17 |
+
if (schema.type === 'object' && schema.properties && typeof schema.properties === 'object') {
|
| 18 |
+
const obj = data;
|
| 19 |
+
const props = schema.properties;
|
| 20 |
+
for (const key of Object.keys(props)) {
|
| 21 |
+
const propSchema = props[key];
|
| 22 |
+
// If missing or explicitly undefined, apply default if present
|
| 23 |
+
if (obj[key] === undefined && Object.prototype.hasOwnProperty.call(propSchema, 'default')) {
|
| 24 |
+
obj[key] = propSchema.default;
|
| 25 |
+
}
|
| 26 |
+
// Recurse into existing nested objects/arrays
|
| 27 |
+
if (obj[key] !== undefined) {
|
| 28 |
+
applyElicitationDefaults(propSchema, obj[key]);
|
| 29 |
+
}
|
| 30 |
+
}
|
| 31 |
+
}
|
| 32 |
+
if (Array.isArray(schema.anyOf)) {
|
| 33 |
+
for (const sub of schema.anyOf) {
|
| 34 |
+
// Skip boolean schemas (true/false are valid JSON Schemas but have no defaults)
|
| 35 |
+
if (typeof sub !== 'boolean') {
|
| 36 |
+
applyElicitationDefaults(sub, data);
|
| 37 |
+
}
|
| 38 |
+
}
|
| 39 |
+
}
|
| 40 |
+
// Combine schemas
|
| 41 |
+
if (Array.isArray(schema.oneOf)) {
|
| 42 |
+
for (const sub of schema.oneOf) {
|
| 43 |
+
// Skip boolean schemas (true/false are valid JSON Schemas but have no defaults)
|
| 44 |
+
if (typeof sub !== 'boolean') {
|
| 45 |
+
applyElicitationDefaults(sub, data);
|
| 46 |
+
}
|
| 47 |
+
}
|
| 48 |
+
}
|
| 49 |
+
}
|
| 50 |
+
/**
|
| 51 |
+
* Determines which elicitation modes are supported based on declared client capabilities.
|
| 52 |
+
*
|
| 53 |
+
* According to the spec:
|
| 54 |
+
* - An empty elicitation capability object defaults to form mode support (backwards compatibility)
|
| 55 |
+
* - URL mode is only supported if explicitly declared
|
| 56 |
+
*
|
| 57 |
+
* @param capabilities - The client's elicitation capabilities
|
| 58 |
+
* @returns An object indicating which modes are supported
|
| 59 |
+
*/
|
| 60 |
+
export function getSupportedElicitationModes(capabilities) {
|
| 61 |
+
if (!capabilities) {
|
| 62 |
+
return { supportsFormMode: false, supportsUrlMode: false };
|
| 63 |
+
}
|
| 64 |
+
const hasFormCapability = capabilities.form !== undefined;
|
| 65 |
+
const hasUrlCapability = capabilities.url !== undefined;
|
| 66 |
+
// If neither form nor url are explicitly declared, form mode is supported (backwards compatibility)
|
| 67 |
+
const supportsFormMode = hasFormCapability || (!hasFormCapability && !hasUrlCapability);
|
| 68 |
+
const supportsUrlMode = hasUrlCapability;
|
| 69 |
+
return { supportsFormMode, supportsUrlMode };
|
| 70 |
+
}
|
| 71 |
+
/**
|
| 72 |
+
* An MCP client on top of a pluggable transport.
|
| 73 |
+
*
|
| 74 |
+
* The client will automatically begin the initialization flow with the server when connect() is called.
|
| 75 |
+
*
|
| 76 |
+
* To use with custom types, extend the base Request/Notification/Result types and pass them as type parameters:
|
| 77 |
+
*
|
| 78 |
+
* ```typescript
|
| 79 |
+
* // Custom schemas
|
| 80 |
+
* const CustomRequestSchema = RequestSchema.extend({...})
|
| 81 |
+
* const CustomNotificationSchema = NotificationSchema.extend({...})
|
| 82 |
+
* const CustomResultSchema = ResultSchema.extend({...})
|
| 83 |
+
*
|
| 84 |
+
* // Type aliases
|
| 85 |
+
* type CustomRequest = z.infer<typeof CustomRequestSchema>
|
| 86 |
+
* type CustomNotification = z.infer<typeof CustomNotificationSchema>
|
| 87 |
+
* type CustomResult = z.infer<typeof CustomResultSchema>
|
| 88 |
+
*
|
| 89 |
+
* // Create typed client
|
| 90 |
+
* const client = new Client<CustomRequest, CustomNotification, CustomResult>({
|
| 91 |
+
* name: "CustomClient",
|
| 92 |
+
* version: "1.0.0"
|
| 93 |
+
* })
|
| 94 |
+
* ```
|
| 95 |
+
*/
|
| 96 |
+
export class Client extends Protocol {
|
| 97 |
+
/**
|
| 98 |
+
* Initializes this client with the given name and version information.
|
| 99 |
+
*/
|
| 100 |
+
constructor(_clientInfo, options) {
|
| 101 |
+
super(options);
|
| 102 |
+
this._clientInfo = _clientInfo;
|
| 103 |
+
this._cachedToolOutputValidators = new Map();
|
| 104 |
+
this._cachedKnownTaskTools = new Set();
|
| 105 |
+
this._cachedRequiredTaskTools = new Set();
|
| 106 |
+
this._listChangedDebounceTimers = new Map();
|
| 107 |
+
this._capabilities = options?.capabilities ?? {};
|
| 108 |
+
this._jsonSchemaValidator = options?.jsonSchemaValidator ?? new AjvJsonSchemaValidator();
|
| 109 |
+
// Store list changed config for setup after connection (when we know server capabilities)
|
| 110 |
+
if (options?.listChanged) {
|
| 111 |
+
this._pendingListChangedConfig = options.listChanged;
|
| 112 |
+
}
|
| 113 |
+
}
|
| 114 |
+
/**
|
| 115 |
+
* Set up handlers for list changed notifications based on config and server capabilities.
|
| 116 |
+
* This should only be called after initialization when server capabilities are known.
|
| 117 |
+
* Handlers are silently skipped if the server doesn't advertise the corresponding listChanged capability.
|
| 118 |
+
* @internal
|
| 119 |
+
*/
|
| 120 |
+
_setupListChangedHandlers(config) {
|
| 121 |
+
if (config.tools && this._serverCapabilities?.tools?.listChanged) {
|
| 122 |
+
this._setupListChangedHandler('tools', ToolListChangedNotificationSchema, config.tools, async () => {
|
| 123 |
+
const result = await this.listTools();
|
| 124 |
+
return result.tools;
|
| 125 |
+
});
|
| 126 |
+
}
|
| 127 |
+
if (config.prompts && this._serverCapabilities?.prompts?.listChanged) {
|
| 128 |
+
this._setupListChangedHandler('prompts', PromptListChangedNotificationSchema, config.prompts, async () => {
|
| 129 |
+
const result = await this.listPrompts();
|
| 130 |
+
return result.prompts;
|
| 131 |
+
});
|
| 132 |
+
}
|
| 133 |
+
if (config.resources && this._serverCapabilities?.resources?.listChanged) {
|
| 134 |
+
this._setupListChangedHandler('resources', ResourceListChangedNotificationSchema, config.resources, async () => {
|
| 135 |
+
const result = await this.listResources();
|
| 136 |
+
return result.resources;
|
| 137 |
+
});
|
| 138 |
+
}
|
| 139 |
+
}
|
| 140 |
+
/**
|
| 141 |
+
* Access experimental features.
|
| 142 |
+
*
|
| 143 |
+
* WARNING: These APIs are experimental and may change without notice.
|
| 144 |
+
*
|
| 145 |
+
* @experimental
|
| 146 |
+
*/
|
| 147 |
+
get experimental() {
|
| 148 |
+
if (!this._experimental) {
|
| 149 |
+
this._experimental = {
|
| 150 |
+
tasks: new ExperimentalClientTasks(this)
|
| 151 |
+
};
|
| 152 |
+
}
|
| 153 |
+
return this._experimental;
|
| 154 |
+
}
|
| 155 |
+
/**
|
| 156 |
+
* Registers new capabilities. This can only be called before connecting to a transport.
|
| 157 |
+
*
|
| 158 |
+
* The new capabilities will be merged with any existing capabilities previously given (e.g., at initialization).
|
| 159 |
+
*/
|
| 160 |
+
registerCapabilities(capabilities) {
|
| 161 |
+
if (this.transport) {
|
| 162 |
+
throw new Error('Cannot register capabilities after connecting to transport');
|
| 163 |
+
}
|
| 164 |
+
this._capabilities = mergeCapabilities(this._capabilities, capabilities);
|
| 165 |
+
}
|
| 166 |
+
/**
|
| 167 |
+
* Override request handler registration to enforce client-side validation for elicitation.
|
| 168 |
+
*/
|
| 169 |
+
setRequestHandler(requestSchema, handler) {
|
| 170 |
+
const shape = getObjectShape(requestSchema);
|
| 171 |
+
const methodSchema = shape?.method;
|
| 172 |
+
if (!methodSchema) {
|
| 173 |
+
throw new Error('Schema is missing a method literal');
|
| 174 |
+
}
|
| 175 |
+
// Extract literal value using type-safe property access
|
| 176 |
+
let methodValue;
|
| 177 |
+
if (isZ4Schema(methodSchema)) {
|
| 178 |
+
const v4Schema = methodSchema;
|
| 179 |
+
const v4Def = v4Schema._zod?.def;
|
| 180 |
+
methodValue = v4Def?.value ?? v4Schema.value;
|
| 181 |
+
}
|
| 182 |
+
else {
|
| 183 |
+
const v3Schema = methodSchema;
|
| 184 |
+
const legacyDef = v3Schema._def;
|
| 185 |
+
methodValue = legacyDef?.value ?? v3Schema.value;
|
| 186 |
+
}
|
| 187 |
+
if (typeof methodValue !== 'string') {
|
| 188 |
+
throw new Error('Schema method literal must be a string');
|
| 189 |
+
}
|
| 190 |
+
const method = methodValue;
|
| 191 |
+
if (method === 'elicitation/create') {
|
| 192 |
+
const wrappedHandler = async (request, extra) => {
|
| 193 |
+
const validatedRequest = safeParse(ElicitRequestSchema, request);
|
| 194 |
+
if (!validatedRequest.success) {
|
| 195 |
+
// Type guard: if success is false, error is guaranteed to exist
|
| 196 |
+
const errorMessage = validatedRequest.error instanceof Error ? validatedRequest.error.message : String(validatedRequest.error);
|
| 197 |
+
throw new McpError(ErrorCode.InvalidParams, `Invalid elicitation request: ${errorMessage}`);
|
| 198 |
+
}
|
| 199 |
+
const { params } = validatedRequest.data;
|
| 200 |
+
params.mode = params.mode ?? 'form';
|
| 201 |
+
const { supportsFormMode, supportsUrlMode } = getSupportedElicitationModes(this._capabilities.elicitation);
|
| 202 |
+
if (params.mode === 'form' && !supportsFormMode) {
|
| 203 |
+
throw new McpError(ErrorCode.InvalidParams, 'Client does not support form-mode elicitation requests');
|
| 204 |
+
}
|
| 205 |
+
if (params.mode === 'url' && !supportsUrlMode) {
|
| 206 |
+
throw new McpError(ErrorCode.InvalidParams, 'Client does not support URL-mode elicitation requests');
|
| 207 |
+
}
|
| 208 |
+
const result = await Promise.resolve(handler(request, extra));
|
| 209 |
+
// When task creation is requested, validate and return CreateTaskResult
|
| 210 |
+
if (params.task) {
|
| 211 |
+
const taskValidationResult = safeParse(CreateTaskResultSchema, result);
|
| 212 |
+
if (!taskValidationResult.success) {
|
| 213 |
+
const errorMessage = taskValidationResult.error instanceof Error
|
| 214 |
+
? taskValidationResult.error.message
|
| 215 |
+
: String(taskValidationResult.error);
|
| 216 |
+
throw new McpError(ErrorCode.InvalidParams, `Invalid task creation result: ${errorMessage}`);
|
| 217 |
+
}
|
| 218 |
+
return taskValidationResult.data;
|
| 219 |
+
}
|
| 220 |
+
// For non-task requests, validate against ElicitResultSchema
|
| 221 |
+
const validationResult = safeParse(ElicitResultSchema, result);
|
| 222 |
+
if (!validationResult.success) {
|
| 223 |
+
// Type guard: if success is false, error is guaranteed to exist
|
| 224 |
+
const errorMessage = validationResult.error instanceof Error ? validationResult.error.message : String(validationResult.error);
|
| 225 |
+
throw new McpError(ErrorCode.InvalidParams, `Invalid elicitation result: ${errorMessage}`);
|
| 226 |
+
}
|
| 227 |
+
const validatedResult = validationResult.data;
|
| 228 |
+
const requestedSchema = params.mode === 'form' ? params.requestedSchema : undefined;
|
| 229 |
+
if (params.mode === 'form' && validatedResult.action === 'accept' && validatedResult.content && requestedSchema) {
|
| 230 |
+
if (this._capabilities.elicitation?.form?.applyDefaults) {
|
| 231 |
+
try {
|
| 232 |
+
applyElicitationDefaults(requestedSchema, validatedResult.content);
|
| 233 |
+
}
|
| 234 |
+
catch {
|
| 235 |
+
// gracefully ignore errors in default application
|
| 236 |
+
}
|
| 237 |
+
}
|
| 238 |
+
}
|
| 239 |
+
return validatedResult;
|
| 240 |
+
};
|
| 241 |
+
// Install the wrapped handler
|
| 242 |
+
return super.setRequestHandler(requestSchema, wrappedHandler);
|
| 243 |
+
}
|
| 244 |
+
if (method === 'sampling/createMessage') {
|
| 245 |
+
const wrappedHandler = async (request, extra) => {
|
| 246 |
+
const validatedRequest = safeParse(CreateMessageRequestSchema, request);
|
| 247 |
+
if (!validatedRequest.success) {
|
| 248 |
+
const errorMessage = validatedRequest.error instanceof Error ? validatedRequest.error.message : String(validatedRequest.error);
|
| 249 |
+
throw new McpError(ErrorCode.InvalidParams, `Invalid sampling request: ${errorMessage}`);
|
| 250 |
+
}
|
| 251 |
+
const { params } = validatedRequest.data;
|
| 252 |
+
const result = await Promise.resolve(handler(request, extra));
|
| 253 |
+
// When task creation is requested, validate and return CreateTaskResult
|
| 254 |
+
if (params.task) {
|
| 255 |
+
const taskValidationResult = safeParse(CreateTaskResultSchema, result);
|
| 256 |
+
if (!taskValidationResult.success) {
|
| 257 |
+
const errorMessage = taskValidationResult.error instanceof Error
|
| 258 |
+
? taskValidationResult.error.message
|
| 259 |
+
: String(taskValidationResult.error);
|
| 260 |
+
throw new McpError(ErrorCode.InvalidParams, `Invalid task creation result: ${errorMessage}`);
|
| 261 |
+
}
|
| 262 |
+
return taskValidationResult.data;
|
| 263 |
+
}
|
| 264 |
+
// For non-task requests, validate against appropriate schema based on tools presence
|
| 265 |
+
const hasTools = params.tools || params.toolChoice;
|
| 266 |
+
const resultSchema = hasTools ? CreateMessageResultWithToolsSchema : CreateMessageResultSchema;
|
| 267 |
+
const validationResult = safeParse(resultSchema, result);
|
| 268 |
+
if (!validationResult.success) {
|
| 269 |
+
const errorMessage = validationResult.error instanceof Error ? validationResult.error.message : String(validationResult.error);
|
| 270 |
+
throw new McpError(ErrorCode.InvalidParams, `Invalid sampling result: ${errorMessage}`);
|
| 271 |
+
}
|
| 272 |
+
return validationResult.data;
|
| 273 |
+
};
|
| 274 |
+
// Install the wrapped handler
|
| 275 |
+
return super.setRequestHandler(requestSchema, wrappedHandler);
|
| 276 |
+
}
|
| 277 |
+
// Other handlers use default behavior
|
| 278 |
+
return super.setRequestHandler(requestSchema, handler);
|
| 279 |
+
}
|
| 280 |
+
assertCapability(capability, method) {
|
| 281 |
+
if (!this._serverCapabilities?.[capability]) {
|
| 282 |
+
throw new Error(`Server does not support ${capability} (required for ${method})`);
|
| 283 |
+
}
|
| 284 |
+
}
|
| 285 |
+
async connect(transport, options) {
|
| 286 |
+
await super.connect(transport);
|
| 287 |
+
// When transport sessionId is already set this means we are trying to reconnect.
|
| 288 |
+
// In this case we don't need to initialize again.
|
| 289 |
+
if (transport.sessionId !== undefined) {
|
| 290 |
+
return;
|
| 291 |
+
}
|
| 292 |
+
try {
|
| 293 |
+
const result = await this.request({
|
| 294 |
+
method: 'initialize',
|
| 295 |
+
params: {
|
| 296 |
+
protocolVersion: LATEST_PROTOCOL_VERSION,
|
| 297 |
+
capabilities: this._capabilities,
|
| 298 |
+
clientInfo: this._clientInfo
|
| 299 |
+
}
|
| 300 |
+
}, InitializeResultSchema, options);
|
| 301 |
+
if (result === undefined) {
|
| 302 |
+
throw new Error(`Server sent invalid initialize result: ${result}`);
|
| 303 |
+
}
|
| 304 |
+
if (!SUPPORTED_PROTOCOL_VERSIONS.includes(result.protocolVersion)) {
|
| 305 |
+
throw new Error(`Server's protocol version is not supported: ${result.protocolVersion}`);
|
| 306 |
+
}
|
| 307 |
+
this._serverCapabilities = result.capabilities;
|
| 308 |
+
this._serverVersion = result.serverInfo;
|
| 309 |
+
// HTTP transports must set the protocol version in each header after initialization.
|
| 310 |
+
if (transport.setProtocolVersion) {
|
| 311 |
+
transport.setProtocolVersion(result.protocolVersion);
|
| 312 |
+
}
|
| 313 |
+
this._instructions = result.instructions;
|
| 314 |
+
await this.notification({
|
| 315 |
+
method: 'notifications/initialized'
|
| 316 |
+
});
|
| 317 |
+
// Set up list changed handlers now that we know server capabilities
|
| 318 |
+
if (this._pendingListChangedConfig) {
|
| 319 |
+
this._setupListChangedHandlers(this._pendingListChangedConfig);
|
| 320 |
+
this._pendingListChangedConfig = undefined;
|
| 321 |
+
}
|
| 322 |
+
}
|
| 323 |
+
catch (error) {
|
| 324 |
+
// Disconnect if initialization fails.
|
| 325 |
+
void this.close();
|
| 326 |
+
throw error;
|
| 327 |
+
}
|
| 328 |
+
}
|
| 329 |
+
/**
|
| 330 |
+
* After initialization has completed, this will be populated with the server's reported capabilities.
|
| 331 |
+
*/
|
| 332 |
+
getServerCapabilities() {
|
| 333 |
+
return this._serverCapabilities;
|
| 334 |
+
}
|
| 335 |
+
/**
|
| 336 |
+
* After initialization has completed, this will be populated with information about the server's name and version.
|
| 337 |
+
*/
|
| 338 |
+
getServerVersion() {
|
| 339 |
+
return this._serverVersion;
|
| 340 |
+
}
|
| 341 |
+
/**
|
| 342 |
+
* After initialization has completed, this may be populated with information about the server's instructions.
|
| 343 |
+
*/
|
| 344 |
+
getInstructions() {
|
| 345 |
+
return this._instructions;
|
| 346 |
+
}
|
| 347 |
+
assertCapabilityForMethod(method) {
|
| 348 |
+
switch (method) {
|
| 349 |
+
case 'logging/setLevel':
|
| 350 |
+
if (!this._serverCapabilities?.logging) {
|
| 351 |
+
throw new Error(`Server does not support logging (required for ${method})`);
|
| 352 |
+
}
|
| 353 |
+
break;
|
| 354 |
+
case 'prompts/get':
|
| 355 |
+
case 'prompts/list':
|
| 356 |
+
if (!this._serverCapabilities?.prompts) {
|
| 357 |
+
throw new Error(`Server does not support prompts (required for ${method})`);
|
| 358 |
+
}
|
| 359 |
+
break;
|
| 360 |
+
case 'resources/list':
|
| 361 |
+
case 'resources/templates/list':
|
| 362 |
+
case 'resources/read':
|
| 363 |
+
case 'resources/subscribe':
|
| 364 |
+
case 'resources/unsubscribe':
|
| 365 |
+
if (!this._serverCapabilities?.resources) {
|
| 366 |
+
throw new Error(`Server does not support resources (required for ${method})`);
|
| 367 |
+
}
|
| 368 |
+
if (method === 'resources/subscribe' && !this._serverCapabilities.resources.subscribe) {
|
| 369 |
+
throw new Error(`Server does not support resource subscriptions (required for ${method})`);
|
| 370 |
+
}
|
| 371 |
+
break;
|
| 372 |
+
case 'tools/call':
|
| 373 |
+
case 'tools/list':
|
| 374 |
+
if (!this._serverCapabilities?.tools) {
|
| 375 |
+
throw new Error(`Server does not support tools (required for ${method})`);
|
| 376 |
+
}
|
| 377 |
+
break;
|
| 378 |
+
case 'completion/complete':
|
| 379 |
+
if (!this._serverCapabilities?.completions) {
|
| 380 |
+
throw new Error(`Server does not support completions (required for ${method})`);
|
| 381 |
+
}
|
| 382 |
+
break;
|
| 383 |
+
case 'initialize':
|
| 384 |
+
// No specific capability required for initialize
|
| 385 |
+
break;
|
| 386 |
+
case 'ping':
|
| 387 |
+
// No specific capability required for ping
|
| 388 |
+
break;
|
| 389 |
+
}
|
| 390 |
+
}
|
| 391 |
+
assertNotificationCapability(method) {
|
| 392 |
+
switch (method) {
|
| 393 |
+
case 'notifications/roots/list_changed':
|
| 394 |
+
if (!this._capabilities.roots?.listChanged) {
|
| 395 |
+
throw new Error(`Client does not support roots list changed notifications (required for ${method})`);
|
| 396 |
+
}
|
| 397 |
+
break;
|
| 398 |
+
case 'notifications/initialized':
|
| 399 |
+
// No specific capability required for initialized
|
| 400 |
+
break;
|
| 401 |
+
case 'notifications/cancelled':
|
| 402 |
+
// Cancellation notifications are always allowed
|
| 403 |
+
break;
|
| 404 |
+
case 'notifications/progress':
|
| 405 |
+
// Progress notifications are always allowed
|
| 406 |
+
break;
|
| 407 |
+
}
|
| 408 |
+
}
|
| 409 |
+
assertRequestHandlerCapability(method) {
|
| 410 |
+
// Task handlers are registered in Protocol constructor before _capabilities is initialized
|
| 411 |
+
// Skip capability check for task methods during initialization
|
| 412 |
+
if (!this._capabilities) {
|
| 413 |
+
return;
|
| 414 |
+
}
|
| 415 |
+
switch (method) {
|
| 416 |
+
case 'sampling/createMessage':
|
| 417 |
+
if (!this._capabilities.sampling) {
|
| 418 |
+
throw new Error(`Client does not support sampling capability (required for ${method})`);
|
| 419 |
+
}
|
| 420 |
+
break;
|
| 421 |
+
case 'elicitation/create':
|
| 422 |
+
if (!this._capabilities.elicitation) {
|
| 423 |
+
throw new Error(`Client does not support elicitation capability (required for ${method})`);
|
| 424 |
+
}
|
| 425 |
+
break;
|
| 426 |
+
case 'roots/list':
|
| 427 |
+
if (!this._capabilities.roots) {
|
| 428 |
+
throw new Error(`Client does not support roots capability (required for ${method})`);
|
| 429 |
+
}
|
| 430 |
+
break;
|
| 431 |
+
case 'tasks/get':
|
| 432 |
+
case 'tasks/list':
|
| 433 |
+
case 'tasks/result':
|
| 434 |
+
case 'tasks/cancel':
|
| 435 |
+
if (!this._capabilities.tasks) {
|
| 436 |
+
throw new Error(`Client does not support tasks capability (required for ${method})`);
|
| 437 |
+
}
|
| 438 |
+
break;
|
| 439 |
+
case 'ping':
|
| 440 |
+
// No specific capability required for ping
|
| 441 |
+
break;
|
| 442 |
+
}
|
| 443 |
+
}
|
| 444 |
+
assertTaskCapability(method) {
|
| 445 |
+
assertToolsCallTaskCapability(this._serverCapabilities?.tasks?.requests, method, 'Server');
|
| 446 |
+
}
|
| 447 |
+
assertTaskHandlerCapability(method) {
|
| 448 |
+
// Task handlers are registered in Protocol constructor before _capabilities is initialized
|
| 449 |
+
// Skip capability check for task methods during initialization
|
| 450 |
+
if (!this._capabilities) {
|
| 451 |
+
return;
|
| 452 |
+
}
|
| 453 |
+
assertClientRequestTaskCapability(this._capabilities.tasks?.requests, method, 'Client');
|
| 454 |
+
}
|
| 455 |
+
async ping(options) {
|
| 456 |
+
return this.request({ method: 'ping' }, EmptyResultSchema, options);
|
| 457 |
+
}
|
| 458 |
+
async complete(params, options) {
|
| 459 |
+
return this.request({ method: 'completion/complete', params }, CompleteResultSchema, options);
|
| 460 |
+
}
|
| 461 |
+
async setLoggingLevel(level, options) {
|
| 462 |
+
return this.request({ method: 'logging/setLevel', params: { level } }, EmptyResultSchema, options);
|
| 463 |
+
}
|
| 464 |
+
async getPrompt(params, options) {
|
| 465 |
+
return this.request({ method: 'prompts/get', params }, GetPromptResultSchema, options);
|
| 466 |
+
}
|
| 467 |
+
async listPrompts(params, options) {
|
| 468 |
+
return this.request({ method: 'prompts/list', params }, ListPromptsResultSchema, options);
|
| 469 |
+
}
|
| 470 |
+
async listResources(params, options) {
|
| 471 |
+
return this.request({ method: 'resources/list', params }, ListResourcesResultSchema, options);
|
| 472 |
+
}
|
| 473 |
+
async listResourceTemplates(params, options) {
|
| 474 |
+
return this.request({ method: 'resources/templates/list', params }, ListResourceTemplatesResultSchema, options);
|
| 475 |
+
}
|
| 476 |
+
async readResource(params, options) {
|
| 477 |
+
return this.request({ method: 'resources/read', params }, ReadResourceResultSchema, options);
|
| 478 |
+
}
|
| 479 |
+
async subscribeResource(params, options) {
|
| 480 |
+
return this.request({ method: 'resources/subscribe', params }, EmptyResultSchema, options);
|
| 481 |
+
}
|
| 482 |
+
async unsubscribeResource(params, options) {
|
| 483 |
+
return this.request({ method: 'resources/unsubscribe', params }, EmptyResultSchema, options);
|
| 484 |
+
}
|
| 485 |
+
/**
|
| 486 |
+
* Calls a tool and waits for the result. Automatically validates structured output if the tool has an outputSchema.
|
| 487 |
+
*
|
| 488 |
+
* For task-based execution with streaming behavior, use client.experimental.tasks.callToolStream() instead.
|
| 489 |
+
*/
|
| 490 |
+
async callTool(params, resultSchema = CallToolResultSchema, options) {
|
| 491 |
+
// Guard: required-task tools need experimental API
|
| 492 |
+
if (this.isToolTaskRequired(params.name)) {
|
| 493 |
+
throw new McpError(ErrorCode.InvalidRequest, `Tool "${params.name}" requires task-based execution. Use client.experimental.tasks.callToolStream() instead.`);
|
| 494 |
+
}
|
| 495 |
+
const result = await this.request({ method: 'tools/call', params }, resultSchema, options);
|
| 496 |
+
// Check if the tool has an outputSchema
|
| 497 |
+
const validator = this.getToolOutputValidator(params.name);
|
| 498 |
+
if (validator) {
|
| 499 |
+
// If tool has outputSchema, it MUST return structuredContent (unless it's an error)
|
| 500 |
+
if (!result.structuredContent && !result.isError) {
|
| 501 |
+
throw new McpError(ErrorCode.InvalidRequest, `Tool ${params.name} has an output schema but did not return structured content`);
|
| 502 |
+
}
|
| 503 |
+
// Only validate structured content if present (not when there's an error)
|
| 504 |
+
if (result.structuredContent) {
|
| 505 |
+
try {
|
| 506 |
+
// Validate the structured content against the schema
|
| 507 |
+
const validationResult = validator(result.structuredContent);
|
| 508 |
+
if (!validationResult.valid) {
|
| 509 |
+
throw new McpError(ErrorCode.InvalidParams, `Structured content does not match the tool's output schema: ${validationResult.errorMessage}`);
|
| 510 |
+
}
|
| 511 |
+
}
|
| 512 |
+
catch (error) {
|
| 513 |
+
if (error instanceof McpError) {
|
| 514 |
+
throw error;
|
| 515 |
+
}
|
| 516 |
+
throw new McpError(ErrorCode.InvalidParams, `Failed to validate structured content: ${error instanceof Error ? error.message : String(error)}`);
|
| 517 |
+
}
|
| 518 |
+
}
|
| 519 |
+
}
|
| 520 |
+
return result;
|
| 521 |
+
}
|
| 522 |
+
isToolTask(toolName) {
|
| 523 |
+
if (!this._serverCapabilities?.tasks?.requests?.tools?.call) {
|
| 524 |
+
return false;
|
| 525 |
+
}
|
| 526 |
+
return this._cachedKnownTaskTools.has(toolName);
|
| 527 |
+
}
|
| 528 |
+
/**
|
| 529 |
+
* Check if a tool requires task-based execution.
|
| 530 |
+
* Unlike isToolTask which includes 'optional' tools, this only checks for 'required'.
|
| 531 |
+
*/
|
| 532 |
+
isToolTaskRequired(toolName) {
|
| 533 |
+
return this._cachedRequiredTaskTools.has(toolName);
|
| 534 |
+
}
|
| 535 |
+
/**
|
| 536 |
+
* Cache validators for tool output schemas.
|
| 537 |
+
* Called after listTools() to pre-compile validators for better performance.
|
| 538 |
+
*/
|
| 539 |
+
cacheToolMetadata(tools) {
|
| 540 |
+
this._cachedToolOutputValidators.clear();
|
| 541 |
+
this._cachedKnownTaskTools.clear();
|
| 542 |
+
this._cachedRequiredTaskTools.clear();
|
| 543 |
+
for (const tool of tools) {
|
| 544 |
+
// If the tool has an outputSchema, create and cache the validator
|
| 545 |
+
if (tool.outputSchema) {
|
| 546 |
+
const toolValidator = this._jsonSchemaValidator.getValidator(tool.outputSchema);
|
| 547 |
+
this._cachedToolOutputValidators.set(tool.name, toolValidator);
|
| 548 |
+
}
|
| 549 |
+
// If the tool supports task-based execution, cache that information
|
| 550 |
+
const taskSupport = tool.execution?.taskSupport;
|
| 551 |
+
if (taskSupport === 'required' || taskSupport === 'optional') {
|
| 552 |
+
this._cachedKnownTaskTools.add(tool.name);
|
| 553 |
+
}
|
| 554 |
+
if (taskSupport === 'required') {
|
| 555 |
+
this._cachedRequiredTaskTools.add(tool.name);
|
| 556 |
+
}
|
| 557 |
+
}
|
| 558 |
+
}
|
| 559 |
+
/**
|
| 560 |
+
* Get cached validator for a tool
|
| 561 |
+
*/
|
| 562 |
+
getToolOutputValidator(toolName) {
|
| 563 |
+
return this._cachedToolOutputValidators.get(toolName);
|
| 564 |
+
}
|
| 565 |
+
async listTools(params, options) {
|
| 566 |
+
const result = await this.request({ method: 'tools/list', params }, ListToolsResultSchema, options);
|
| 567 |
+
// Cache the tools and their output schemas for future validation
|
| 568 |
+
this.cacheToolMetadata(result.tools);
|
| 569 |
+
return result;
|
| 570 |
+
}
|
| 571 |
+
/**
|
| 572 |
+
* Set up a single list changed handler.
|
| 573 |
+
* @internal
|
| 574 |
+
*/
|
| 575 |
+
_setupListChangedHandler(listType, notificationSchema, options, fetcher) {
|
| 576 |
+
// Validate options using Zod schema (validates autoRefresh and debounceMs)
|
| 577 |
+
const parseResult = ListChangedOptionsBaseSchema.safeParse(options);
|
| 578 |
+
if (!parseResult.success) {
|
| 579 |
+
throw new Error(`Invalid ${listType} listChanged options: ${parseResult.error.message}`);
|
| 580 |
+
}
|
| 581 |
+
// Validate callback
|
| 582 |
+
if (typeof options.onChanged !== 'function') {
|
| 583 |
+
throw new Error(`Invalid ${listType} listChanged options: onChanged must be a function`);
|
| 584 |
+
}
|
| 585 |
+
const { autoRefresh, debounceMs } = parseResult.data;
|
| 586 |
+
const { onChanged } = options;
|
| 587 |
+
const refresh = async () => {
|
| 588 |
+
if (!autoRefresh) {
|
| 589 |
+
onChanged(null, null);
|
| 590 |
+
return;
|
| 591 |
+
}
|
| 592 |
+
try {
|
| 593 |
+
const items = await fetcher();
|
| 594 |
+
onChanged(null, items);
|
| 595 |
+
}
|
| 596 |
+
catch (e) {
|
| 597 |
+
const error = e instanceof Error ? e : new Error(String(e));
|
| 598 |
+
onChanged(error, null);
|
| 599 |
+
}
|
| 600 |
+
};
|
| 601 |
+
const handler = () => {
|
| 602 |
+
if (debounceMs) {
|
| 603 |
+
// Clear any pending debounce timer for this list type
|
| 604 |
+
const existingTimer = this._listChangedDebounceTimers.get(listType);
|
| 605 |
+
if (existingTimer) {
|
| 606 |
+
clearTimeout(existingTimer);
|
| 607 |
+
}
|
| 608 |
+
// Set up debounced refresh
|
| 609 |
+
const timer = setTimeout(refresh, debounceMs);
|
| 610 |
+
this._listChangedDebounceTimers.set(listType, timer);
|
| 611 |
+
}
|
| 612 |
+
else {
|
| 613 |
+
// No debounce, refresh immediately
|
| 614 |
+
refresh();
|
| 615 |
+
}
|
| 616 |
+
};
|
| 617 |
+
// Register notification handler
|
| 618 |
+
this.setNotificationHandler(notificationSchema, handler);
|
| 619 |
+
}
|
| 620 |
+
async sendRootsListChanged() {
|
| 621 |
+
return this.notification({ method: 'notifications/roots/list_changed' });
|
| 622 |
+
}
|
| 623 |
+
}
|
| 624 |
+
//# sourceMappingURL=index.js.map
|
node_modules/@modelcontextprotocol/sdk/dist/esm/client/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/client/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAA6C,MAAM,uBAAuB,CAAC;AAG/G,OAAO,EAEH,oBAAoB,EAOpB,oBAAoB,EACpB,iBAAiB,EACjB,SAAS,EAET,qBAAqB,EAErB,sBAAsB,EACtB,uBAAuB,EAEvB,uBAAuB,EAEvB,yBAAyB,EAEzB,iCAAiC,EAEjC,qBAAqB,EAErB,QAAQ,EAER,wBAAwB,EAExB,2BAA2B,EAI3B,kBAAkB,EAClB,mBAAmB,EACnB,sBAAsB,EACtB,0BAA0B,EAC1B,yBAAyB,EACzB,kCAAkC,EAClC,iCAAiC,EACjC,mCAAmC,EACnC,qCAAqC,EAErC,4BAA4B,EAK/B,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAEvE,OAAO,EAGH,cAAc,EACd,UAAU,EACV,SAAS,EAGZ,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { OAuthClientProvider } from './auth.js';
|
| 2 |
+
import { FetchLike } from '../shared/transport.js';
|
| 3 |
+
/**
|
| 4 |
+
* Middleware function that wraps and enhances fetch functionality.
|
| 5 |
+
* Takes a fetch handler and returns an enhanced fetch handler.
|
| 6 |
+
*/
|
| 7 |
+
export type Middleware = (next: FetchLike) => FetchLike;
|
| 8 |
+
/**
|
| 9 |
+
* Creates a fetch wrapper that handles OAuth authentication automatically.
|
| 10 |
+
*
|
| 11 |
+
* This wrapper will:
|
| 12 |
+
* - Add Authorization headers with access tokens
|
| 13 |
+
* - Handle 401 responses by attempting re-authentication
|
| 14 |
+
* - Retry the original request after successful auth
|
| 15 |
+
* - Handle OAuth errors appropriately (InvalidClientError, etc.)
|
| 16 |
+
*
|
| 17 |
+
* The baseUrl parameter is optional and defaults to using the domain from the request URL.
|
| 18 |
+
* However, you should explicitly provide baseUrl when:
|
| 19 |
+
* - Making requests to multiple subdomains (e.g., api.example.com, cdn.example.com)
|
| 20 |
+
* - Using API paths that differ from OAuth discovery paths (e.g., requesting /api/v1/data but OAuth is at /)
|
| 21 |
+
* - The OAuth server is on a different domain than your API requests
|
| 22 |
+
* - You want to ensure consistent OAuth behavior regardless of request URLs
|
| 23 |
+
*
|
| 24 |
+
* For MCP transports, set baseUrl to the same URL you pass to the transport constructor.
|
| 25 |
+
*
|
| 26 |
+
* Note: This wrapper is designed for general-purpose fetch operations.
|
| 27 |
+
* MCP transports (SSE and StreamableHTTP) already have built-in OAuth handling
|
| 28 |
+
* and should not need this wrapper.
|
| 29 |
+
*
|
| 30 |
+
* @param provider - OAuth client provider for authentication
|
| 31 |
+
* @param baseUrl - Base URL for OAuth server discovery (defaults to request URL domain)
|
| 32 |
+
* @returns A fetch middleware function
|
| 33 |
+
*/
|
| 34 |
+
export declare const withOAuth: (provider: OAuthClientProvider, baseUrl?: string | URL) => Middleware;
|
| 35 |
+
/**
|
| 36 |
+
* Logger function type for HTTP requests
|
| 37 |
+
*/
|
| 38 |
+
export type RequestLogger = (input: {
|
| 39 |
+
method: string;
|
| 40 |
+
url: string | URL;
|
| 41 |
+
status: number;
|
| 42 |
+
statusText: string;
|
| 43 |
+
duration: number;
|
| 44 |
+
requestHeaders?: Headers;
|
| 45 |
+
responseHeaders?: Headers;
|
| 46 |
+
error?: Error;
|
| 47 |
+
}) => void;
|
| 48 |
+
/**
|
| 49 |
+
* Configuration options for the logging middleware
|
| 50 |
+
*/
|
| 51 |
+
export type LoggingOptions = {
|
| 52 |
+
/**
|
| 53 |
+
* Custom logger function, defaults to console logging
|
| 54 |
+
*/
|
| 55 |
+
logger?: RequestLogger;
|
| 56 |
+
/**
|
| 57 |
+
* Whether to include request headers in logs
|
| 58 |
+
* @default false
|
| 59 |
+
*/
|
| 60 |
+
includeRequestHeaders?: boolean;
|
| 61 |
+
/**
|
| 62 |
+
* Whether to include response headers in logs
|
| 63 |
+
* @default false
|
| 64 |
+
*/
|
| 65 |
+
includeResponseHeaders?: boolean;
|
| 66 |
+
/**
|
| 67 |
+
* Status level filter - only log requests with status >= this value
|
| 68 |
+
* Set to 0 to log all requests, 400 to log only errors
|
| 69 |
+
* @default 0
|
| 70 |
+
*/
|
| 71 |
+
statusLevel?: number;
|
| 72 |
+
};
|
| 73 |
+
/**
|
| 74 |
+
* Creates a fetch middleware that logs HTTP requests and responses.
|
| 75 |
+
*
|
| 76 |
+
* When called without arguments `withLogging()`, it uses the default logger that:
|
| 77 |
+
* - Logs successful requests (2xx) to `console.log`
|
| 78 |
+
* - Logs error responses (4xx/5xx) and network errors to `console.error`
|
| 79 |
+
* - Logs all requests regardless of status (statusLevel: 0)
|
| 80 |
+
* - Does not include request or response headers in logs
|
| 81 |
+
* - Measures and displays request duration in milliseconds
|
| 82 |
+
*
|
| 83 |
+
* Important: the default logger uses both `console.log` and `console.error` so it should not be used with
|
| 84 |
+
* `stdio` transports and applications.
|
| 85 |
+
*
|
| 86 |
+
* @param options - Logging configuration options
|
| 87 |
+
* @returns A fetch middleware function
|
| 88 |
+
*/
|
| 89 |
+
export declare const withLogging: (options?: LoggingOptions) => Middleware;
|
| 90 |
+
/**
|
| 91 |
+
* Composes multiple fetch middleware functions into a single middleware pipeline.
|
| 92 |
+
* Middleware are applied in the order they appear, creating a chain of handlers.
|
| 93 |
+
*
|
| 94 |
+
* @example
|
| 95 |
+
* ```typescript
|
| 96 |
+
* // Create a middleware pipeline that handles both OAuth and logging
|
| 97 |
+
* const enhancedFetch = applyMiddlewares(
|
| 98 |
+
* withOAuth(oauthProvider, 'https://api.example.com'),
|
| 99 |
+
* withLogging({ statusLevel: 400 })
|
| 100 |
+
* )(fetch);
|
| 101 |
+
*
|
| 102 |
+
* // Use the enhanced fetch - it will handle auth and log errors
|
| 103 |
+
* const response = await enhancedFetch('https://api.example.com/data');
|
| 104 |
+
* ```
|
| 105 |
+
*
|
| 106 |
+
* @param middleware - Array of fetch middleware to compose into a pipeline
|
| 107 |
+
* @returns A single composed middleware function
|
| 108 |
+
*/
|
| 109 |
+
export declare const applyMiddlewares: (...middleware: Middleware[]) => Middleware;
|
| 110 |
+
/**
|
| 111 |
+
* Helper function to create custom fetch middleware with cleaner syntax.
|
| 112 |
+
* Provides the next handler and request details as separate parameters for easier access.
|
| 113 |
+
*
|
| 114 |
+
* @example
|
| 115 |
+
* ```typescript
|
| 116 |
+
* // Create custom authentication middleware
|
| 117 |
+
* const customAuthMiddleware = createMiddleware(async (next, input, init) => {
|
| 118 |
+
* const headers = new Headers(init?.headers);
|
| 119 |
+
* headers.set('X-Custom-Auth', 'my-token');
|
| 120 |
+
*
|
| 121 |
+
* const response = await next(input, { ...init, headers });
|
| 122 |
+
*
|
| 123 |
+
* if (response.status === 401) {
|
| 124 |
+
* console.log('Authentication failed');
|
| 125 |
+
* }
|
| 126 |
+
*
|
| 127 |
+
* return response;
|
| 128 |
+
* });
|
| 129 |
+
*
|
| 130 |
+
* // Create conditional middleware
|
| 131 |
+
* const conditionalMiddleware = createMiddleware(async (next, input, init) => {
|
| 132 |
+
* const url = typeof input === 'string' ? input : input.toString();
|
| 133 |
+
*
|
| 134 |
+
* // Only add headers for API routes
|
| 135 |
+
* if (url.includes('/api/')) {
|
| 136 |
+
* const headers = new Headers(init?.headers);
|
| 137 |
+
* headers.set('X-API-Version', 'v2');
|
| 138 |
+
* return next(input, { ...init, headers });
|
| 139 |
+
* }
|
| 140 |
+
*
|
| 141 |
+
* // Pass through for non-API routes
|
| 142 |
+
* return next(input, init);
|
| 143 |
+
* });
|
| 144 |
+
*
|
| 145 |
+
* // Create caching middleware
|
| 146 |
+
* const cacheMiddleware = createMiddleware(async (next, input, init) => {
|
| 147 |
+
* const cacheKey = typeof input === 'string' ? input : input.toString();
|
| 148 |
+
*
|
| 149 |
+
* // Check cache first
|
| 150 |
+
* const cached = await getFromCache(cacheKey);
|
| 151 |
+
* if (cached) {
|
| 152 |
+
* return new Response(cached, { status: 200 });
|
| 153 |
+
* }
|
| 154 |
+
*
|
| 155 |
+
* // Make request and cache result
|
| 156 |
+
* const response = await next(input, init);
|
| 157 |
+
* if (response.ok) {
|
| 158 |
+
* await saveToCache(cacheKey, await response.clone().text());
|
| 159 |
+
* }
|
| 160 |
+
*
|
| 161 |
+
* return response;
|
| 162 |
+
* });
|
| 163 |
+
* ```
|
| 164 |
+
*
|
| 165 |
+
* @param handler - Function that receives the next handler and request parameters
|
| 166 |
+
* @returns A fetch middleware function
|
| 167 |
+
*/
|
| 168 |
+
export declare const createMiddleware: (handler: (next: FetchLike, input: string | URL, init?: RequestInit) => Promise<Response>) => Middleware;
|
| 169 |
+
//# sourceMappingURL=middleware.d.ts.map
|
node_modules/@modelcontextprotocol/sdk/dist/esm/client/middleware.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["../../../src/client/middleware.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsC,mBAAmB,EAAqB,MAAM,WAAW,CAAC;AACvG,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,IAAI,EAAE,SAAS,KAAK,SAAS,CAAC;AAExD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,SAAS,aACP,mBAAmB,YAAY,MAAM,GAAG,GAAG,KAAG,UA0DxD,CAAC;AAEN;;GAEG;AACH,MAAM,MAAM,aAAa,GA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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { auth, extractWWWAuthenticateParams, UnauthorizedError } from './auth.js';
|
| 2 |
+
/**
|
| 3 |
+
* Creates a fetch wrapper that handles OAuth authentication automatically.
|
| 4 |
+
*
|
| 5 |
+
* This wrapper will:
|
| 6 |
+
* - Add Authorization headers with access tokens
|
| 7 |
+
* - Handle 401 responses by attempting re-authentication
|
| 8 |
+
* - Retry the original request after successful auth
|
| 9 |
+
* - Handle OAuth errors appropriately (InvalidClientError, etc.)
|
| 10 |
+
*
|
| 11 |
+
* The baseUrl parameter is optional and defaults to using the domain from the request URL.
|
| 12 |
+
* However, you should explicitly provide baseUrl when:
|
| 13 |
+
* - Making requests to multiple subdomains (e.g., api.example.com, cdn.example.com)
|
| 14 |
+
* - Using API paths that differ from OAuth discovery paths (e.g., requesting /api/v1/data but OAuth is at /)
|
| 15 |
+
* - The OAuth server is on a different domain than your API requests
|
| 16 |
+
* - You want to ensure consistent OAuth behavior regardless of request URLs
|
| 17 |
+
*
|
| 18 |
+
* For MCP transports, set baseUrl to the same URL you pass to the transport constructor.
|
| 19 |
+
*
|
| 20 |
+
* Note: This wrapper is designed for general-purpose fetch operations.
|
| 21 |
+
* MCP transports (SSE and StreamableHTTP) already have built-in OAuth handling
|
| 22 |
+
* and should not need this wrapper.
|
| 23 |
+
*
|
| 24 |
+
* @param provider - OAuth client provider for authentication
|
| 25 |
+
* @param baseUrl - Base URL for OAuth server discovery (defaults to request URL domain)
|
| 26 |
+
* @returns A fetch middleware function
|
| 27 |
+
*/
|
| 28 |
+
export const withOAuth = (provider, baseUrl) => next => {
|
| 29 |
+
return async (input, init) => {
|
| 30 |
+
const makeRequest = async () => {
|
| 31 |
+
const headers = new Headers(init?.headers);
|
| 32 |
+
// Add authorization header if tokens are available
|
| 33 |
+
const tokens = await provider.tokens();
|
| 34 |
+
if (tokens) {
|
| 35 |
+
headers.set('Authorization', `Bearer ${tokens.access_token}`);
|
| 36 |
+
}
|
| 37 |
+
return await next(input, { ...init, headers });
|
| 38 |
+
};
|
| 39 |
+
let response = await makeRequest();
|
| 40 |
+
// Handle 401 responses by attempting re-authentication
|
| 41 |
+
if (response.status === 401) {
|
| 42 |
+
try {
|
| 43 |
+
const { resourceMetadataUrl, scope } = extractWWWAuthenticateParams(response);
|
| 44 |
+
// Use provided baseUrl or extract from request URL
|
| 45 |
+
const serverUrl = baseUrl || (typeof input === 'string' ? new URL(input).origin : input.origin);
|
| 46 |
+
const result = await auth(provider, {
|
| 47 |
+
serverUrl,
|
| 48 |
+
resourceMetadataUrl,
|
| 49 |
+
scope,
|
| 50 |
+
fetchFn: next
|
| 51 |
+
});
|
| 52 |
+
if (result === 'REDIRECT') {
|
| 53 |
+
throw new UnauthorizedError('Authentication requires user authorization - redirect initiated');
|
| 54 |
+
}
|
| 55 |
+
if (result !== 'AUTHORIZED') {
|
| 56 |
+
throw new UnauthorizedError(`Authentication failed with result: ${result}`);
|
| 57 |
+
}
|
| 58 |
+
// Retry the request with fresh tokens
|
| 59 |
+
response = await makeRequest();
|
| 60 |
+
}
|
| 61 |
+
catch (error) {
|
| 62 |
+
if (error instanceof UnauthorizedError) {
|
| 63 |
+
throw error;
|
| 64 |
+
}
|
| 65 |
+
throw new UnauthorizedError(`Failed to re-authenticate: ${error instanceof Error ? error.message : String(error)}`);
|
| 66 |
+
}
|
| 67 |
+
}
|
| 68 |
+
// If we still have a 401 after re-auth attempt, throw an error
|
| 69 |
+
if (response.status === 401) {
|
| 70 |
+
const url = typeof input === 'string' ? input : input.toString();
|
| 71 |
+
throw new UnauthorizedError(`Authentication failed for ${url}`);
|
| 72 |
+
}
|
| 73 |
+
return response;
|
| 74 |
+
};
|
| 75 |
+
};
|
| 76 |
+
/**
|
| 77 |
+
* Creates a fetch middleware that logs HTTP requests and responses.
|
| 78 |
+
*
|
| 79 |
+
* When called without arguments `withLogging()`, it uses the default logger that:
|
| 80 |
+
* - Logs successful requests (2xx) to `console.log`
|
| 81 |
+
* - Logs error responses (4xx/5xx) and network errors to `console.error`
|
| 82 |
+
* - Logs all requests regardless of status (statusLevel: 0)
|
| 83 |
+
* - Does not include request or response headers in logs
|
| 84 |
+
* - Measures and displays request duration in milliseconds
|
| 85 |
+
*
|
| 86 |
+
* Important: the default logger uses both `console.log` and `console.error` so it should not be used with
|
| 87 |
+
* `stdio` transports and applications.
|
| 88 |
+
*
|
| 89 |
+
* @param options - Logging configuration options
|
| 90 |
+
* @returns A fetch middleware function
|
| 91 |
+
*/
|
| 92 |
+
export const withLogging = (options = {}) => {
|
| 93 |
+
const { logger, includeRequestHeaders = false, includeResponseHeaders = false, statusLevel = 0 } = options;
|
| 94 |
+
const defaultLogger = input => {
|
| 95 |
+
const { method, url, status, statusText, duration, requestHeaders, responseHeaders, error } = input;
|
| 96 |
+
let message = error
|
| 97 |
+
? `HTTP ${method} ${url} failed: ${error.message} (${duration}ms)`
|
| 98 |
+
: `HTTP ${method} ${url} ${status} ${statusText} (${duration}ms)`;
|
| 99 |
+
// Add headers to message if requested
|
| 100 |
+
if (includeRequestHeaders && requestHeaders) {
|
| 101 |
+
const reqHeaders = Array.from(requestHeaders.entries())
|
| 102 |
+
.map(([key, value]) => `${key}: ${value}`)
|
| 103 |
+
.join(', ');
|
| 104 |
+
message += `\n Request Headers: {${reqHeaders}}`;
|
| 105 |
+
}
|
| 106 |
+
if (includeResponseHeaders && responseHeaders) {
|
| 107 |
+
const resHeaders = Array.from(responseHeaders.entries())
|
| 108 |
+
.map(([key, value]) => `${key}: ${value}`)
|
| 109 |
+
.join(', ');
|
| 110 |
+
message += `\n Response Headers: {${resHeaders}}`;
|
| 111 |
+
}
|
| 112 |
+
if (error || status >= 400) {
|
| 113 |
+
// eslint-disable-next-line no-console
|
| 114 |
+
console.error(message);
|
| 115 |
+
}
|
| 116 |
+
else {
|
| 117 |
+
// eslint-disable-next-line no-console
|
| 118 |
+
console.log(message);
|
| 119 |
+
}
|
| 120 |
+
};
|
| 121 |
+
const logFn = logger || defaultLogger;
|
| 122 |
+
return next => async (input, init) => {
|
| 123 |
+
const startTime = performance.now();
|
| 124 |
+
const method = init?.method || 'GET';
|
| 125 |
+
const url = typeof input === 'string' ? input : input.toString();
|
| 126 |
+
const requestHeaders = includeRequestHeaders ? new Headers(init?.headers) : undefined;
|
| 127 |
+
try {
|
| 128 |
+
const response = await next(input, init);
|
| 129 |
+
const duration = performance.now() - startTime;
|
| 130 |
+
// Only log if status meets the log level threshold
|
| 131 |
+
if (response.status >= statusLevel) {
|
| 132 |
+
logFn({
|
| 133 |
+
method,
|
| 134 |
+
url,
|
| 135 |
+
status: response.status,
|
| 136 |
+
statusText: response.statusText,
|
| 137 |
+
duration,
|
| 138 |
+
requestHeaders,
|
| 139 |
+
responseHeaders: includeResponseHeaders ? response.headers : undefined
|
| 140 |
+
});
|
| 141 |
+
}
|
| 142 |
+
return response;
|
| 143 |
+
}
|
| 144 |
+
catch (error) {
|
| 145 |
+
const duration = performance.now() - startTime;
|
| 146 |
+
// Always log errors regardless of log level
|
| 147 |
+
logFn({
|
| 148 |
+
method,
|
| 149 |
+
url,
|
| 150 |
+
status: 0,
|
| 151 |
+
statusText: 'Network Error',
|
| 152 |
+
duration,
|
| 153 |
+
requestHeaders,
|
| 154 |
+
error: error
|
| 155 |
+
});
|
| 156 |
+
throw error;
|
| 157 |
+
}
|
| 158 |
+
};
|
| 159 |
+
};
|
| 160 |
+
/**
|
| 161 |
+
* Composes multiple fetch middleware functions into a single middleware pipeline.
|
| 162 |
+
* Middleware are applied in the order they appear, creating a chain of handlers.
|
| 163 |
+
*
|
| 164 |
+
* @example
|
| 165 |
+
* ```typescript
|
| 166 |
+
* // Create a middleware pipeline that handles both OAuth and logging
|
| 167 |
+
* const enhancedFetch = applyMiddlewares(
|
| 168 |
+
* withOAuth(oauthProvider, 'https://api.example.com'),
|
| 169 |
+
* withLogging({ statusLevel: 400 })
|
| 170 |
+
* )(fetch);
|
| 171 |
+
*
|
| 172 |
+
* // Use the enhanced fetch - it will handle auth and log errors
|
| 173 |
+
* const response = await enhancedFetch('https://api.example.com/data');
|
| 174 |
+
* ```
|
| 175 |
+
*
|
| 176 |
+
* @param middleware - Array of fetch middleware to compose into a pipeline
|
| 177 |
+
* @returns A single composed middleware function
|
| 178 |
+
*/
|
| 179 |
+
export const applyMiddlewares = (...middleware) => {
|
| 180 |
+
return next => {
|
| 181 |
+
return middleware.reduce((handler, mw) => mw(handler), next);
|
| 182 |
+
};
|
| 183 |
+
};
|
| 184 |
+
/**
|
| 185 |
+
* Helper function to create custom fetch middleware with cleaner syntax.
|
| 186 |
+
* Provides the next handler and request details as separate parameters for easier access.
|
| 187 |
+
*
|
| 188 |
+
* @example
|
| 189 |
+
* ```typescript
|
| 190 |
+
* // Create custom authentication middleware
|
| 191 |
+
* const customAuthMiddleware = createMiddleware(async (next, input, init) => {
|
| 192 |
+
* const headers = new Headers(init?.headers);
|
| 193 |
+
* headers.set('X-Custom-Auth', 'my-token');
|
| 194 |
+
*
|
| 195 |
+
* const response = await next(input, { ...init, headers });
|
| 196 |
+
*
|
| 197 |
+
* if (response.status === 401) {
|
| 198 |
+
* console.log('Authentication failed');
|
| 199 |
+
* }
|
| 200 |
+
*
|
| 201 |
+
* return response;
|
| 202 |
+
* });
|
| 203 |
+
*
|
| 204 |
+
* // Create conditional middleware
|
| 205 |
+
* const conditionalMiddleware = createMiddleware(async (next, input, init) => {
|
| 206 |
+
* const url = typeof input === 'string' ? input : input.toString();
|
| 207 |
+
*
|
| 208 |
+
* // Only add headers for API routes
|
| 209 |
+
* if (url.includes('/api/')) {
|
| 210 |
+
* const headers = new Headers(init?.headers);
|
| 211 |
+
* headers.set('X-API-Version', 'v2');
|
| 212 |
+
* return next(input, { ...init, headers });
|
| 213 |
+
* }
|
| 214 |
+
*
|
| 215 |
+
* // Pass through for non-API routes
|
| 216 |
+
* return next(input, init);
|
| 217 |
+
* });
|
| 218 |
+
*
|
| 219 |
+
* // Create caching middleware
|
| 220 |
+
* const cacheMiddleware = createMiddleware(async (next, input, init) => {
|
| 221 |
+
* const cacheKey = typeof input === 'string' ? input : input.toString();
|
| 222 |
+
*
|
| 223 |
+
* // Check cache first
|
| 224 |
+
* const cached = await getFromCache(cacheKey);
|
| 225 |
+
* if (cached) {
|
| 226 |
+
* return new Response(cached, { status: 200 });
|
| 227 |
+
* }
|
| 228 |
+
*
|
| 229 |
+
* // Make request and cache result
|
| 230 |
+
* const response = await next(input, init);
|
| 231 |
+
* if (response.ok) {
|
| 232 |
+
* await saveToCache(cacheKey, await response.clone().text());
|
| 233 |
+
* }
|
| 234 |
+
*
|
| 235 |
+
* return response;
|
| 236 |
+
* });
|
| 237 |
+
* ```
|
| 238 |
+
*
|
| 239 |
+
* @param handler - Function that receives the next handler and request parameters
|
| 240 |
+
* @returns A fetch middleware function
|
| 241 |
+
*/
|
| 242 |
+
export const createMiddleware = (handler) => {
|
| 243 |
+
return next => (input, init) => handler(next, input, init);
|
| 244 |
+
};
|
| 245 |
+
//# sourceMappingURL=middleware.js.map
|
node_modules/@modelcontextprotocol/sdk/dist/esm/client/middleware.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"middleware.js","sourceRoot":"","sources":["../../../src/client/middleware.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,4BAA4B,EAAuB,iBAAiB,EAAE,MAAM,WAAW,CAAC;AASvG;;;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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { type ErrorEvent, type EventSourceInit } from 'eventsource';
|
| 2 |
+
import { Transport, FetchLike } from '../shared/transport.js';
|
| 3 |
+
import { JSONRPCMessage } from '../types.js';
|
| 4 |
+
import { OAuthClientProvider } from './auth.js';
|
| 5 |
+
export declare class SseError extends Error {
|
| 6 |
+
readonly code: number | undefined;
|
| 7 |
+
readonly event: ErrorEvent;
|
| 8 |
+
constructor(code: number | undefined, message: string | undefined, event: ErrorEvent);
|
| 9 |
+
}
|
| 10 |
+
/**
|
| 11 |
+
* Configuration options for the `SSEClientTransport`.
|
| 12 |
+
*/
|
| 13 |
+
export type SSEClientTransportOptions = {
|
| 14 |
+
/**
|
| 15 |
+
* An OAuth client provider to use for authentication.
|
| 16 |
+
*
|
| 17 |
+
* When an `authProvider` is specified and the SSE connection is started:
|
| 18 |
+
* 1. The connection is attempted with any existing access token from the `authProvider`.
|
| 19 |
+
* 2. If the access token has expired, the `authProvider` is used to refresh the token.
|
| 20 |
+
* 3. If token refresh fails or no access token exists, and auth is required, `OAuthClientProvider.redirectToAuthorization` is called, and an `UnauthorizedError` will be thrown from `connect`/`start`.
|
| 21 |
+
*
|
| 22 |
+
* After the user has finished authorizing via their user agent, and is redirected back to the MCP client application, call `SSEClientTransport.finishAuth` with the authorization code before retrying the connection.
|
| 23 |
+
*
|
| 24 |
+
* If an `authProvider` is not provided, and auth is required, an `UnauthorizedError` will be thrown.
|
| 25 |
+
*
|
| 26 |
+
* `UnauthorizedError` might also be thrown when sending any message over the SSE transport, indicating that the session has expired, and needs to be re-authed and reconnected.
|
| 27 |
+
*/
|
| 28 |
+
authProvider?: OAuthClientProvider;
|
| 29 |
+
/**
|
| 30 |
+
* Customizes the initial SSE request to the server (the request that begins the stream).
|
| 31 |
+
*
|
| 32 |
+
* NOTE: Setting this property will prevent an `Authorization` header from
|
| 33 |
+
* being automatically attached to the SSE request, if an `authProvider` is
|
| 34 |
+
* also given. This can be worked around by setting the `Authorization` header
|
| 35 |
+
* manually.
|
| 36 |
+
*/
|
| 37 |
+
eventSourceInit?: EventSourceInit;
|
| 38 |
+
/**
|
| 39 |
+
* Customizes recurring POST requests to the server.
|
| 40 |
+
*/
|
| 41 |
+
requestInit?: RequestInit;
|
| 42 |
+
/**
|
| 43 |
+
* Custom fetch implementation used for all network requests.
|
| 44 |
+
*/
|
| 45 |
+
fetch?: FetchLike;
|
| 46 |
+
};
|
| 47 |
+
/**
|
| 48 |
+
* Client transport for SSE: this will connect to a server using Server-Sent Events for receiving
|
| 49 |
+
* messages and make separate POST requests for sending messages.
|
| 50 |
+
* @deprecated SSEClientTransport is deprecated. Prefer to use StreamableHTTPClientTransport where possible instead. Note that because some servers are still using SSE, clients may need to support both transports during the migration period.
|
| 51 |
+
*/
|
| 52 |
+
export declare class SSEClientTransport implements Transport {
|
| 53 |
+
private _eventSource?;
|
| 54 |
+
private _endpoint?;
|
| 55 |
+
private _abortController?;
|
| 56 |
+
private _url;
|
| 57 |
+
private _resourceMetadataUrl?;
|
| 58 |
+
private _scope?;
|
| 59 |
+
private _eventSourceInit?;
|
| 60 |
+
private _requestInit?;
|
| 61 |
+
private _authProvider?;
|
| 62 |
+
private _fetch?;
|
| 63 |
+
private _fetchWithInit;
|
| 64 |
+
private _protocolVersion?;
|
| 65 |
+
onclose?: () => void;
|
| 66 |
+
onerror?: (error: Error) => void;
|
| 67 |
+
onmessage?: (message: JSONRPCMessage) => void;
|
| 68 |
+
constructor(url: URL, opts?: SSEClientTransportOptions);
|
| 69 |
+
private _authThenStart;
|
| 70 |
+
private _commonHeaders;
|
| 71 |
+
private _startOrAuth;
|
| 72 |
+
start(): Promise<void>;
|
| 73 |
+
/**
|
| 74 |
+
* Call this method after the user has finished authorizing via their user agent and is redirected back to the MCP client application. This will exchange the authorization code for an access token, enabling the next connection attempt to successfully auth.
|
| 75 |
+
*/
|
| 76 |
+
finishAuth(authorizationCode: string): Promise<void>;
|
| 77 |
+
close(): Promise<void>;
|
| 78 |
+
send(message: JSONRPCMessage): Promise<void>;
|
| 79 |
+
setProtocolVersion(version: string): void;
|
| 80 |
+
}
|
| 81 |
+
//# sourceMappingURL=sse.d.ts.map
|
node_modules/@modelcontextprotocol/sdk/dist/esm/client/sse.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"sse.d.ts","sourceRoot":"","sources":["../../../src/client/sse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC;AACjF,OAAO,EAAE,SAAS,EAAE,SAAS,EAAyC,MAAM,wBAAwB,CAAC;AACrG,OAAO,EAAE,cAAc,EAAwB,MAAM,aAAa,CAAC;AACnE,OAAO,EAAkD,mBAAmB,EAAqB,MAAM,WAAW,CAAC;AAEnH,qBAAa,QAAS,SAAQ,KAAK;aAEX,IAAI,EAAE,MAAM,GAAG,SAAS;aAExB,KAAK,EAAE,UAAU;gBAFjB,IAAI,EAAE,MAAM,GAAG,SAAS,EACxC,OAAO,EAAE,MAAM,GAAG,SAAS,EACX,KAAK,EAAE,UAAU;CAIxC;AAED;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG;IACpC;;;;;;;;;;;;;OAaG;IACH,YAAY,CAAC,EAAE,mBAAmB,CAAC;IAEnC;;;;;;;OAOG;IACH,eAAe,CAAC,EAAE,eAAe,CAAC;IAElC;;OAEG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;IAE1B;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;CACrB,CAAC;AAEF;;;;GAIG;AACH,qBAAa,kBAAmB,YAAW,SAAS;IAChD,OAAO,CAAC,YAAY,CAAC,CAAc;IACnC,OAAO,CAAC,SAAS,CAAC,CAAM;IACxB,OAAO,CAAC,gBAAgB,CAAC,CAAkB;IAC3C,OAAO,CAAC,IAAI,CAAM;IAClB,OAAO,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eaders } from '../shared/transport.js';
|
| 3 |
+
import { JSONRPCMessageSchema } from '../types.js';
|
| 4 |
+
import { auth, extractWWWAuthenticateParams, UnauthorizedError } from './auth.js';
|
| 5 |
+
export class SseError extends Error {
|
| 6 |
+
constructor(code, message, event) {
|
| 7 |
+
super(`SSE error: ${message}`);
|
| 8 |
+
this.code = code;
|
| 9 |
+
this.event = event;
|
| 10 |
+
}
|
| 11 |
+
}
|
| 12 |
+
/**
|
| 13 |
+
* Client transport for SSE: this will connect to a server using Server-Sent Events for receiving
|
| 14 |
+
* messages and make separate POST requests for sending messages.
|
| 15 |
+
* @deprecated SSEClientTransport is deprecated. Prefer to use StreamableHTTPClientTransport where possible instead. Note that because some servers are still using SSE, clients may need to support both transports during the migration period.
|
| 16 |
+
*/
|
| 17 |
+
export class SSEClientTransport {
|
| 18 |
+
constructor(url, opts) {
|
| 19 |
+
this._url = url;
|
| 20 |
+
this._resourceMetadataUrl = undefined;
|
| 21 |
+
this._scope = undefined;
|
| 22 |
+
this._eventSourceInit = opts?.eventSourceInit;
|
| 23 |
+
this._requestInit = opts?.requestInit;
|
| 24 |
+
this._authProvider = opts?.authProvider;
|
| 25 |
+
this._fetch = opts?.fetch;
|
| 26 |
+
this._fetchWithInit = createFetchWithInit(opts?.fetch, opts?.requestInit);
|
| 27 |
+
}
|
| 28 |
+
async _authThenStart() {
|
| 29 |
+
if (!this._authProvider) {
|
| 30 |
+
throw new UnauthorizedError('No auth provider');
|
| 31 |
+
}
|
| 32 |
+
let result;
|
| 33 |
+
try {
|
| 34 |
+
result = await auth(this._authProvider, {
|
| 35 |
+
serverUrl: this._url,
|
| 36 |
+
resourceMetadataUrl: this._resourceMetadataUrl,
|
| 37 |
+
scope: this._scope,
|
| 38 |
+
fetchFn: this._fetchWithInit
|
| 39 |
+
});
|
| 40 |
+
}
|
| 41 |
+
catch (error) {
|
| 42 |
+
this.onerror?.(error);
|
| 43 |
+
throw error;
|
| 44 |
+
}
|
| 45 |
+
if (result !== 'AUTHORIZED') {
|
| 46 |
+
throw new UnauthorizedError();
|
| 47 |
+
}
|
| 48 |
+
return await this._startOrAuth();
|
| 49 |
+
}
|
| 50 |
+
async _commonHeaders() {
|
| 51 |
+
const headers = {};
|
| 52 |
+
if (this._authProvider) {
|
| 53 |
+
const tokens = await this._authProvider.tokens();
|
| 54 |
+
if (tokens) {
|
| 55 |
+
headers['Authorization'] = `Bearer ${tokens.access_token}`;
|
| 56 |
+
}
|
| 57 |
+
}
|
| 58 |
+
if (this._protocolVersion) {
|
| 59 |
+
headers['mcp-protocol-version'] = this._protocolVersion;
|
| 60 |
+
}
|
| 61 |
+
const extraHeaders = normalizeHeaders(this._requestInit?.headers);
|
| 62 |
+
return new Headers({
|
| 63 |
+
...headers,
|
| 64 |
+
...extraHeaders
|
| 65 |
+
});
|
| 66 |
+
}
|
| 67 |
+
_startOrAuth() {
|
| 68 |
+
const fetchImpl = (this?._eventSourceInit?.fetch ?? this._fetch ?? fetch);
|
| 69 |
+
return new Promise((resolve, reject) => {
|
| 70 |
+
this._eventSource = new EventSource(this._url.href, {
|
| 71 |
+
...this._eventSourceInit,
|
| 72 |
+
fetch: async (url, init) => {
|
| 73 |
+
const headers = await this._commonHeaders();
|
| 74 |
+
headers.set('Accept', 'text/event-stream');
|
| 75 |
+
const response = await fetchImpl(url, {
|
| 76 |
+
...init,
|
| 77 |
+
headers
|
| 78 |
+
});
|
| 79 |
+
if (response.status === 401 && response.headers.has('www-authenticate')) {
|
| 80 |
+
const { resourceMetadataUrl, scope } = extractWWWAuthenticateParams(response);
|
| 81 |
+
this._resourceMetadataUrl = resourceMetadataUrl;
|
| 82 |
+
this._scope = scope;
|
| 83 |
+
}
|
| 84 |
+
return response;
|
| 85 |
+
}
|
| 86 |
+
});
|
| 87 |
+
this._abortController = new AbortController();
|
| 88 |
+
this._eventSource.onerror = event => {
|
| 89 |
+
if (event.code === 401 && this._authProvider) {
|
| 90 |
+
this._authThenStart().then(resolve, reject);
|
| 91 |
+
return;
|
| 92 |
+
}
|
| 93 |
+
const error = new SseError(event.code, event.message, event);
|
| 94 |
+
reject(error);
|
| 95 |
+
this.onerror?.(error);
|
| 96 |
+
};
|
| 97 |
+
this._eventSource.onopen = () => {
|
| 98 |
+
// The connection is open, but we need to wait for the endpoint to be received.
|
| 99 |
+
};
|
| 100 |
+
this._eventSource.addEventListener('endpoint', (event) => {
|
| 101 |
+
const messageEvent = event;
|
| 102 |
+
try {
|
| 103 |
+
this._endpoint = new URL(messageEvent.data, this._url);
|
| 104 |
+
if (this._endpoint.origin !== this._url.origin) {
|
| 105 |
+
throw new Error(`Endpoint origin does not match connection origin: ${this._endpoint.origin}`);
|
| 106 |
+
}
|
| 107 |
+
}
|
| 108 |
+
catch (error) {
|
| 109 |
+
reject(error);
|
| 110 |
+
this.onerror?.(error);
|
| 111 |
+
void this.close();
|
| 112 |
+
return;
|
| 113 |
+
}
|
| 114 |
+
resolve();
|
| 115 |
+
});
|
| 116 |
+
this._eventSource.onmessage = (event) => {
|
| 117 |
+
const messageEvent = event;
|
| 118 |
+
let message;
|
| 119 |
+
try {
|
| 120 |
+
message = JSONRPCMessageSchema.parse(JSON.parse(messageEvent.data));
|
| 121 |
+
}
|
| 122 |
+
catch (error) {
|
| 123 |
+
this.onerror?.(error);
|
| 124 |
+
return;
|
| 125 |
+
}
|
| 126 |
+
this.onmessage?.(message);
|
| 127 |
+
};
|
| 128 |
+
});
|
| 129 |
+
}
|
| 130 |
+
async start() {
|
| 131 |
+
if (this._eventSource) {
|
| 132 |
+
throw new Error('SSEClientTransport already started! If using Client class, note that connect() calls start() automatically.');
|
| 133 |
+
}
|
| 134 |
+
return await this._startOrAuth();
|
| 135 |
+
}
|
| 136 |
+
/**
|
| 137 |
+
* Call this method after the user has finished authorizing via their user agent and is redirected back to the MCP client application. This will exchange the authorization code for an access token, enabling the next connection attempt to successfully auth.
|
| 138 |
+
*/
|
| 139 |
+
async finishAuth(authorizationCode) {
|
| 140 |
+
if (!this._authProvider) {
|
| 141 |
+
throw new UnauthorizedError('No auth provider');
|
| 142 |
+
}
|
| 143 |
+
const result = await auth(this._authProvider, {
|
| 144 |
+
serverUrl: this._url,
|
| 145 |
+
authorizationCode,
|
| 146 |
+
resourceMetadataUrl: this._resourceMetadataUrl,
|
| 147 |
+
scope: this._scope,
|
| 148 |
+
fetchFn: this._fetchWithInit
|
| 149 |
+
});
|
| 150 |
+
if (result !== 'AUTHORIZED') {
|
| 151 |
+
throw new UnauthorizedError('Failed to authorize');
|
| 152 |
+
}
|
| 153 |
+
}
|
| 154 |
+
async close() {
|
| 155 |
+
this._abortController?.abort();
|
| 156 |
+
this._eventSource?.close();
|
| 157 |
+
this.onclose?.();
|
| 158 |
+
}
|
| 159 |
+
async send(message) {
|
| 160 |
+
if (!this._endpoint) {
|
| 161 |
+
throw new Error('Not connected');
|
| 162 |
+
}
|
| 163 |
+
try {
|
| 164 |
+
const headers = await this._commonHeaders();
|
| 165 |
+
headers.set('content-type', 'application/json');
|
| 166 |
+
const init = {
|
| 167 |
+
...this._requestInit,
|
| 168 |
+
method: 'POST',
|
| 169 |
+
headers,
|
| 170 |
+
body: JSON.stringify(message),
|
| 171 |
+
signal: this._abortController?.signal
|
| 172 |
+
};
|
| 173 |
+
const response = await (this._fetch ?? fetch)(this._endpoint, init);
|
| 174 |
+
if (!response.ok) {
|
| 175 |
+
const text = await response.text().catch(() => null);
|
| 176 |
+
if (response.status === 401 && this._authProvider) {
|
| 177 |
+
const { resourceMetadataUrl, scope } = extractWWWAuthenticateParams(response);
|
| 178 |
+
this._resourceMetadataUrl = resourceMetadataUrl;
|
| 179 |
+
this._scope = scope;
|
| 180 |
+
const result = await auth(this._authProvider, {
|
| 181 |
+
serverUrl: this._url,
|
| 182 |
+
resourceMetadataUrl: this._resourceMetadataUrl,
|
| 183 |
+
scope: this._scope,
|
| 184 |
+
fetchFn: this._fetchWithInit
|
| 185 |
+
});
|
| 186 |
+
if (result !== 'AUTHORIZED') {
|
| 187 |
+
throw new UnauthorizedError();
|
| 188 |
+
}
|
| 189 |
+
// Purposely _not_ awaited, so we don't call onerror twice
|
| 190 |
+
return this.send(message);
|
| 191 |
+
}
|
| 192 |
+
throw new Error(`Error POSTing to endpoint (HTTP ${response.status}): ${text}`);
|
| 193 |
+
}
|
| 194 |
+
// Release connection - POST responses don't have content we need
|
| 195 |
+
await response.body?.cancel();
|
| 196 |
+
}
|
| 197 |
+
catch (error) {
|
| 198 |
+
this.onerror?.(error);
|
| 199 |
+
throw error;
|
| 200 |
+
}
|
| 201 |
+
}
|
| 202 |
+
setProtocolVersion(version) {
|
| 203 |
+
this._protocolVersion = version;
|
| 204 |
+
}
|
| 205 |
+
}
|
| 206 |
+
//# sourceMappingURL=sse.js.map
|
node_modules/@modelcontextprotocol/sdk/dist/esm/client/sse.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"sse.js","sourceRoot":"","sources":["../../../src/client/sse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAyC,MAAM,aAAa,CAAC;AACjF,OAAO,EAAwB,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AACrG,OAAO,EAAkB,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnE,OAAO,EAAE,IAAI,EAAc,4BAA4B,EAAuB,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAEnH,MAAM,OAAO,QAAS,SAAQ,KAAK;IAC/B,YACoB,IAAwB,EACxC,OAA2B,EACX,KAAiB;QAEjC,KAAK,CAAC,cAAc,OAAO,EAAE,CAAC,CAAC;QAJf,SAAI,GAAJ,IAAI,CAAoB;QAExB,UAAK,GAAL,KAAK,CAAY;IAGrC,CAAC;CACJ;AA2CD;;;;GAIG;AACH,MAAM,OAAO,kBAAkB;IAkB3B,YAAY,GAAQ,EAAE,IAAgC;QAClD,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;QAChB,IAAI,CAAC,oBAAoB,GAAG,SAAS,CAAC;Q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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { IOType } from 'node:child_process';
|
| 2 |
+
import { Stream } from 'node:stream';
|
| 3 |
+
import { Transport } from '../shared/transport.js';
|
| 4 |
+
import { JSONRPCMessage } from '../types.js';
|
| 5 |
+
export type StdioServerParameters = {
|
| 6 |
+
/**
|
| 7 |
+
* The executable to run to start the server.
|
| 8 |
+
*/
|
| 9 |
+
command: string;
|
| 10 |
+
/**
|
| 11 |
+
* Command line arguments to pass to the executable.
|
| 12 |
+
*/
|
| 13 |
+
args?: string[];
|
| 14 |
+
/**
|
| 15 |
+
* The environment to use when spawning the process.
|
| 16 |
+
*
|
| 17 |
+
* If not specified, the result of getDefaultEnvironment() will be used.
|
| 18 |
+
*/
|
| 19 |
+
env?: Record<string, string>;
|
| 20 |
+
/**
|
| 21 |
+
* How to handle stderr of the child process. This matches the semantics of Node's `child_process.spawn`.
|
| 22 |
+
*
|
| 23 |
+
* The default is "inherit", meaning messages to stderr will be printed to the parent process's stderr.
|
| 24 |
+
*/
|
| 25 |
+
stderr?: IOType | Stream | number;
|
| 26 |
+
/**
|
| 27 |
+
* The working directory to use when spawning the process.
|
| 28 |
+
*
|
| 29 |
+
* If not specified, the current working directory will be inherited.
|
| 30 |
+
*/
|
| 31 |
+
cwd?: string;
|
| 32 |
+
};
|
| 33 |
+
/**
|
| 34 |
+
* Environment variables to inherit by default, if an environment is not explicitly given.
|
| 35 |
+
*/
|
| 36 |
+
export declare const DEFAULT_INHERITED_ENV_VARS: string[];
|
| 37 |
+
/**
|
| 38 |
+
* Returns a default environment object including only environment variables deemed safe to inherit.
|
| 39 |
+
*/
|
| 40 |
+
export declare function getDefaultEnvironment(): Record<string, string>;
|
| 41 |
+
/**
|
| 42 |
+
* Client transport for stdio: this will connect to a server by spawning a process and communicating with it over stdin/stdout.
|
| 43 |
+
*
|
| 44 |
+
* This transport is only available in Node.js environments.
|
| 45 |
+
*/
|
| 46 |
+
export declare class StdioClientTransport implements Transport {
|
| 47 |
+
private _process?;
|
| 48 |
+
private _readBuffer;
|
| 49 |
+
private _serverParams;
|
| 50 |
+
private _stderrStream;
|
| 51 |
+
onclose?: () => void;
|
| 52 |
+
onerror?: (error: Error) => void;
|
| 53 |
+
onmessage?: (message: JSONRPCMessage) => void;
|
| 54 |
+
constructor(server: StdioServerParameters);
|
| 55 |
+
/**
|
| 56 |
+
* Starts the server process and prepares to communicate with it.
|
| 57 |
+
*/
|
| 58 |
+
start(): Promise<void>;
|
| 59 |
+
/**
|
| 60 |
+
* The stderr stream of the child process, if `StdioServerParameters.stderr` was set to "pipe" or "overlapped".
|
| 61 |
+
*
|
| 62 |
+
* If stderr piping was requested, a PassThrough stream is returned _immediately_, allowing callers to
|
| 63 |
+
* attach listeners before the start method is invoked. This prevents loss of any early
|
| 64 |
+
* error output emitted by the child process.
|
| 65 |
+
*/
|
| 66 |
+
get stderr(): Stream | null;
|
| 67 |
+
/**
|
| 68 |
+
* The child process pid spawned by this transport.
|
| 69 |
+
*
|
| 70 |
+
* This is only available after the transport has been started.
|
| 71 |
+
*/
|
| 72 |
+
get pid(): number | null;
|
| 73 |
+
private processReadBuffer;
|
| 74 |
+
close(): Promise<void>;
|
| 75 |
+
send(message: JSONRPCMessage): Promise<void>;
|
| 76 |
+
}
|
| 77 |
+
//# sourceMappingURL=stdio.d.ts.map
|
node_modules/@modelcontextprotocol/sdk/dist/esm/client/stdio.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"stdio.d.ts","sourceRoot":"","sources":["../../../src/client/stdio.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAG1D,OAAO,EAAE,MAAM,EAAe,MAAM,aAAa,CAAC;AAElD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,MAAM,MAAM,qBAAqB,GAAG;IAChC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAEhB;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAE7B;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;IAElC;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,0BAA0B,UAiBuB,CAAC;AAE/D;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAkB9D;AAED;;;;GAIG;AACH,qBAAa,oBAAqB,YAAW,SAAS;IAClD,OAAO,CAAC,QAAQ,CAAC,CAAe;IAChC,OAAO,CAAC,WAAW,CAAgC;IACnD,OAAO,CAAC,aAAa,CAAwB;IAC7C,OAAO,CAAC,aAAa,CAA4B;IAEjD,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;gBAElC,MAAM,EAAE,qB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