Skip to main content
Glama

MCP Xcode

by Stefan-Nitu
BuildArtifactLocatorAdapter.ts1.61 kB
import { existsSync } from 'fs'; import { createModuleLogger } from '../../../logger.js'; import { IAppLocator } from '../../../application/ports/ArtifactPorts.js'; import { ICommandExecutor } from '../../../application/ports/CommandPorts.js'; const logger = createModuleLogger('BuildArtifactLocator'); /** * Locates build artifacts (application bundles) in DerivedData * Single Responsibility: Find .app bundles in build directories */ export class BuildArtifactLocatorAdapter implements IAppLocator { constructor(private executor: ICommandExecutor) {} /** * Find the built app in DerivedData * @param derivedDataPath Path to DerivedData directory * @returns Path to the .app bundle, or undefined if not found */ async findApp(derivedDataPath: string): Promise<string | undefined> { try { const result = await this.executor.execute( `find "${derivedDataPath}" -name "*.app" -type d | head -1`, { timeout: 5000 } // 5 second timeout for find ); const appPath = result.stdout.trim(); if (!appPath) { logger.warn({ derivedDataPath }, 'No app found in DerivedData'); return undefined; } logger.info({ appPath }, 'Found app at path'); // Verify the app actually exists if (!existsSync(appPath)) { logger.error({ appPath }, 'App path does not exist!'); return undefined; } return appPath; } catch (error: any) { logger.error({ error: error.message, derivedDataPath }, 'Error finding app path'); return undefined; } } }

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/Stefan-Nitu/mcp-xcode'

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