modelcontextprotocol / modelcontextprotocol/typescript-sdk
KIMI mcp integration fix
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 13.4k
- Forks
- 2.2k
- Avg merge
- 3d 15h
- Merged PRs (30d)
- 4
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the source corresponding to the mentioned dist/cjs/server/zod-json-schema-compat.js and dist/esm/server/zod-json-schema-compat.js files, then read how the SDK's Zod-to-JSON-Schema conversion is built and tested. Reproduce the KIMI integration problem and verify that the conversion uses the required $defs definition path and avoids unwanted references in both module outputs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 45/100