Skip to main content
Glama
ebowwa

Xcode MCP Server

by ebowwa

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

Implementation Reference

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

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