xcode-list-schemes
Retrieve all available build schemes from an Xcode project or workspace by specifying its path, enabling efficient project configuration and management.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectPath | Yes | Xcode 프로젝트 또는 워크스페이스 경로 |
Implementation Reference
- src/index.ts:166-202 (handler)The handler function that executes the core logic of the 'xcode-list-schemes' tool: determines if the path is a workspace or project, runs 'xcodebuild -list', captures stdout/stderr, formats the output, and handles errors.async ({ projectPath }) => { try { console.error(`Xcode 스킴 목록 조회: ${projectPath}`); // 워크스페이스인지 프로젝트인지 확인 let command; if (projectPath.endsWith(".xcworkspace")) { command = `xcodebuild -list -workspace "${projectPath}"`; } else { command = `xcodebuild -list -project "${projectPath}"`; } try { const { stdout, stderr } = await executeCommand(command); let resultText = "Xcode 스킴 및 타겟 목록:\n"; if (stdout) resultText += `${stdout}\n`; if (stderr) resultText += `${stderr}\n`; return { content: [{ type: "text", text: resultText }] }; } catch (error: any) { throw error; } } catch (error: any) { console.error(`스킴 목록 조회 오류: ${error.message}`); return { content: [{ type: "text", text: `스킴 목록을 조회하는 중 오류가 발생했습니다:\n${error.message}\n${error.stderr || ''}` }], isError: true }; } }
- src/index.ts:163-165 (schema)Zod input schema defining the required 'projectPath' parameter for the tool.{ projectPath: z.string().describe("Xcode 프로젝트 또는 워크스페이스 경로") },
- src/index.ts:161-203 (registration)Registration of the 'xcode-list-schemes' tool on the MCP server using server.tool(name, schema, handler).server.tool( "xcode-list-schemes", { projectPath: z.string().describe("Xcode 프로젝트 또는 워크스페이스 경로") }, async ({ projectPath }) => { try { console.error(`Xcode 스킴 목록 조회: ${projectPath}`); // 워크스페이스인지 프로젝트인지 확인 let command; if (projectPath.endsWith(".xcworkspace")) { command = `xcodebuild -list -workspace "${projectPath}"`; } else { command = `xcodebuild -list -project "${projectPath}"`; } try { const { stdout, stderr } = await executeCommand(command); let resultText = "Xcode 스킴 및 타겟 목록:\n"; if (stdout) resultText += `${stdout}\n`; if (stderr) resultText += `${stderr}\n`; return { content: [{ type: "text", text: resultText }] }; } catch (error: any) { throw error; } } catch (error: any) { console.error(`스킴 목록 조회 오류: ${error.message}`); return { content: [{ type: "text", text: `스킴 목록을 조회하는 중 오류가 발생했습니다:\n${error.message}\n${error.stderr || ''}` }], isError: true }; } } );