xcode_create_directory
Create directories and subdirectories in Xcode projects to organize files and manage project structure.
Instructions
Create a directory with subdirectories if needed
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Directory path to create |
Implementation Reference
- src/command-executor.ts:202-204 (handler)Handler for the 'create_directory' internal command (mapped from tool 'xcode_create_directory'). Calls FileManager.createDirectory and sets success message.await this.fileManager.createDirectory(args.path); output = `Directory created successfully at: ${args.path}`; break;
- src/file-manager.ts:38-40 (helper)Core implementation that creates the directory using fs.mkdir with recursive:true option.async createDirectory(dirPath: string): Promise<void> { await fs.mkdir(dirPath, { recursive: true }); }
- src/command-executor.ts:281-306 (registration)Dynamically generates MCP tool registrations including 'xcode_create_directory' by prefixing command names with 'xcode_' and deriving input schema from command definitions.generateMCPToolDefinitions(): Array<{ name: string; description: string; inputSchema: any; }> { return Object.entries(this.commands).map(([name, command]) => ({ name: `xcode_${name}`, description: command.description, inputSchema: { type: 'object', properties: command.parameters ? Object.fromEntries( Object.entries(command.parameters).map(([paramName, paramDef]) => [ paramName, { type: paramDef.type, description: paramDef.description, ...(paramDef.default !== undefined && { default: paramDef.default }) } ]) ) : {}, required: command.parameters ? Object.entries(command.parameters) .filter(([_, paramDef]) => paramDef.required) .map(([paramName]) => paramName) : [] } })); }
- src/index.ts:136-139 (handler)Tool call handler that maps 'xcode_*' tool names to internal commands by removing prefix and dispatching to CommandExecutor.executeCommand.// Remove 'xcode_' prefix if present const commandName = name.startsWith('xcode_') ? name.slice(6) : name; const result = await this.commandExecutor.executeCommand(commandName, args);
- src/index.ts:87-89 (registration)Registers the list of available tools (including dynamically generated xcode_* tools) with the MCP server.this.server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: [...tools, ...webMonitorTools], }));