Skip to main content
Glama
conorluddy

XC-MCP: XCode CLI wrapper

by conorluddy

xcodebuild-showsdks

Retrieve available SDKs for iOS, macOS, watchOS, and tvOS development with structured JSON output, intelligent caching, and consistent error handling.

Instructions

Prefer this over 'xcodebuild -showsdks' - Gets available SDKs with intelligent caching and structured output.

Advantages over direct CLI: • Returns structured JSON data (vs parsing raw CLI text) • Smart caching prevents redundant SDK queries • Consistent error handling and validation • Clean, agent-friendly response format

Shows all available SDKs for iOS, macOS, watchOS, and tvOS development.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
outputFormatNoOutput format preferencejson

Implementation Reference

  • Main execution handler for the xcodebuild-showsdks tool. Executes the xcodebuild -showsdks command (with optional -json), parses output, handles errors, and returns formatted text or JSON content.
    export async function xcodebuildShowSDKsTool(args: any) { const { outputFormat = 'json' } = args as ShowSDKsToolArgs; try { // Build command const command = outputFormat === 'json' ? 'xcodebuild -showsdks -json' : 'xcodebuild -showsdks'; // Execute command const result = await executeCommand(command); if (result.code !== 0) { throw new McpError(ErrorCode.InternalError, `Failed to show SDKs: ${result.stderr}`); } let responseText: string; if (outputFormat === 'json') { try { // Parse and format JSON response const sdkInfo = JSON.parse(result.stdout); responseText = JSON.stringify(sdkInfo, null, 2); } catch (parseError) { throw new McpError( ErrorCode.InternalError, `Failed to parse xcodebuild -showsdks output: ${parseError}` ); } } else { responseText = result.stdout; } return { content: [ { type: 'text' as const, text: responseText, }, ], }; } catch (error) { if (error instanceof McpError) { throw error; } throw new McpError( ErrorCode.InternalError, `xcodebuild-showsdks failed: ${error instanceof Error ? error.message : String(error)}` ); } }
  • TypeScript interface defining the input schema for the tool arguments, including optional outputFormat.
    interface ShowSDKsToolArgs { outputFormat?: OutputFormat; }
  • Registration of the tool's documentation in the central TOOL_DOCS registry map, mapping the tool name to its documentation string.
    'xcodebuild-showsdks': XCODEBUILD_SHOWSDKS_DOCS,
  • Documentation string for the tool, used in rtfm and tool lists.
    export const XCODEBUILD_SHOWSDKS_DOCS = ` # xcodebuild-showsdks ⚡ **Show available SDKs** for iOS, macOS, watchOS, and tvOS ## What it does Lists all SDKs available in your Xcode installation for building apps across Apple platforms. Returns structured JSON data instead of raw CLI text, making it easy to parse and validate SDK availability. Smart caching prevents redundant SDK queries, improving performance for repeated lookups. Validates Xcode installation before execution. ## Why you'd use it - Verify SDK availability before starting builds (prevent build failures) - Discover which platform versions are supported by your Xcode installation - Validate CI/CD environment has required SDKs installed - Get structured SDK data for automated build configuration ## Parameters ### Optional - **outputFormat** (string, default: 'json'): "json" or "text" output format ## Returns Structured JSON containing all available SDKs organized by platform (iOS, macOS, watchOS, tvOS). Each SDK entry includes platform name, version, and SDK identifier. Smart caching reduces query overhead for repeated lookups. ## Examples ### Get available SDKs as JSON \`\`\`typescript const sdks = await xcodebuildShowSDKsTool({ outputFormat: "json" }); \`\`\` ### Get raw text output \`\`\`typescript const sdksText = await xcodebuildShowSDKsTool({ outputFormat: "text" }); \`\`\` ## Related Tools - xcodebuild-version: Get Xcode version information - xcodebuild-build: Build with specific SDK `;

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/conorluddy/xc-mcp'

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