mirror of
https://github.com/modelcontextprotocol/servers.git
synced 2026-04-17 21:54:05 +02:00
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:
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,
|
||||
SubscribeRequestSchema,
|
||||
Tool,
|
||||
ToolSchema,
|
||||
UnsubscribeRequestSchema,
|
||||
type Root
|
||||
} from "@modelcontextprotocol/sdk/types.js";
|
||||
@@ -35,11 +34,8 @@ const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = dirname(__filename);
|
||||
const instructions = readFileSync(join(__dirname, "instructions.md"), "utf-8");
|
||||
|
||||
const ToolInputSchema = ToolSchema.shape.inputSchema;
|
||||
type ToolInput = z.infer<typeof ToolInputSchema>;
|
||||
|
||||
const ToolOutputSchema = ToolSchema.shape.outputSchema;
|
||||
type ToolOutput = z.infer<typeof ToolOutputSchema>;
|
||||
type ToolInput = Tool["inputSchema"];
|
||||
type ToolOutput = Tool["outputSchema"];
|
||||
|
||||
type SendRequest = RequestHandlerExtra<ServerRequest, ServerNotification>["sendRequest"];
|
||||
|
||||
@@ -621,7 +617,7 @@ export const createServer = () => {
|
||||
);
|
||||
return {
|
||||
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"
|
||||
},
|
||||
"dependencies": {
|
||||
"@modelcontextprotocol/sdk": "^1.19.1",
|
||||
"@modelcontextprotocol/sdk": "^1.23.0",
|
||||
"cors": "^2.8.5",
|
||||
"express": "^4.21.1",
|
||||
"jszip": "^3.10.1",
|
||||
"zod": "^3.23.8",
|
||||
"zod": "^3.25.0",
|
||||
"zod-to-json-schema": "^3.23.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
"test": "vitest run --coverage"
|
||||
},
|
||||
"dependencies": {
|
||||
"@modelcontextprotocol/sdk": "^1.19.1",
|
||||
"@modelcontextprotocol/sdk": "^1.23.0",
|
||||
"diff": "^5.1.0",
|
||||
"glob": "^10.3.10",
|
||||
"minimatch": "^10.0.1",
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
"test": "vitest run --coverage"
|
||||
},
|
||||
"dependencies": {
|
||||
"@modelcontextprotocol/sdk": "^1.19.1"
|
||||
"@modelcontextprotocol/sdk": "^1.23.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^22",
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
"test": "vitest run --coverage"
|
||||
},
|
||||
"dependencies": {
|
||||
"@modelcontextprotocol/sdk": "^1.19.1",
|
||||
"@modelcontextprotocol/sdk": "^1.23.0",
|
||||
"chalk": "^5.3.0",
|
||||
"yargs": "^17.7.2"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user