xcode-project-info
Extract and analyze key details from an Xcode project or workspace to support iOS project management, building, testing, and deployment tasks within the Xcode MCP Server.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectPath | Yes | Xcode 프로젝트 또는 워크스페이스 경로 |
Implementation Reference
- src/index.ts:37-77 (handler)The asynchronous handler function that runs 'xcodebuild -list -json -project' on the project path, attempts to parse the JSON output, and returns formatted project information or raw output on error.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:34-35 (schema)Zod input schema defining the required 'projectPath' parameter as a string.projectPath: z.string().describe("Xcode 프로젝트 또는 워크스페이스 경로") },
- src/index.ts:32-78 (registration)Registers the 'xcode-project-info' tool with the MCP server using server.tool(name, schema, 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 }; } } );