How shenghaiwang/xcodebuild works
Project type and purpose
• This is a thin, Python‑based MCP (Model Context Protocol) server that exposes two “tools” (build and test) for iOS Xcode workspaces/projects.
• It’s invoked either via Astral’s uvx CLI or directly with Python’s -m mcpxcodebuild.
File structure
• pyproject.toml – project metadata, dependencies (including MCP/uv libraries).
• uv.lock – locked dependencies for uv.
• src/mcpxcodebuild/
• __main__.py – entrypoint that boots the MCP server.
• server.py – core server implementation: registers “build” and “test” handlers; listens on stdio or TCP (the MCP transport).
README for additional insights
• Two exposed commands:
• build(folder: string) → runs xcodebuild CLI to compile the workspace/project.
• test(folder: string) → runs xcodebuild test.
• Integration targets: VS Code extensions (Cline, Roo Code), Claude.app via JSON config.
Elements
• Request → Server
• Server → Subprocess
• Subprocess → File System (read/write)
• Subprocess → Server (stdout/stderr)
• Server → Client (response)
• Client (green), Server (blue), Subprocess (orange), File System (gray)
• Annotations for entrypoint (__main__.py) and key modules (server.py).