Skip to main content
Glama
ebowwa
by ebowwa

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
NameRequiredDescriptionDefault
pathYesDirectory path to create

Implementation Reference

  • 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;
  • 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);
  • 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], }));

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ebowwa/xcode-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server