Skip to main content
Glama

build_mac_proj

Builds macOS applications using xcodebuild from Xcode project files by specifying project path, scheme, and optional configuration settings.

Instructions

Builds a macOS app using xcodebuild from a project file.

Input Schema

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

Implementation Reference

  • Core handler logic for the 'build_mac_proj' tool. Executes the xcodebuild build command for macOS projects using executeXcodeBuildCommand.
    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',
      );
    }
  • Tool registration function that calls registerTool to add 'build_mac_proj' to the MCP server with 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,
          }),
      );
    }
  • Server-level registration entry for the 'build_mac_proj' tool, conditionally registered based on environment variable.
    {
      register: registerMacOSBuildProjectTool,
      groups: [ToolGroup.MACOS_WORKFLOW],
      envVar: 'XCODEBUILDMCP_TOOL_MACOS_BUILD_PROJECT',
    },
  • Zod input schemas used by the 'build_mac_proj' tool for parameter validation.
    export const workspacePathSchema = z.string().describe('Path to the .xcworkspace file (Required)');
    export const projectPathSchema = z.string().describe('Path to the .xcodeproj file (Required)');
    export const schemeSchema = z.string().describe('The scheme to use (Required)');
    export const configurationSchema = z
      .string()
      .optional()
      .describe('Build configuration (Debug, Release, etc.)');
    export const derivedDataPathSchema = z
      .string()
      .optional()
      .describe('Path where build products and other derived data will go');
    export const extraArgsSchema = z
      .array(z.string())
      .optional()
      .describe('Additional xcodebuild arguments');
    export const simulatorNameSchema = z
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden but provides minimal behavioral context. It mentions 'using xcodebuild' which implies a command-line build process, but doesn't disclose critical behaviors like whether this is a blocking/long-running operation, what happens on failure, if it modifies files, or what output to expect. For a build tool with zero annotation coverage, this is insufficient.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that gets straight to the point with zero wasted words. It's appropriately sized for a tool with comprehensive schema documentation and follows good front-loading by stating the core purpose immediately.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a build tool with 7 parameters, no annotations, and no output schema, the description is inadequate. It doesn't explain what the tool returns (e.g., success/failure status, build output path), what side effects occur, or how it differs from similar build tools. The context signals show this is a complex operation that needs more behavioral disclosure than provided.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all 7 parameters thoroughly. The description adds no additional parameter semantics beyond what's in the schema. This meets the baseline of 3 since the schema does the heavy lifting, but the description doesn't enhance understanding of parameter relationships or usage patterns.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Builds') and resource ('macOS app using xcodebuild from a project file'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'build_mac_ws' (workspace-based) or 'build_run_mac_proj' (build-and-run), leaving some ambiguity about when to choose this specific tool.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like 'build_mac_ws' (workspace-based) or 'build_run_mac_proj' (build-and-run). The description only states what it does, not when it's appropriate or what prerequisites might exist (e.g., needing Xcode installed).

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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