Connects to Xcode's build system to extract, parse, and display errors and warnings from your Swift projects, helping AI assistants quickly identify code issues without manually searching through build logs.
An MCP (Model Control Protocol) plugin for extracting and viewing errors and warnings from Xcode build logs.
This plugin implements the Model Control Protocol (MCP) specification to provide Xcode diagnostics functionality to any compatible AI assistants. It connects to Xcode's build system to extract, parse, and display diagnostics (errors and warnings) from your Swift projects. It helps AI assistants quickly identify issues in your code without having to manually search through build logs.
Note that since this works at the log level, Xcode must have already attempted a build before you run this tool.
The simplest way to install the Xcode Diagnostics MCP plugin:
pip install mcp-xcode-diagnostics
You can install directly from GitHub:
pip install git+https://github.com/leftspin/mcp-xcode-diagnostics.git
To install from source:
cd mcp-xcode-diagnostics pip install .
The plugin can now be used with any MCP-compatible client.
The plugin can detect and display various types of Xcode diagnostics including:
The plugin provides two main MCP tools:
Lists all Xcode projects with build logs in the DerivedData directory.
Parameters: None
Gets diagnostic information from the latest build log of a specific project.
Parameters:
project_dir_name
: Directory name of the project in DerivedData (e.g., 'ProjectName-hash')include_warnings
: Whether to include warnings in addition to errors (default: True)For debugging purposes, the plugin saves raw log output to:
/tmp/xcode-mcp-debug.log
- Main application logs/tmp/xcode-diagnostic-raw.log
- Raw output from Xcode activity logs{ "success": true, "log_file": "/path/to/build.xcactivitylog", "timestamp": "2025-03-11T12:34:56.789", "errors": [ { "type": "error", "message": "use of unresolved identifier 'NonExistentType'", "file_path": "/path/to/MyFile.swift", "line_number": 42, "column": 15, "code": " let x: NonExistentType = value", "notes": [] } ], "warnings": [ { "type": "warning", "message": "static property 'sharedInstance' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode", "file_path": "/path/to/SharedManager.swift", "line_number": 10, "column": 16, "code": " static var sharedInstance: SharedManager?", "notes": [ { "type": "note", "message": "convert 'sharedInstance' to a 'let' constant to make 'Sendable' shared state immutable", "file_path": "/path/to/SharedManager.swift", "line_number": 10, "column": 16 } ] } ], "error_count": 1, "warning_count": 1 }
The plugin includes a test suite to verify parsing functionality:
# Run all tests python -m unittest test_xcode_diagnostics.py
This project is available under the MIT License.
Discover shared experiences
Shared threads will appear here, showcasing real-world applications and insights from the community. Check back soon for updates!