diff --git a/package-lock.json b/package-lock.json index 73a40761a..c0099faee 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "license": "MIT", "dependencies": { "@clack/prompts": "^0.11.0", - "@modelcontextprotocol/sdk": "^1.22.0", + "@modelcontextprotocol/sdk": "^1.24.0", "@repomix/tree-sitter-wasms": "^0.1.15", "@secretlint/core": "^11.2.5", "@secretlint/secretlint-rule-preset-recommend": "^11.2.5", @@ -1723,7 +1723,6 @@ "integrity": "sha512-GNWcUTRBgIRJD5zj+Tq0fKOJ5XZajIiBroOF0yvj2bSU1WvNdYS/dn9UxwsujGW4JX06dnHyjV2y9rRaybH0iQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "undici-types": "~7.16.0" } @@ -2704,7 +2703,6 @@ "resolved": "https://registry.npmjs.org/express/-/express-5.2.1.tgz", "integrity": "sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw==", "license": "MIT", - "peer": true, "dependencies": { "accepts": "^2.0.0", "body-parser": "^2.2.1", @@ -3545,7 +3543,6 @@ "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.6.1.tgz", "integrity": "sha512-ekilCSN1jwRvIbgeg/57YFh8qQDNbwDb9xT/qu2DAHbFFZUicIl4ygVaAvzveMhMVr3LnpSKTNnwt8PoOfmKhQ==", "license": "MIT", - "peer": true, "bin": { "jiti": "lib/jiti-cli.mjs" } @@ -5378,7 +5375,6 @@ "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=12" }, @@ -5442,7 +5438,6 @@ "integrity": "sha512-ytQKuwgmrrkDTFP4LjR0ToE2nqgy886GpvRSpU0JAnrdBYppuY5rLkRUYPU1yCryb24SsKBTL/hlDQAEFVwtZg==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "esbuild": "~0.25.0", "get-tsconfig": "^4.7.5" @@ -5576,7 +5571,6 @@ "integrity": "sha512-NL8jTlbo0Tn4dUEXEsUg8KeyG/Lkmc4Fnzb8JXN/Ykm9G4HNImjtABMJgkQoVjOBN/j2WAwDTRytdqJbZsah7w==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "esbuild": "^0.25.0", "fdir": "^6.5.0", @@ -5693,7 +5687,6 @@ "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=12" }, @@ -5707,7 +5700,6 @@ "integrity": "sha512-LUCP5ev3GURDysTWiP47wRRUpLKMOfPh+yKTx3kVIEiu5KOMeqzpnYNsKyOoVrULivR8tLcks4+lga33Whn90A==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@types/chai": "^5.2.2", "@vitest/expect": "3.2.4", @@ -5963,7 +5955,6 @@ "resolved": "https://registry.npmjs.org/zod/-/zod-4.1.13.tgz", "integrity": "sha512-AvvthqfqrAhNH9dnfmrfKzX5upOdjUVJYFqNSlkmGf64gRaTzlPwz99IHYnVs28qYAybvAlBV+H7pn0saFY4Ig==", "license": "MIT", - "peer": true, "funding": { "url": "https://github.com/sponsors/colinhacks" } diff --git a/package.json b/package.json index f5ba81adb..2d5d2ccc6 100644 --- a/package.json +++ b/package.json @@ -74,7 +74,7 @@ "type": "module", "dependencies": { "@clack/prompts": "^0.11.0", - "@modelcontextprotocol/sdk": "^1.22.0", + "@modelcontextprotocol/sdk": "^1.24.0", "@repomix/tree-sitter-wasms": "^0.1.15", "@secretlint/core": "^11.2.5", "@secretlint/secretlint-rule-preset-recommend": "^11.2.5", diff --git a/src/mcp/prompts/packRemoteRepositoryPrompts.ts b/src/mcp/prompts/packRemoteRepositoryPrompts.ts index cc12882ab..9f2d727a6 100644 --- a/src/mcp/prompts/packRemoteRepositoryPrompts.ts +++ b/src/mcp/prompts/packRemoteRepositoryPrompts.ts @@ -1,9 +1,5 @@ -// @ts-nocheck - Zod v3 compatibility for MCP SDK (imported by mcpAction.ts) -// Note: @ts-expect-error would be preferable, but the type incompatibility extends -// beyond .shape to the entire handler function signature, causing 9+ type errors per file. -// This will be resolved when MCP SDK supports Zod v4. import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'; -import { z } from 'zod/v3'; +import { z } from 'zod'; /** * Register Repomix-related prompts to the MCP server @@ -29,7 +25,6 @@ export const registerPackRemoteRepositoryPrompt = (mcpServer: McpServer) => { ), }, async ({ repository, includePatterns, ignorePatterns }) => { - // Convert compress string to boolean return { messages: [ { diff --git a/src/mcp/tools/attachPackedOutputTool.ts b/src/mcp/tools/attachPackedOutputTool.ts index d5b764c22..6c2a688f6 100644 --- a/src/mcp/tools/attachPackedOutputTool.ts +++ b/src/mcp/tools/attachPackedOutputTool.ts @@ -1,12 +1,8 @@ -// @ts-nocheck - Zod v3 compatibility for MCP SDK (imported by mcpAction.ts) -// Note: @ts-expect-error would be preferable, but the type incompatibility extends -// beyond .shape to the entire handler function signature, causing 9+ type errors per file. -// This will be resolved when MCP SDK supports Zod v4. import fs from 'node:fs/promises'; import path from 'node:path'; import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'; import type { CallToolResult } from '@modelcontextprotocol/sdk/types.js'; -import { z } from 'zod/v3'; +import { z } from 'zod'; import { defaultFilePathMap } from '../../config/configSchema.js'; import type { ProcessedFile } from '../../core/file/fileTypes.js'; import { @@ -259,10 +255,8 @@ This tool accepts either a directory containing a repomix output file or a direc Supports multiple formats: XML (structured with tags), Markdown (human-readable with ## headers and code blocks), JSON (machine-readable with files as key-value pairs), and Plain text (simple format with separators). Calling the tool again with the same file path will refresh the content if the file has been updated. It will return in that case a new output ID and the updated content.`, - // biome-ignore lint/suspicious/noExplicitAny: Zod v3 compatibility for MCP SDK - inputSchema: attachPackedOutputInputSchema.shape as any, - // biome-ignore lint/suspicious/noExplicitAny: Zod v3 compatibility for MCP SDK - outputSchema: attachPackedOutputOutputSchema.shape as any, + inputSchema: attachPackedOutputInputSchema, + outputSchema: attachPackedOutputOutputSchema, annotations: { readOnlyHint: true, destructiveHint: false, diff --git a/src/mcp/tools/fileSystemReadDirectoryTool.ts b/src/mcp/tools/fileSystemReadDirectoryTool.ts index 0e008e958..cd6a17031 100644 --- a/src/mcp/tools/fileSystemReadDirectoryTool.ts +++ b/src/mcp/tools/fileSystemReadDirectoryTool.ts @@ -1,12 +1,8 @@ -// @ts-nocheck - Zod v3 compatibility for MCP SDK (imported by mcpAction.ts) -// Note: @ts-expect-error would be preferable, but the type incompatibility extends -// beyond .shape to the entire handler function signature, causing 9+ type errors per file. -// This will be resolved when MCP SDK supports Zod v4. import fs from 'node:fs/promises'; import path from 'node:path'; import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'; import type { CallToolResult } from '@modelcontextprotocol/sdk/types.js'; -import { z } from 'zod/v3'; +import { z } from 'zod'; import { logger } from '../../shared/logger.js'; import { buildMcpToolErrorResponse, buildMcpToolSuccessResponse } from './mcpToolRuntime.js'; @@ -32,10 +28,8 @@ export const registerFileSystemReadDirectoryTool = (mcpServer: McpServer) => { title: 'Read Directory', description: 'List the contents of a directory using an absolute path. Returns a formatted list showing files and subdirectories with clear [FILE]/[DIR] indicators. Useful for exploring project structure and understanding codebase organization.', - // biome-ignore lint/suspicious/noExplicitAny: Zod v3 compatibility for MCP SDK - inputSchema: fileSystemReadDirectoryInputSchema.shape as any, - // biome-ignore lint/suspicious/noExplicitAny: Zod v3 compatibility for MCP SDK - outputSchema: fileSystemReadDirectoryOutputSchema.shape as any, + inputSchema: fileSystemReadDirectoryInputSchema, + outputSchema: fileSystemReadDirectoryOutputSchema, annotations: { readOnlyHint: true, destructiveHint: false, diff --git a/src/mcp/tools/fileSystemReadFileTool.ts b/src/mcp/tools/fileSystemReadFileTool.ts index 1b59a50dd..881b16a27 100644 --- a/src/mcp/tools/fileSystemReadFileTool.ts +++ b/src/mcp/tools/fileSystemReadFileTool.ts @@ -1,12 +1,8 @@ -// @ts-nocheck - Zod v3 compatibility for MCP SDK (imported by mcpAction.ts) -// Note: @ts-expect-error would be preferable, but the type incompatibility extends -// beyond .shape to the entire handler function signature, causing 9+ type errors per file. -// This will be resolved when MCP SDK supports Zod v4. import fs from 'node:fs/promises'; import path from 'node:path'; import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'; import type { CallToolResult } from '@modelcontextprotocol/sdk/types.js'; -import { z } from 'zod/v3'; +import { z } from 'zod'; import { createSecretLintConfig, runSecretLint } from '../../core/security/workers/securityCheckWorker.js'; import { logger } from '../../shared/logger.js'; import { buildMcpToolErrorResponse, buildMcpToolSuccessResponse } from './mcpToolRuntime.js'; @@ -33,10 +29,8 @@ export const registerFileSystemReadFileTool = (mcpServer: McpServer) => { title: 'Read File', description: 'Read a file from the local file system using an absolute path. Includes built-in security validation to detect and prevent access to files containing sensitive information (API keys, passwords, secrets).', - // biome-ignore lint/suspicious/noExplicitAny: Zod v3 compatibility for MCP SDK - inputSchema: fileSystemReadFileInputSchema.shape as any, - // biome-ignore lint/suspicious/noExplicitAny: Zod v3 compatibility for MCP SDK - outputSchema: fileSystemReadFileOutputSchema.shape as any, + inputSchema: fileSystemReadFileInputSchema, + outputSchema: fileSystemReadFileOutputSchema, annotations: { readOnlyHint: true, destructiveHint: false, diff --git a/src/mcp/tools/grepRepomixOutputTool.ts b/src/mcp/tools/grepRepomixOutputTool.ts index ee0127dcc..a252e0f06 100644 --- a/src/mcp/tools/grepRepomixOutputTool.ts +++ b/src/mcp/tools/grepRepomixOutputTool.ts @@ -1,11 +1,7 @@ -// @ts-nocheck - Zod v3 compatibility for MCP SDK (imported by mcpAction.ts) -// Note: @ts-expect-error would be preferable, but the type incompatibility extends -// beyond .shape to the entire handler function signature, causing 9+ type errors per file. -// This will be resolved when MCP SDK supports Zod v4. import fs from 'node:fs/promises'; import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'; import type { CallToolResult } from '@modelcontextprotocol/sdk/types.js'; -import { z } from 'zod/v3'; +import { z } from 'zod'; import { logger } from '../../shared/logger.js'; import { buildMcpToolErrorResponse, @@ -88,10 +84,8 @@ export const registerGrepRepomixOutputTool = (mcpServer: McpServer) => { title: 'Grep Repomix Output', description: 'Search for patterns in a Repomix output file using grep-like functionality with JavaScript RegExp syntax. Returns matching lines with optional context lines around matches.', - // biome-ignore lint/suspicious/noExplicitAny: Zod v3 compatibility for MCP SDK - inputSchema: grepRepomixOutputInputSchema.shape as any, - // biome-ignore lint/suspicious/noExplicitAny: Zod v3 compatibility for MCP SDK - outputSchema: grepRepomixOutputOutputSchema.shape as any, + inputSchema: grepRepomixOutputInputSchema, + outputSchema: grepRepomixOutputOutputSchema, annotations: { readOnlyHint: true, destructiveHint: false, diff --git a/src/mcp/tools/mcpToolRuntime.ts b/src/mcp/tools/mcpToolRuntime.ts index 78e0e4b03..bec8138ce 100644 --- a/src/mcp/tools/mcpToolRuntime.ts +++ b/src/mcp/tools/mcpToolRuntime.ts @@ -1,4 +1,3 @@ -// @ts-nocheck - Zod v3 compatibility for MCP SDK (imported by mcpAction.ts) import crypto from 'node:crypto'; import fs from 'node:fs/promises'; import os from 'node:os'; diff --git a/src/mcp/tools/packCodebaseTool.ts b/src/mcp/tools/packCodebaseTool.ts index bbc600e0f..521729d2b 100644 --- a/src/mcp/tools/packCodebaseTool.ts +++ b/src/mcp/tools/packCodebaseTool.ts @@ -1,11 +1,7 @@ -// @ts-nocheck - Zod v3 compatibility for MCP SDK (imported by mcpAction.ts) -// Note: @ts-expect-error would be preferable, but the type incompatibility extends -// beyond .shape to the entire handler function signature, causing 9+ type errors per file. -// This will be resolved when MCP SDK supports Zod v4. import path from 'node:path'; import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'; import type { CallToolResult } from '@modelcontextprotocol/sdk/types.js'; -import { z } from 'zod/v3'; +import { z } from 'zod'; import { runCli } from '../../cli/cliRun.js'; import type { CliOptions } from '../../cli/types.js'; import { defaultFilePathMap } from '../../config/configSchema.js'; @@ -68,10 +64,8 @@ export const registerPackCodebaseTool = (mcpServer: McpServer) => { title: 'Pack Local Codebase', description: 'Package a local code directory into a consolidated file for AI analysis. This tool analyzes the codebase structure, extracts relevant code content, and generates a comprehensive report including metrics, file tree, and formatted code content. Supports multiple output formats: XML (structured with tags), Markdown (human-readable with ## headers and code blocks), JSON (machine-readable with files as key-value pairs), and Plain text (simple format with separators). Also supports Tree-sitter compression for efficient token usage.', - // biome-ignore lint/suspicious/noExplicitAny: Zod v3 compatibility for MCP SDK - inputSchema: packCodebaseInputSchema.shape as any, - // biome-ignore lint/suspicious/noExplicitAny: Zod v3 compatibility for MCP SDK - outputSchema: packCodebaseOutputSchema.shape as any, + inputSchema: packCodebaseInputSchema, + outputSchema: packCodebaseOutputSchema, annotations: { readOnlyHint: true, destructiveHint: false, diff --git a/src/mcp/tools/packRemoteRepositoryTool.ts b/src/mcp/tools/packRemoteRepositoryTool.ts index df0d454a7..ea664e23c 100644 --- a/src/mcp/tools/packRemoteRepositoryTool.ts +++ b/src/mcp/tools/packRemoteRepositoryTool.ts @@ -1,11 +1,7 @@ -// @ts-nocheck - Zod v3 compatibility for MCP SDK (imported by mcpAction.ts) -// Note: @ts-expect-error would be preferable, but the type incompatibility extends -// beyond .shape to the entire handler function signature, causing 9+ type errors per file. -// This will be resolved when MCP SDK supports Zod v4. import path from 'node:path'; import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'; import type { CallToolResult } from '@modelcontextprotocol/sdk/types.js'; -import { z } from 'zod/v3'; +import { z } from 'zod'; import { runCli } from '../../cli/cliRun.js'; import type { CliOptions } from '../../cli/types.js'; import { defaultFilePathMap } from '../../config/configSchema.js'; @@ -72,10 +68,8 @@ export const registerPackRemoteRepositoryTool = (mcpServer: McpServer) => { title: 'Pack Remote Repository', description: 'Fetch, clone, and package a GitHub repository into a consolidated file for AI analysis. This tool automatically clones the remote repository, analyzes its structure, and generates a comprehensive report. Supports multiple output formats: XML (structured with tags), Markdown (human-readable with ## headers and code blocks), JSON (machine-readable with files as key-value pairs), and Plain text (simple format with separators). Also supports various GitHub URL formats and includes security checks to prevent exposure of sensitive information.', - // biome-ignore lint/suspicious/noExplicitAny: Zod v3 compatibility for MCP SDK - inputSchema: packRemoteRepositoryInputSchema.shape as any, - // biome-ignore lint/suspicious/noExplicitAny: Zod v3 compatibility for MCP SDK - outputSchema: packRemoteRepositoryOutputSchema.shape as any, + inputSchema: packRemoteRepositoryInputSchema, + outputSchema: packRemoteRepositoryOutputSchema, annotations: { readOnlyHint: true, destructiveHint: false, diff --git a/src/mcp/tools/readRepomixOutputTool.ts b/src/mcp/tools/readRepomixOutputTool.ts index 22129f95b..c05b911fa 100644 --- a/src/mcp/tools/readRepomixOutputTool.ts +++ b/src/mcp/tools/readRepomixOutputTool.ts @@ -1,11 +1,7 @@ -// @ts-nocheck - Zod v3 compatibility for MCP SDK (imported by mcpAction.ts) -// Note: @ts-expect-error would be preferable, but the type incompatibility extends -// beyond .shape to the entire handler function signature, causing 9+ type errors per file. -// This will be resolved when MCP SDK supports Zod v4. import fs from 'node:fs/promises'; import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'; import type { CallToolResult } from '@modelcontextprotocol/sdk/types.js'; -import { z } from 'zod/v3'; +import { z } from 'zod'; import { logger } from '../../shared/logger.js'; import { buildMcpToolErrorResponse, @@ -44,10 +40,8 @@ export const registerReadRepomixOutputTool = (mcpServer: McpServer) => { title: 'Read Repomix Output', description: 'Read the contents of a Repomix-generated output file. Supports partial reading with line range specification for large files. This tool is designed for environments where direct file system access is limited (e.g., web-based environments, sandboxed applications). For direct file system access, use standard file operations.', - // biome-ignore lint/suspicious/noExplicitAny: Zod v3 compatibility for MCP SDK - inputSchema: readRepomixOutputInputSchema.shape as any, - // biome-ignore lint/suspicious/noExplicitAny: Zod v3 compatibility for MCP SDK - outputSchema: readRepomixOutputOutputSchema.shape as any, + inputSchema: readRepomixOutputInputSchema, + outputSchema: readRepomixOutputOutputSchema, annotations: { readOnlyHint: true, destructiveHint: false, diff --git a/src/mcp/tsconfig.json b/src/mcp/tsconfig.json deleted file mode 100644 index c420deb3a..000000000 --- a/src/mcp/tsconfig.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compilerOptions": { - "noImplicitAny": false, - "strict": false, - "skipLibCheck": true - }, - "include": [ - "**/*" - ], - "exclude": [] -}