Update @modelcontextprotocol/sdk to 1.23.0 in TypeScript servers (#3065)
Update the SDK from ^1.19.1 to ^1.23.0 in all TypeScript reference servers: - everything - filesystem - memory - sequentialthinking Also update everything server for SDK breaking changes: - Update zod to ^3.25.0 (zod v4 compatibility) - Fix ToolInput/ToolOutput types to use Tool["inputSchema"] instead of inferring from zod schemas - Fix result.content handling to support array format Co-authored-by: Felix Weinberger <3823880+felixweinberger@users.noreply.github.com>
This commit is contained in:
parent
80a16e5e95
commit
3154518344
6 changed files with 3734 additions and 2602 deletions
1842
package-lock.json
generated
1842
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -20,7 +20,6 @@ import {
|
||||||
ServerRequest,
|
ServerRequest,
|
||||||
SubscribeRequestSchema,
|
SubscribeRequestSchema,
|
||||||
Tool,
|
Tool,
|
||||||
ToolSchema,
|
|
||||||
UnsubscribeRequestSchema,
|
UnsubscribeRequestSchema,
|
||||||
type Root
|
type Root
|
||||||
} from "@modelcontextprotocol/sdk/types.js";
|
} from "@modelcontextprotocol/sdk/types.js";
|
||||||
|
|
@ -35,11 +34,8 @@ const __filename = fileURLToPath(import.meta.url);
|
||||||
const __dirname = dirname(__filename);
|
const __dirname = dirname(__filename);
|
||||||
const instructions = readFileSync(join(__dirname, "instructions.md"), "utf-8");
|
const instructions = readFileSync(join(__dirname, "instructions.md"), "utf-8");
|
||||||
|
|
||||||
const ToolInputSchema = ToolSchema.shape.inputSchema;
|
type ToolInput = Tool["inputSchema"];
|
||||||
type ToolInput = z.infer<typeof ToolInputSchema>;
|
type ToolOutput = Tool["outputSchema"];
|
||||||
|
|
||||||
const ToolOutputSchema = ToolSchema.shape.outputSchema;
|
|
||||||
type ToolOutput = z.infer<typeof ToolOutputSchema>;
|
|
||||||
|
|
||||||
type SendRequest = RequestHandlerExtra<ServerRequest, ServerNotification>["sendRequest"];
|
type SendRequest = RequestHandlerExtra<ServerRequest, ServerNotification>["sendRequest"];
|
||||||
|
|
||||||
|
|
@ -621,7 +617,7 @@ export const createServer = () => {
|
||||||
);
|
);
|
||||||
return {
|
return {
|
||||||
content: [
|
content: [
|
||||||
{ type: "text", text: `LLM sampling result: ${result.content.text}` },
|
{ type: "text", text: `LLM sampling result: ${Array.isArray(result.content) ? result.content.map(c => c.type === "text" ? c.text : JSON.stringify(c)).join("") : (result.content.type === "text" ? result.content.text : JSON.stringify(result.content))}` },
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,11 +22,11 @@
|
||||||
"start:streamableHttp": "node dist/streamableHttp.js"
|
"start:streamableHttp": "node dist/streamableHttp.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@modelcontextprotocol/sdk": "^1.19.1",
|
"@modelcontextprotocol/sdk": "^1.23.0",
|
||||||
"cors": "^2.8.5",
|
"cors": "^2.8.5",
|
||||||
"express": "^4.21.1",
|
"express": "^4.21.1",
|
||||||
"jszip": "^3.10.1",
|
"jszip": "^3.10.1",
|
||||||
"zod": "^3.23.8",
|
"zod": "^3.25.0",
|
||||||
"zod-to-json-schema": "^3.23.5"
|
"zod-to-json-schema": "^3.23.5"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
"test": "vitest run --coverage"
|
"test": "vitest run --coverage"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@modelcontextprotocol/sdk": "^1.19.1",
|
"@modelcontextprotocol/sdk": "^1.23.0",
|
||||||
"diff": "^5.1.0",
|
"diff": "^5.1.0",
|
||||||
"glob": "^10.3.10",
|
"glob": "^10.3.10",
|
||||||
"minimatch": "^10.0.1",
|
"minimatch": "^10.0.1",
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
"test": "vitest run --coverage"
|
"test": "vitest run --coverage"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@modelcontextprotocol/sdk": "^1.19.1"
|
"@modelcontextprotocol/sdk": "^1.23.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "^22",
|
"@types/node": "^22",
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
"test": "vitest run --coverage"
|
"test": "vitest run --coverage"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@modelcontextprotocol/sdk": "^1.19.1",
|
"@modelcontextprotocol/sdk": "^1.23.0",
|
||||||
"chalk": "^5.3.0",
|
"chalk": "^5.3.0",
|
||||||
"yargs": "^17.7.2"
|
"yargs": "^17.7.2"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue