UNPKG

@cyanheads/filesystem-mcp-server

Version:

A Model Context Protocol (MCP) server for platform-agnostic file capabilities, including advanced search and replace, and directory tree traversal

34 lines (33 loc) 1.23 kB
import { z } from 'zod'; import { RequestContext } from '../../../utils/internal/requestContext.js'; export declare const ListFilesInputSchema: z.ZodObject<{ path: z.ZodString; includeNested: z.ZodDefault<z.ZodBoolean>; maxEntries: z.ZodDefault<z.ZodOptional<z.ZodNumber>>; }, "strip", z.ZodTypeAny, { path: string; includeNested: boolean; maxEntries: number; }, { path: string; includeNested?: boolean | undefined; maxEntries?: number | undefined; }>; export type ListFilesInput = z.infer<typeof ListFilesInputSchema>; export interface ListFilesOutput { message: string; tree: string; requestedPath: string; resolvedPath: string; itemCount: number; truncated: boolean; } /** * Lists files and directories at a given path, optionally recursively. * * @param {ListFilesInput} input - The input object containing path and options. * @param {RequestContext} context - The request context. * @returns {Promise<ListFilesOutput>} A promise resolving with the listing results. * @throws {McpError} For path errors, directory not found, or I/O errors. */ export declare const listFilesLogic: (input: ListFilesInput, context: RequestContext) => Promise<ListFilesOutput>;