-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdiff.ts
More file actions
23 lines (21 loc) · 745 Bytes
/
diff.ts
File metadata and controls
23 lines (21 loc) · 745 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import { z } from "zod";
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { execDocker, errorResponse } from "../utils/docker-api.js";
const inputSchema = {
containerId: z.string().min(1).describe("Container name or ID"),
};
export function register(server: McpServer): void {
server.tool(
"docker_diff",
"Inspect filesystem changes in a container (added, changed, deleted files)",
inputSchema,
async (args) => {
try {
const output = await execDocker(["diff", args.containerId]);
return { content: [{ type: "text" as const, text: output.trim() || "No filesystem changes detected" }] };
} catch (error) {
return errorResponse(error);
}
},
);
}