show_build_set_ws
Display Xcode project build settings by specifying workspace path and scheme using xcodebuild to configure development environments.
Instructions
Shows build settings from a workspace using xcodebuild. IMPORTANT: Requires workspacePath and scheme. Example: show_build_set_ws({ workspacePath: '/path/to/MyProject.xcworkspace', scheme: 'MyScheme' })
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| workspacePath | Yes | Path to the .xcworkspace file (Required) | |
| scheme | Yes | The scheme to use (Required) |
Implementation Reference
- src/tools/build_settings.ts:34-79 (handler)Core handler logic shared by workspace and project tools. Executes `xcodebuild -showBuildSettings` with appropriate flags and formats the response.async function _handleShowBuildSettingsLogic(params: { workspacePath?: string; projectPath?: string; scheme: string; }): Promise<ToolResponse> { log('info', `Showing build settings for scheme ${params.scheme}`); try { // Create the command array for xcodebuild const command = ['xcodebuild', '-showBuildSettings']; // -showBuildSettings as an option, not an action // Add the workspace or project if (params.workspacePath) { command.push('-workspace', params.workspacePath); } else if (params.projectPath) { command.push('-project', params.projectPath); } // Add the scheme command.push('-scheme', params.scheme); // Execute the command directly const result = await executeCommand(command, 'Show Build Settings'); if (!result.success) { return createTextResponse(`Failed to show build settings: ${result.error}`, true); } return { content: [ { type: 'text', text: `✅ Build settings for scheme ${params.scheme}:`, }, { type: 'text', text: result.output || 'Build settings retrieved successfully.', }, ], }; } catch (error) { const errorMessage = error instanceof Error ? error.message : String(error); log('error', `Error showing build settings: ${errorMessage}`); return createTextResponse(`Error showing build settings: ${errorMessage}`, true); } }
- src/tools/build_settings.ts:158-178 (registration)Registers the 'show_build_set_ws' tool on the MCP server, including input schema, description, and handler wrapper with validation.export function registerShowBuildSettingsWorkspaceTool(server: McpServer): void { registerTool<BaseWorkspaceParams>( server, 'show_build_set_ws', "Shows build settings from a workspace using xcodebuild. IMPORTANT: Requires workspacePath and scheme. Example: show_build_set_ws({ workspacePath: '/path/to/MyProject.xcworkspace', scheme: 'MyScheme' })", { workspacePath: workspacePathSchema, scheme: schemeSchema, }, async (params: BaseWorkspaceParams) => { // Validate required parameters const workspaceValidation = validateRequiredParam('workspacePath', params.workspacePath); if (!workspaceValidation.isValid) return workspaceValidation.errorResponse!; const schemeValidation = validateRequiredParam('scheme', params.scheme); if (!schemeValidation.isValid) return schemeValidation.errorResponse!; return _handleShowBuildSettingsLogic(params); }, ); }
- src/tools/build_settings.ts:164-166 (schema)Input schema for the tool: workspacePath (string, required) and scheme (string, required).workspacePath: workspacePathSchema, scheme: schemeSchema, },
- src/utils/register-tools.ts:129-132 (registration)Entry in toolRegistrations array that conditionally registers the tool during server initialization.register: registerShowBuildSettingsWorkspaceTool, groups: [ToolGroup.PROJECT_DISCOVERY], envVar: 'XCODEBUILDMCP_TOOL_SHOW_BUILD_SETTINGS_WORKSPACE', },
- src/tools/common.ts:24-24 (schema)Zod schema for the 'scheme' parameter used by the tool.export const schemeSchema = z.string().describe('The scheme to use (Required)');
- src/tools/common.ts:22-22 (schema)Zod schema for the 'workspacePath' parameter used by the tool.export const workspacePathSchema = z.string().describe('Path to the .xcworkspace file (Required)');