Skip to content

Commit 83c4e15

Browse files
committed
fix: update diff-mcp for MCP SDK 1.29 and Zod 4 compatibility
1 parent ca575b9 commit 83c4e15

4 files changed

Lines changed: 31 additions & 56 deletions

File tree

package-lock.json

Lines changed: 5 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/diff-mcp/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"json5": "^2.2.3",
3232
"jsondiffpatch": "^0.7.4",
3333
"smol-toml": "^1.3.1",
34-
"zod": "^3.24.2"
34+
"zod": "^4.4.3"
3535
},
3636
"devDependencies": {
3737
"@types/js-yaml": "^4.0.9",

packages/diff-mcp/src/server.ts

Lines changed: 21 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -14,40 +14,34 @@ export const createMcpServer = () => {
1414
const server = new McpServer({
1515
name: "diff-mcp",
1616
version: "0.0.1",
17-
capabilities: {
18-
resources: {},
19-
tools: {},
20-
},
2117
});
2218

2319
server.tool(
2420
"diff",
2521
"compare text or data and get a readable diff",
2622
{
27-
state: z.object({
28-
left: inputDataSchema.describe("The left side of the diff."),
29-
leftFormat: formatSchema
30-
.optional()
31-
.describe("format of left side of the diff"),
32-
right: inputDataSchema.describe(
33-
"The right side of the diff (to compare with the left side).",
34-
),
35-
rightFormat: formatSchema
36-
.optional()
37-
.describe("format of right side of the diff"),
38-
outputFormat: z
39-
.enum(["text", "json", "jsonpatch"])
40-
.default("text")
41-
.describe(
42-
"The output format. " +
43-
"text: (default) human readable text diff, " +
44-
"json: a compact json diff (jsondiffpatch delta format), " +
45-
"jsonpatch: json patch diff (RFC 6902)",
46-
)
47-
.optional(),
48-
}),
23+
left: inputDataSchema.describe("The left side of the diff."),
24+
leftFormat: formatSchema
25+
.optional()
26+
.describe("format of left side of the diff"),
27+
right: inputDataSchema.describe(
28+
"The right side of the diff (to compare with the left side).",
29+
),
30+
rightFormat: formatSchema
31+
.optional()
32+
.describe("format of right side of the diff"),
33+
outputFormat: z
34+
.enum(["text", "json", "jsonpatch"])
35+
.default("text")
36+
.describe(
37+
"The output format. " +
38+
"text: (default) human readable text diff, " +
39+
"json: a compact json diff (jsondiffpatch delta format), " +
40+
"jsonpatch: json patch diff (RFC 6902)",
41+
)
42+
.optional(),
4943
},
50-
({ state }) => {
44+
(state) => {
5145
try {
5246
const jsondiffpatch = create({
5347
textDiff: {

packages/jsondiffpatch/package.json

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,9 @@
33
"version": "0.7.4",
44
"author": "Benjamin Eidelman <beneidel@gmail.com>",
55
"description": "JSON diff & patch (object and array diff, text diff, multiple output formats)",
6-
"contributors": [
7-
"Benjamin Eidelman <beneidel@gmail.com>"
8-
],
6+
"contributors": ["Benjamin Eidelman <beneidel@gmail.com>"],
97
"type": "module",
10-
"sideEffects": [
11-
"*.css"
12-
],
8+
"sideEffects": ["*.css"],
139
"main": "./lib/index.js",
1410
"types": "./lib/index.d.ts",
1511
"exports": {
@@ -18,10 +14,7 @@
1814
"./formatters/*": "./lib/formatters/*.js",
1915
"./formatters/styles/*.css": "./lib/formatters/styles/*.css"
2016
},
21-
"files": [
22-
"bin",
23-
"lib"
24-
],
17+
"files": ["bin", "lib"],
2518
"bin": {
2619
"jsondiffpatch": "./bin/jsondiffpatch.js"
2720
},
@@ -37,11 +30,7 @@
3730
"type": "git",
3831
"url": "https://github.com/benjamine/jsondiffpatch.git"
3932
},
40-
"keywords": [
41-
"json",
42-
"diff",
43-
"patch"
44-
],
33+
"keywords": ["json", "diff", "patch"],
4534
"dependencies": {
4635
"@dmsnell/diff-match-patch": "^1.1.0"
4736
},

0 commit comments

Comments
 (0)