xcode-analyzer-mcp
Analyzes CocoaPods dependency trees by parsing Podfile.lock, showing direct and transitive dependencies alongside SPM dependencies.
Performs static analysis of Xcode projects: parses project.pbxproj for target/framework dependencies, DerivedData .xcactivitylog files for build timing, and Package.swift/Package.resolved for SPM dependencies, without requiring Xcode or a build.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@xcode-analyzer-mcp check for circular dependencies in my project at ~/MyApp"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
xcode-analyzer-mcp
MCP server for analyzing Xcode project dependencies, build times, and code health.
An AI-powered static analysis tool for iOS/macOS projects that works with Claude Code and other MCP-compatible clients.
Features
Circular Dependency Detection — Tarjan's SCC algorithm on module/file-level dependency graphs
Build Time Analysis — Parse DerivedData build logs or estimate complexity heuristically
Import Dependency Graph — Visualize module dependencies as Mermaid diagrams, DOT, or adjacency lists
Unused Import Detection — Heuristic analysis with built-in symbol database for 20+ popular iOS frameworks
Dependency Tree — SPM (Package.resolved) and CocoaPods (Podfile.lock) tree analysis
Large File Detection — Find images, videos, fonts, and other resources impacting app size
Related MCP server: Xcode MCP Server
Quick Start
With Claude Code
claude mcp add xcode-analyzer -- npx -y xcode-analyzer-mcpWith Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"xcode-analyzer": {
"command": "npx",
"args": ["-y", "xcode-analyzer-mcp"]
}
}
}Manual Installation
npm install -g xcode-analyzer-mcpAvailable Tools
analyze_circular_dependencies
Detect circular dependencies between modules or files.
Parameter | Type | Description |
| string (required) | Path to Xcode project root |
| "module" | "file" | Analysis granularity (default: module) |
| string[] | Glob patterns to exclude |
analyze_build_time
Analyze build times from DerivedData logs or estimate via static analysis.
Parameter | Type | Description |
| string (required) | Path to Xcode project root |
| string | Custom DerivedData path |
| string | Xcode scheme name |
| number | Top N slowest files (default: 20) |
| number | Minimum duration filter |
analyze_import_graph
Build and visualize module dependency graph from Swift imports.
Parameter | Type | Description |
| string (required) | Path to Xcode project root |
| "adjacency_list" | "matrix" | "mermaid" | "dot" | Output format |
| boolean | Include UIKit, Foundation, etc. |
| string[] | Glob patterns to exclude |
detect_unused_imports
Find potentially unused Swift import statements.
Parameter | Type | Description |
| string (required) | Path to Xcode project root |
| string[] | Specific paths to analyze |
| "high" | "medium" | "low" | Detection confidence filter |
| string[] | Glob patterns to exclude |
analyze_dependency_tree
Analyze SPM and CocoaPods dependency trees.
Parameter | Type | Description |
| string (required) | Path to Xcode project root |
| "spm" | "cocoapods" | "auto" | Package manager (default: auto) |
| boolean | Show transitive deps (default: true) |
detect_large_files
Find large files impacting app bundle size.
Parameter | Type | Description |
| string (required) | Path to Xcode project root |
| number | Minimum size in KB (default: 500) |
| string[] | File types: images, videos, fonts, json, plists, xcassets, storyboards, all |
| boolean | Analyze .xcassets individually |
Usage Examples
Once connected, ask Claude:
"프로젝트에 순환 참조 있는지 확인해줘"
"빌드 시간 가장 오래 걸리는 파일 top 10 보여줘"
"의존성 그래프를 Mermaid 다이어그램으로 보여줘"
"사용 안 하는 import 찾아줘"
"SPM 의존성 트리 보여줘"
"500KB 넘는 파일들 찾아줘"
How It Works
This tool performs static analysis only — no compilation or Xcode required. It parses:
.swiftfiles for import statementsPackage.swiftfor SPM target dependenciesPackage.resolvedfor resolved SPM versionsPodfile.lockfor CocoaPods dependency tree.pbxprojfor Xcode target/framework dependencies.xcactivitylogfor build timing data (from DerivedData)
Tech Stack
TypeScript + Node.js 18+
@modelcontextprotocol/sdk— MCP server frameworkfast-glob— File system scanningzod— Input validationZero runtime dependencies beyond these 3 packages
Development
git clone https://github.com/user/xcode-analyzer-mcp
cd xcode-analyzer-mcp
npm install
npm run dev # Watch mode
npm run build # Production build
npm test # Run testsLicense
MIT
Available Tools
8 toolsanalyze_build_timeA
Analyze Xcode build times from DerivedData build logs. Shows slowest files and modules. Falls back to static complexity analysis if no build logs are found.
Inputs: projectPath (required), topN, scheme, thresholdMs, +1 more.
analyze_circular_dependenciesB
Detect circular dependencies between modules/files in an Xcode project using Tarjan's SCC algorithm. Analyzes Package.swift targets and Swift import statements.
Inputs: projectPath (required), level, excludePatterns.
analyze_dependency_treeA
Analyze SPM (Package.resolved) and CocoaPods (Podfile.lock) dependency trees. Shows direct and transitive dependencies, version info, and tree structure.
Inputs: projectPath (required), packageManager, showTransitive.
analyze_import_graphB
Build a module dependency graph from Swift import statements. Shows fan-in/fan-out statistics and can output as adjacency list, matrix, Mermaid diagram, or DOT/Graphviz format.
Inputs: projectPath (required), outputFormat, excludePatterns, includeSystemFrameworks.
detect_large_filesA
Find large files and resources in the project that impact app size. Scans images, videos, fonts, JSON, xcassets, and other file types.
Inputs: projectPath (required), categories, thresholdKB, checkXcassets.
detect_retain_cyclesA
Detect potential memory leaks and retain cycles in Swift code. Finds: missing [weak self] in closures, strong delegates, Timer retain cycles, NotificationCenter leaks, ViewModel↔ViewController strong references, and stored closure properties.
Inputs: projectPath (required), targetPaths, excludePatterns.
detect_unused_importsB
Detect potentially unused Swift import statements using heuristic analysis. Checks against a built-in symbol database for popular iOS frameworks (UIKit, RxSwift, SnapKit, etc.).
Inputs: projectPath (required), confidence, targetPaths, excludePatterns.
fix_retain_cyclesA
Automatically fix common retain cycle patterns: add weak to delegates, add [weak self] + guard let self to closures, add removeObserver in deinit. Defaults to dry-run mode (preview only). Set dryRun to false to apply changes.
Inputs: projectPath (required), dryRun, categories, targetPaths, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
Most tools are clearly distinct by resource and action, with the detect/fix retain-cycle pair being obviously related. There is some conceptual overlap among analyze_circular_dependencies, analyze_import_graph, and analyze_dependency_tree, though the descriptions distinguish module cycles, import graphs, and external package trees.
All tool names use consistent snake_case verb_noun phrasing with clear action verbs such as analyze_, detect_, and fix_. The pattern is predictable throughout the set.
Eight tools is well-scoped for an Xcode project analyzer, covering distinct analysis areas without obvious filler. Each tool appears to earn its place.
The surface covers major project-health areas: dependencies, imports, build performance, file size, and memory/retain cycles. Remediation is limited to retain cycles, so other detected issues remain report-only, but core workflows are covered.
Maintenance
Related MCP Connectors
Build, test and cache insights for Xcode, Gradle and Bazel projects, for coding agents.
AI-powered codebase analysis — call graphs, security, dead code, complexity. 150+ tools.
Stateless TS/JS compiler facts for agents: references, imports, impact. No repo index or OAuth.
Codebase intelligence for AI agents — dead code, blast radius, ownership.
Related MCP Servers
- AlicenseBqualityDmaintenanceProvides programmatic access to Xcode functionality, enabling AI assistants to create, build, test, and manage iOS/macOS projects directly.336MIT
- AlicenseAqualityDmaintenanceEnables AI assistants to manage Xcode projects by listing targets, reading configurations, and triggering builds via the Model Context Protocol. It facilitates natural language interaction with macOS developer tools to streamline iOS app development processes.6MIT
- AlicenseBqualityBmaintenanceEnables AI coding agents to perform zero-execution, AST-based static analysis of JavaScript/TypeScript codebases, including symbol lookup, dependency tracing, change-impact analysis, dead-code detection, and risk assessment.8MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to analyze local source code, build and query a dependency graph, and suggest skeleton structures for new modules based on existing architectural patterns and conventions.MIT