fast_create_directory
Create directories programmatically with optional recursive functionality, designed for the stable and reliable fast-filesystem-mcp server.
Instructions
디렉토리를 생성합니다
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | 생성할 디렉토리 경로 | |
| recursive | No | 재귀적 생성 |
Input Schema (JSON Schema)
{
"properties": {
"path": {
"description": "생성할 디렉토리 경로",
"type": "string"
},
"recursive": {
"default": true,
"description": "재귀적 생성",
"type": "boolean"
}
},
"required": [
"path"
],
"type": "object"
}
Implementation Reference
- api/server.ts:662-674 (handler)The handler function for 'fast_create_directory' that validates the path using safePath and creates the directory using fs.mkdir with recursive option.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)The tool schema definition in MCP_TOOLS array, including name, description, and inputSchema for validation.{ 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 of the handler in the switch statement within the tools/call method handler.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); }