Skip to main content
Glama

build_mac_proj

Automate macOS app builds by specifying project paths, schemes, and configurations using xcodebuild. Supports custom architectures, derived data paths, and additional arguments for tailored builds.

Instructions

Builds a macOS app using xcodebuild from a project file.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
archNoArchitecture to build for (arm64 or x86_64). For macOS only.
configurationNoBuild configuration (Debug, Release, etc.)
derivedDataPathNoPath where build products and other derived data will go
extraArgsNoAdditional xcodebuild arguments
preferXcodebuildNoIf true, prefers xcodebuild over the experimental incremental build system, useful for when incremental build system fails.
projectPathYesPath to the .xcodeproj file (Required)
schemeYesThe scheme to use (Required)

Implementation Reference

  • Core implementation of the build logic for the 'build_mac_proj' tool. This private function handles the execution of the xcodebuild command for macOS projects.
    async function _handleMacOSBuildLogic(params: { workspacePath?: string; projectPath?: string; scheme: string; configuration: string; derivedDataPath?: string; arch?: string; extraArgs?: string[]; preferXcodebuild?: boolean; }): Promise<ToolResponse> { log('info', `Starting macOS build for scheme ${params.scheme} (internal)`); return executeXcodeBuildCommand( { ...params, }, { platform: XcodePlatform.macOS, arch: params.arch, logPrefix: 'macOS Build', }, params.preferXcodebuild, 'build', ); }
  • Input schema definition for the 'build_mac_proj' tool, including project-specific parameters like projectPath and optional arch.
    { projectPath: projectPathSchema, scheme: schemeSchema, configuration: configurationSchema, derivedDataPath: derivedDataPathSchema, arch: archSchema, extraArgs: extraArgsSchema, preferXcodebuild: preferXcodebuildSchema, },
  • Local registration function for the 'build_mac_proj' tool, defining name, description, schema, and handler.
    export function registerMacOSBuildProjectTool(server: McpServer): void { type ProjectParams = { projectPath: string; scheme: string; configuration?: string; derivedDataPath?: string; arch?: string; extraArgs?: string[]; preferXcodebuild?: boolean; }; registerTool<ProjectParams>( server, 'build_mac_proj', 'Builds a macOS app using xcodebuild from a project file.', { projectPath: projectPathSchema, scheme: schemeSchema, configuration: configurationSchema, derivedDataPath: derivedDataPathSchema, arch: archSchema, extraArgs: extraArgsSchema, preferXcodebuild: preferXcodebuildSchema, }, async (params) => _handleMacOSBuildLogic({ ...params, configuration: params.configuration ?? 'Debug', preferXcodebuild: params.preferXcodebuild ?? false, }), ); }
  • Invocation of the tool registration in the central registerTools function, grouped under MACOS_WORKFLOW.
    { register: registerMacOSBuildProjectTool, groups: [ToolGroup.MACOS_WORKFLOW], envVar: 'XCODEBUILDMCP_TOOL_MACOS_BUILD_PROJECT',
  • macOS-specific architecture schema used in the tool's input validation.
    const archSchema = z .enum(['arm64', 'x86_64']) .optional() .describe('Architecture to build for (arm64 or x86_64). For macOS only.');

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/SampsonKY/XcodeBuildMCP'

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