When multiple MCP sessions (or CLI invocations) build the same project from different clones, they all share a single flat ~/Library/Developer/XcodeBuildMCP/DerivedData directory. Because xcodebuild only creates hashed per-project subdirectories when using its default DerivedData location — not when an explicit -derivedDataPath is passed — concurrent builds of the same project collide on the shared Build/, SourcePackages/, etc.
This causes corrupted incremental builds, race conditions, and unpredictable failures when running parallel agent sessions against separate clones of the same repo.
Proposed solution: Hash the workspace/project root path into the DerivedData subdirectory, e.g.:
~/Library/Developer/XcodeBuildMCP/DerivedData/<scheme>-<hash-of-workspace-root>/
This mirrors how Xcode isolates DerivedData per workspace in its default location. The hash should be derived from the resolved absolute path of the workspace or project file so that different clones get different directories automatically.
Current workaround: Set a unique XCODEBUILDMCP_DERIVED_DATA_PATH env var or derivedDataPath session default per session.
When multiple MCP sessions (or CLI invocations) build the same project from different clones, they all share a single flat
~/Library/Developer/XcodeBuildMCP/DerivedDatadirectory. Because xcodebuild only creates hashed per-project subdirectories when using its default DerivedData location — not when an explicit-derivedDataPathis passed — concurrent builds of the same project collide on the sharedBuild/,SourcePackages/, etc.This causes corrupted incremental builds, race conditions, and unpredictable failures when running parallel agent sessions against separate clones of the same repo.
Proposed solution: Hash the workspace/project root path into the DerivedData subdirectory, e.g.:
This mirrors how Xcode isolates DerivedData per workspace in its default location. The hash should be derived from the resolved absolute path of the workspace or project file so that different clones get different directories automatically.
Current workaround: Set a unique
XCODEBUILDMCP_DERIVED_DATA_PATHenv var orderivedDataPathsession default per session.