xcode-project-info
Extract key information from Xcode projects and workspaces to analyze project structure, configurations, and settings for iOS development.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectPath | Yes | Xcode 프로젝트 또는 워크스페이스 경로 |
Implementation Reference
- src/index.ts:36-77 (handler)Handler function that executes 'xcodebuild -list -json' on the provided Xcode project path to retrieve and return project information in JSON or raw format, with error handling.async ({ projectPath }) => { try { console.error(`Xcode 프로젝트 정보 확인: ${projectPath}`); // xcodebuild -list 명령어로 프로젝트 정보 가져오기 const command = `xcodebuild -list -json -project "${projectPath}"`; try { const { stdout } = await executeCommand(command); // JSON 파싱 시도 try { const projectInfo = JSON.parse(stdout); return { content: [{ type: "text", text: `Xcode 프로젝트 정보:\n${JSON.stringify(projectInfo, null, 2)}` }] }; } catch (parseError) { // JSON 파싱 실패 시 원본 출력 반환 return { content: [{ type: "text", text: `Xcode 프로젝트 정보:\n${stdout}` }] }; } } catch (error: any) { throw error; } } catch (error: any) { console.error(`Xcode 프로젝트 정보 오류: ${error.message}`); return { content: [{ type: "text", text: `Xcode 프로젝트 정보를 가져오는 중 오류가 발생했습니다:\n${error.message}\n${error.stderr || ''}` }], isError: true }; } }
- src/index.ts:33-35 (schema)Zod schema defining the input parameter 'projectPath' for the tool.{ projectPath: z.string().describe("Xcode 프로젝트 또는 워크스페이스 경로") },
- src/index.ts:32-78 (registration)Registration of the 'xcode-project-info' tool using McpServer.tool(), including schema and inline handler."xcode-project-info", { projectPath: z.string().describe("Xcode 프로젝트 또는 워크스페이스 경로") }, async ({ projectPath }) => { try { console.error(`Xcode 프로젝트 정보 확인: ${projectPath}`); // xcodebuild -list 명령어로 프로젝트 정보 가져오기 const command = `xcodebuild -list -json -project "${projectPath}"`; try { const { stdout } = await executeCommand(command); // JSON 파싱 시도 try { const projectInfo = JSON.parse(stdout); return { content: [{ type: "text", text: `Xcode 프로젝트 정보:\n${JSON.stringify(projectInfo, null, 2)}` }] }; } catch (parseError) { // JSON 파싱 실패 시 원본 출력 반환 return { content: [{ type: "text", text: `Xcode 프로젝트 정보:\n${stdout}` }] }; } } catch (error: any) { throw error; } } catch (error: any) { console.error(`Xcode 프로젝트 정보 오류: ${error.message}`); return { content: [{ type: "text", text: `Xcode 프로젝트 정보를 가져오는 중 오류가 발생했습니다:\n${error.message}\n${error.stderr || ''}` }], isError: true }; } } );