fast_create_directory
Create directories with optional recursive parent creation for organized file structures in the fast-filesystem-mcp environment.
Instructions
Creates a directory
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Path of the directory to create | |
| recursive | No | Create parent directories if they do not exist |
Implementation Reference
- api/server.ts:662-674 (handler)The main handler function that safely creates a directory using fs.mkdir after validating the path with safePath. Supports recursive creation.async function handleCreateDirectory(args: any) { const { path: dirPath, recursive = true } = args; const safePath_resolved = safePath(dirPath); await fs.mkdir(safePath_resolved, { recursive }); return { message: 'Directory created successfully', path: safePath_resolved, recursive: recursive, timestamp: new Date().toISOString() }; }
- api/server.ts:166-177 (schema)Tool schema definition including name, description, and inputSchema with parameters 'path' (required) and 'recursive' (optional boolean).{ name: 'fast_create_directory', description: '디렉토리를 생성합니다', inputSchema: { type: 'object', properties: { path: { type: 'string', description: '생성할 디렉토리 경로' }, recursive: { type: 'boolean', description: '재귀적 생성', default: true } }, required: ['path'] } },
- api/server.ts:335-337 (registration)Registration in the tool dispatcher switch statement, calling the handleCreateDirectory function.case 'fast_create_directory': result = await handleCreateDirectory(args); break;
- api/server.ts:38-43 (helper)Helper function used by the handler to validate and resolve the directory path safely.function safePath(inputPath: string): string { if (!isPathAllowed(inputPath)) { throw new Error(`Access denied to path: ${inputPath}`); } return path.resolve(inputPath); }