@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
28 lines (27 loc) • 1.15 kB
TypeScript
import { z } from 'zod';
import { RequestContext } from '../../../utils/internal/requestContext.js';
export declare const CreateDirectoryInputSchema: z.ZodObject<{
path: z.ZodString;
create_parents: z.ZodDefault<z.ZodBoolean>;
}, "strip", z.ZodTypeAny, {
path: string;
create_parents: boolean;
}, {
path: string;
create_parents?: boolean | undefined;
}>;
export type CreateDirectoryInput = z.infer<typeof CreateDirectoryInputSchema>;
export interface CreateDirectoryOutput {
message: string;
createdPath: string;
parentsCreated: boolean;
}
/**
* Creates a specified directory, optionally creating parent directories.
*
* @param {CreateDirectoryInput} input - The input object containing path and create_parents flag.
* @param {RequestContext} context - The request context.
* @returns {Promise<CreateDirectoryOutput>} A promise resolving with the creation status.
* @throws {McpError} For path errors, if the path already exists and is not a directory, or I/O errors.
*/
export declare const createDirectoryLogic: (input: CreateDirectoryInput, context: RequestContext) => Promise<CreateDirectoryOutput>;