create_directory
Generate or verify directory existence at a specified path using Filesystem MCP Server, ensuring efficient file organization and accessibility.
Instructions
Create new directory or ensure it exists
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Path to the directory to create |
Implementation Reference
- src/index.ts:301-315 (handler)Handler for the 'create_directory' tool: extracts path argument, validates it, ensures directory exists using fs.ensureDir, and returns success message.case 'create_directory': { const { path: dirPath } = request.params.arguments as { path: string }; validatePath(dirPath); await fs.ensureDir(dirPath); return { content: [ { type: 'text', text: `Directory created successfully: ${dirPath}`, }, ], }; }
- src/index.ts:144-157 (registration)Registration of the 'create_directory' tool in the ListTools handler, including name, description, and input schema definition.{ name: 'create_directory', description: 'Create new directory or ensure it exists', inputSchema: { type: 'object', properties: { path: { type: 'string', description: 'Path to the directory to create', }, }, required: ['path'], }, },