xcode_create_directory
Create directories and subdirectories programmatically within Xcode projects using the Xcode MCP Server. Specify the path to automate directory structure setup for iOS/macOS projects.
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:201-204 (handler)Specific handler case for 'create_directory' internal command, invoked for MCP tool 'xcode_create_directory'. Calls fileManager.createDirectory with args.path and sets success message.case 'create_directory': await this.fileManager.createDirectory(args.path); output = `Directory created successfully at: ${args.path}`; break;
- src/file-manager.ts:38-40 (helper)Core helper function that performs the directory creation using Node.js fs.mkdir with recursive option.async createDirectory(dirPath: string): Promise<void> { await fs.mkdir(dirPath, { recursive: true }); }
- src/index.ts:135-139 (registration)Part of MCP CallToolRequestSchema handler that processes 'xcode_*' prefixed tools by stripping prefix and delegating to command executor, enabling execution of 'xcode_create_directory'.// Handle Xcode commands // Remove 'xcode_' prefix if present const commandName = name.startsWith('xcode_') ? name.slice(6) : name; const result = await this.commandExecutor.executeCommand(commandName, args);
- src/command-executor.ts:281-306 (schema)Generates dynamic MCP tool definitions for all commands, prefixing names with 'xcode_' and deriving inputSchema from command parameters, thus providing schema for 'xcode_create_directory'.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:87-89 (registration)Registers the dynamic list of MCP tools (including 'xcode_create_directory') via ListToolsRequestSchema handler.this.server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: [...tools, ...webMonitorTools], }));