Skip to main content
Glama
xcode-build-optimizer-mcp

xcode-build-optimizer-mcp

by sanatillayev

xcode-build-optimizer-mcp

An MCP server for deterministic Xcode build-time optimization: build-timing analysis, DerivedData/module-cache management, and build-speed config linting — for AI coding agents (Claude Code, Claude Desktop, and other MCP clients).

This is deliberately not a build/test/simulator orchestration tool — use it alongside XcodeBuildMCP or any other build runner.

Install

npx xcode-build-optimizer-mcp

Add to your MCP client config (e.g. Claude Code ~/.claude.json or Claude Desktop claude_desktop_config.json):

{
  "mcpServers": {
    "xcode-build-optimizer": {
      "command": "npx",
      "args": ["xcode-build-optimizer-mcp"]
    }
  }
}

Related MCP server: xcsift-mcp

Tools

Tool

Purpose

build_run

Run an instrumented xcodebuild build; returns structured errors/warnings and a buildId.

build_timing_report

Ranked slow build task categories/functions/expressions for a build_run result.

cache_inspect

DerivedData/module-cache size, staleness, and bloat report.

cache_clean

Delete a specific cache path reported by cache_inspect (requires confirm: true).

config_lint

Scan .pbxproj/.xcconfig for 8 known build-speed anti-patterns.

Requirements

  • macOS with Xcode Command Line Tools installed.

  • Node.js >= 20.

For per-expression timing, pass deep: true to build_run; build_timing_report then reports deepSource: "debug-time-function-bodies".

Not yet implemented: an opportunistic XCLogParser enhancement was prototyped but is not wired up in v0.1 — its JSON output shape and the .xcactivitylog naming convention it depends on have not been verified against a real XCLogParser install. build_timing_report never invokes xclogparser, whether or not it is on PATH.

Contributing

Issues and PRs welcome. Run npm test before submitting; npm run test:integration additionally requires a full Xcode install and runs a real build against the fixture project in test/integration/.

License

MIT

Available Tools

5 tools
build_runA

Run an Xcode build with build-timing instrumentation always enabled, returning structured errors/warnings and a buildId for build_timing_report.

Inputs: scheme (required), projectPath (required), deep, destination, +1 more.

build_timing_reportA

Return ranked slow build task categories/functions/expressions for a previous build_run call.

Inputs: buildId.

cache_cleanA

Delete a specific DerivedData or ModuleCache.noindex path previously reported by cache_inspect. Requires confirm: true.

Inputs: path (required), confirm (required).

cache_inspectA

Report DerivedData and module cache size, staleness, and bloat for all projects.

Inputs: no named parameters.

config_lintA

Scan a project's .pbxproj/.xcconfig for known build-speed anti-patterns.

Inputs: pbxprojPath (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.1/5.0

    Scored across 5 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose: build execution, cache inspection, cache cleanup, timing analysis, and config linting. No overlap in functionality, and the descriptions further distinguish their roles.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern (build_run, cache_inspect, cache_clean, build_timing_report, config_lint). This is uniform and predictable, making tool selection straightforward.

    Tool Count5/5

    Five tools is well-scoped for an Xcode build optimizer server. Each tool serves a distinct part of the optimization workflow without redundancy, and the count feels neither thin nor overwhelming for the purpose.

    Completeness4/5

    The tool set covers the primary lifecycle: running builds, inspecting and cleaning caches, analyzing timing, and linting configs. A minor gap is the absence of a tool to directly apply optimizations (e.g., modify configs), but the existing tools enable identification and manual fixes.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      MCP server for Xcode build automation and log parsing that opens Xcode projects, triggers builds directly in Xcode, and parses build logs to extract errors and warnings.
      26
      78 npm
      59
      Apache 2.0
    • A
      license
      Not graded
      quality
      D
      maintenance
      An MCP server that enables AI assistants to parse Xcode and Swift build outputs into structured, token-efficient formats like JSON or TOON. It provides tools for executing build commands and extracting detailed diagnostic information such as errors, warnings, and test failures.
      8
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      MCP server for interacting with Xcode build tools, iOS Simulator, and Apple notarization services.
      7 npm
      5
      MIT