Skip to content

KIMI mcp integration fix #2257

@idobrovolski

Description

@idobrovolski

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch @modelcontextprotocol/sdk@1.29.0 for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/zod-json-schema-compat.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/zod-json-schema-compat.js
index bc067da..ad3237f 100644
--- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/zod-json-schema-compat.js
+++ b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/zod-json-schema-compat.js
@@ -54,7 +54,9 @@ function toJsonSchemaCompat(schema, opts) {
     // v3 branch — use vendored converter
     return (0, zod_to_json_schema_1.zodToJsonSchema)(schema, {
         strictUnions: opts?.strictUnions ?? true,
-        pipeStrategy: opts?.pipeStrategy ?? 'input'
+        pipeStrategy: opts?.pipeStrategy ?? 'input',
+        definitionPath: "$defs",
+        $refStrategy: "none"
     });
 }
 function getMethodLiteral(schema) {
diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js
index 62f7fd0..4965ae1 100644
--- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js
+++ b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js
@@ -26,7 +26,9 @@ export function toJsonSchemaCompat(schema, opts) {
     // v3 branch — use vendored converter
     return zodToJsonSchema(schema, {
         strictUnions: opts?.strictUnions ?? true,
-        pipeStrategy: opts?.pipeStrategy ?? 'input'
+        pipeStrategy: opts?.pipeStrategy ?? 'input',
+        definitionPath: "$defs",
+        $refStrategy: "none"
     });
 }
 export function getMethodLiteral(schema) {

This issue body was partially generated by patch-package.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions