drews-xcode-mcp
v1.3.31Drew's MCP server for Xcode integration
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
version
Get the current version of the Xcode MCP Server. Returns: The version string of the server. When running from a source checkout (the local dev server), a "dev source <hash>" suffix identifies the exact source the process loaded, so you can confirm the running server matches the code you just edited.
get_xcode_projects
Find Xcode projects and workspaces, grouped by how ready they are to build. Returns JSON grouped into three categories: - currently_open: projects open in Xcode right now, with their current scheme and run destination, and exact ready-to-call commands to build or build-and-run. Always returned in full -- never truncated by max_results. - recent: projects from Xcode's recent-documents list that are not currently open, with their available schemes. - other_projects: everything else found by a filesystem search. recent and other_projects together…
| Parameter | Type | Description |
|---|---|---|
max_results | integer | Maximum combined number of recent + other_projects entries to return (default: 10) |
max_search_depth | integer | Maximum directory depth from search path (default: 3) Depth 0 = directly in search path, depth 1 = one level down, etc. |
regex_filter | string | Optional regex pattern to filter results |
search_path | string | Path to search for other_projects. If empty, searches all allowed folders. |
get_directory_tree
Get a visual tree of directories (folders only) in the specified path. Shows the folder structure as a tree diagram with box-drawing characters. Does not include individual files - use get_directory_listing for file details. Special behavior: If directory_path ends with .xcodeproj or .xcworkspace, the tree will show the parent directory structure (since these are typically at the root of a project folder). Args: directory_path: Path to directory to scan. Can also be a .xcodeproj or .xcworkspace path (will scan parent directory in t…
| Parameter | Type | Description |
|---|---|---|
directory_path * | string | Path to directory to scan. Can also be a .xcodeproj or .xcworkspace path (will scan parent directory in that case). |
max_depth | integer | Maximum recursion depth (default 4, prevents excessive output). Depth 1 = immediate subdirectories only, Depth 4 = up to 4 levels deep. |
get_directory_listing
List contents of a directory with file metadata. Args: directory_path: Path to directory to list regex_filter: Optional regex to filter filenames (applied to basename only) sort_by: Sort by "time" (modification time) or "name" (alphabetical). Default: "time" reverse: Reverse sort order. Default: True (most recent first / Z-A) max_results: Maximum entries to return (default 50, hard limit 100) Returns: Formatted listing with: name, type (file/dir), size, modified time. Default behavior: 50 most recently modified files/folder…
| Parameter | Type | Description |
|---|---|---|
directory_path * | string | Path to directory to list |
max_results | integer | Maximum entries to return (default 50, hard limit 100) |
regex_filter | Optional regex to filter filenames (applied to basename only) | |
reverse | boolean | Reverse sort order. Default: True (most recent first / Z-A) |
sort_by | string | Sort by "time" (modification time) or "name" (alphabetical). Default: "time" |
get_project_schemes
Get the available build schemes for the specified Xcode project or workspace. Args: project_path: Path to an Xcode project/workspace directory, which must end in '.xcodeproj' or '.xcworkspace' and must exist. Returns: A newline-separated list of scheme names, with the active scheme listed first. If no schemes are found, returns an empty string.
| Parameter | Type | Description |
|---|---|---|
project_path * | string | Path to an Xcode project/workspace directory, which must end in '.xcodeproj' or '.xcworkspace' and must exist. |
build_project
Build the specified Xcode project or workspace. Builds run for up to `timeout` seconds (default 600, i.e. 10 minutes) before timing out, which guards against a build that hangs indefinitely. Raise it for large projects whose cold build exceeds the default. Args: project_path: Path to an Xcode project or workspace directory. scheme: Name of the scheme to build. If not provided, uses the active scheme. include_warnings: Include warnings in build output. If not provided, uses global setting. regex_filter: Optional regex to filter error/warnin…
| Parameter | Type | Description |
|---|---|---|
project_path * | string | Path to an Xcode project or workspace directory. |
include_warnings | Include warnings in build output. If not provided, uses global setting. | |
max_lines | integer | Maximum number of error/warning lines to show (default 25) |
regex_filter | Optional regex to filter error/warning lines | |
scheme | Name of the scheme to build. If not provided, uses the active scheme. | |
timeout | Maximum seconds to wait for the build to complete. If not provided, defaults to 600. Must be a positive integer. |
run_project_with_user_interaction
Run the app and display an alert dialog for you to interact with it. The app will run in Xcode/Simulator. Once confirmed running, an alert dialog will appear with an "I'm finished - Terminate App" button. - Click the button when you're done testing → app will be force-stopped - If the app terminates on its own → no force-stop needed In either case, runtime logs are extracted and returned after a 2-second wait. Perfect for: Interactive testing, manual QA, debugging UI flows Args: project_path: Path to an Xcode project/workspace directory…
| Parameter | Type | Description |
|---|---|---|
project_path * | string | Path to an Xcode project/workspace directory |
max_lines | integer | Maximum number of matching lines to return (default 20) |
regex_filter | Optional regex pattern to find matching lines in the output | |
scheme | Optional scheme to run. If not provided, uses the active scheme. |
run_project_until_terminated
Run the app and wait for it to terminate naturally (up to `timeout` seconds). The app will run in Xcode/Simulator. If it doesn't terminate within `timeout` seconds (default 600, i.e. 10 minutes), it will be force-stopped and runtime logs will be extracted. No user interaction required - fully automated. Perfect for: Automated tests, CLI tools, apps with defined exit points Args: project_path: Path to an Xcode project/workspace directory scheme: Optional scheme to run. If not provided, uses the active scheme. regex_filter: Optional regex…
| Parameter | Type | Description |
|---|---|---|
project_path * | string | Path to an Xcode project/workspace directory |
max_lines | integer | Maximum number of matching lines to return (default 20) |
regex_filter | Optional regex pattern to find matching lines in the output | |
scheme | Optional scheme to run. If not provided, uses the active scheme. | |
timeout | Maximum seconds to wait for the app to terminate before force-stopping it. If not provided, defaults to 600. Must be a positive integer. |
run_project_unmonitored
Build the project, then launch the app in Xcode and return without waiting for it to finish. The app will continue running until you stop it manually in Xcode. No runtime monitoring, no automatic termination, no log extraction. Use get_runtime_output later (after manual termination) to retrieve logs. Perfect for: Long-running apps, servers, apps needing extended manual testing If the build fails the app is not launched, and structured build errors are returned in the same JSON shape build_project produces. Args: project_path: Path to an Xcode p…
| Parameter | Type | Description |
|---|---|---|
project_path * | string | Path to an Xcode project/workspace directory |
include_warnings | Include warnings in build output when the build fails. If not provided, uses the global setting. | |
max_lines | integer | Maximum number of error/warning lines to show (default 25) |
scheme | Optional scheme to run. If not provided, uses the active scheme. | |
timeout | Maximum seconds to wait for the build before giving up. If not provided, defaults to 600. Must be a positive integer. This bounds the build only — the app itself is never waited on. |
get_build_errors
Get the build errors from the last build for the specified Xcode project or workspace. Args: project_path: Path to an Xcode project or workspace directory. include_warnings: Include warnings in output. If not provided, uses global setting. regex_filter: Optional regex to filter error/warning lines max_lines: Maximum number of error/warning lines to show (default 25) Returns: If no build has been performed: Returns plain text message. Otherwise, returns JSON string with format: { "full_log_path": "~/Library/Cache…
| Parameter | Type | Description |
|---|---|---|
project_path * | string | Path to an Xcode project or workspace directory. |
include_warnings | Include warnings in output. If not provided, uses global setting. | |
max_lines | integer | Maximum number of error/warning lines to show (default 25) |
regex_filter | Optional regex to filter error/warning lines |
clean_project
Clean the specified Xcode project or workspace. Args: project_path: Path to an Xcode project/workspace directory. timeout: Maximum seconds to wait for the clean to complete. If not provided, defaults to 600. Must be a positive integer. Returns: Output message
| Parameter | Type | Description |
|---|---|---|
project_path * | string | Path to an Xcode project/workspace directory. |
timeout | Maximum seconds to wait for the clean to complete. If not provided, defaults to 600. Must be a positive integer. |
stop_project
Stop the currently running build or run operation for the specified Xcode project or workspace. Args: project_path: Path to an Xcode project/workspace directory, which must end in '.xcodeproj' or '.xcworkspace' and must exist. Returns: A message indicating whether the stop was successful
| Parameter | Type | Description |
|---|---|---|
project_path * | string | Path to an Xcode project/workspace directory, which must end in '.xcodeproj' or '.xcworkspace' and must exist. |
get_runtime_output
Fetches and returns the most relevant runtime console output from the project's most recent run. Output becomes available 2 seconds after the app terminates. Args: project_path: Path to an Xcode project (`*.xcproject`) or workspace (`*.xcworkspace`) regex_filter: Optional regex pattern to find matching lines in the output max_lines: Maximum number of matching lines to return (default 20) Returns: JSON string with structured console output including errors, warnings, context, and full_log_path pointing to the complete unfiltered pl…
| Parameter | Type | Description |
|---|---|---|
project_path * | string | Path to an Xcode project (`*.xcproject`) or workspace (`*.xcworkspace`) |
max_lines | integer | Maximum number of matching lines to return (default 20) |
regex_filter | Optional regex pattern to find matching lines in the output |
list_booted_simulators
List all currently booted iOS, iPadOS, tvOS, and watchOS simulators. Returns: A formatted list of booted simulators with their names, UDIDs, and OS versions. Returns "No booted simulators found" if none are running.
take_xcode_screenshot
Take a screenshot of the Xcode window for the specified project. Args: project_path: Path to an Xcode project/workspace directory. Returns: The file path to the saved screenshot. Raises: XCodeMCPError: If Xcode window is not found or screenshot fails.
| Parameter | Type | Description |
|---|---|---|
project_path * | string | Path to an Xcode project/workspace directory. |
take_simulator_screenshot
Take a screenshot of a booted iOS simulator. Args: udid: UDID (device identifier) of the simulator to screenshot, exactly as reported by `list_booted_simulators` (for example "D9A710C8-CEF1-4C5B-8CCA-0CB97DCABE2C"). May be omitted only when a single simulator is booted; when several are booted it is required, and the call fails listing the candidates rather than guessing. Returns: The file path to the saved screenshot. Raises: XCodeMCPError: If no booted simulators found, if `udid` was omitted w…
| Parameter | Type | Description |
|---|---|---|
udid | UDID (device identifier) of the simulator to screenshot, exactly as reported by `list_booted_simulators` (for example "D9A710C8-CEF1-4C5B-8CCA-0CB97DCABE2C"). May be omitted only when a single simulat… |
list_running_mac_apps
List all currently running macOS applications. Returns: A formatted list of running applications with their name, bundle ID, and status flags (frontmost/visible/hidden).
list_mac_app_windows
List all on-screen macOS application windows with their CGWindow IDs. These window IDs can be used to capture screenshots of a given window or app with `take_app_screenshot` or `take_window_screenshot`. Returns: A formatted list of windows grouped by application, including window IDs that can be used with `take_window_screenshot`.
take_window_screenshot
Take a screenshot of a window by ID or name (case-insensitive substring match). Window IDs can be obtained by calling `list_mac_app_windows`, or you can simply pass a partial (or complete) window title, like "News" for the News app. If multiple windows match the provided name, screenshots will be taken for up to the first 5 of them. Note: Only on-screen windows can be found by name. Args: window_id_or_name: Window ID number or partial window title to match. Returns: Path(s) to saved screenshot file(s), one per line if multiple matches. R…
| Parameter | Type | Description |
|---|---|---|
window_id_or_name * | string | Window ID number or partial window title to match. |
take_app_screenshot
Take screenshots of all windows for an app (case-insensitive substring match). If the app has more than one window, screenshots will be taken for up to 5 of them. Note: Only apps with at least one on-screen window can be found by this tool. Args: app_name: Full or partial app name to match. Returns: Path(s) to saved screenshot file(s), one per line (max 5 windows). If multiple apps match, returns an error with the full window list. Raises: XCodeMCPError: If no matching app found, multiple apps match, or screenshot fails.
| Parameter | Type | Description |
|---|---|---|
app_name * | string | Full or partial app name to match. |
list_project_tests
List the tests in an Xcode project or workspace by asking xcodebuild to enumerate them. IMPORTANT: This may take a few minutes on the first call (or after a clean), because xcodebuild must build the project for testing before it can enumerate the tests — there is no accurate way to discover XCTest and Swift Testing tests without building the test bundle. The build reuses Xcode's normal DerivedData, so it is incremental: once built, subsequent calls return in a second or two, and a build the user already did in Xcode is reused rather than repeated. Tests…
| Parameter | Type | Description |
|---|---|---|
project_path * | string | Path to Xcode project/workspace directory. |
scheme | Scheme to enumerate. If not provided, the active scheme (top of Xcode's scheme menu) is used, falling back to the first scheme. | |
timeout | Maximum seconds to wait for the build-for-testing plus enumeration. If not provided, defaults to 600 (10 minutes). Raise it for large projects whose first build exceeds the default. |
run_project_tests
Run tests for the specified Xcode project or workspace. Tests run for up to `timeout` seconds (default 600, i.e. 10 minutes) before timing out, which guards against a test run hanging indefinitely. Raise it for large projects whose build-for-testing alone exceeds the default. Args: project_path: Path to Xcode project/workspace directory scheme: Optional scheme to test (uses active scheme if not specified) timeout: Maximum seconds to wait for the build-for-testing plus test run to complete. If not provided, defaults to 600. Must be a po…
| Parameter | Type | Description |
|---|---|---|
project_path * | string | Path to Xcode project/workspace directory |
scheme | Optional scheme to test (uses active scheme if not specified) | |
timeout | Maximum seconds to wait for the build-for-testing plus test run to complete. If not provided, defaults to 600. Must be a positive integer. |
get_latest_test_results
Get the test results from the most recent test run. Args: project_path: Path to Xcode project/workspace directory Returns: JSON with test results or plain text error message. Success format: { "xcresult_path": "...", "summary": {"total_tests": N, "passed": M, "failed": K, "skipped": L}, "failed_tests": [{"test_name": "...", "failure_message": "...", ...}] }
| Parameter | Type | Description |
|---|---|---|
project_path * | string | Path to Xcode project/workspace directory |
debug_list_notification_history
List all notifications that have been posted since the server started. This is a debugging tool to help understand notification behavior. Returns: A formatted list of all notifications with timestamps, titles, messages, and subtitles.
get_build_results
Get aggregated build errors and warnings from all builds since the last clean operation. This tool addresses the issue where incremental builds only show warnings for recompiled files. It parses the build log manifest (LogStoreManifest.plist) and aggregates warnings from all builds since the last clean, excluding warnings from files that were subsequently recompiled. Strategy: 1. Locate the project's DerivedData/Logs/Build directory 2. Parse LogStoreManifest.plist to find all builds since last clean 3. For each build, parse the .xcactivitylog file to extract:…
| Parameter | Type | Description |
|---|---|---|
project_path * | string | Path to an Xcode project or workspace directory |
max_warnings | integer | Maximum number of warnings to show in response (default 50) |
create_project
Create a new Xcode project with a SwiftUI app template. Creates a complete, buildable Xcode project with a SwiftUI app entry point, ContentView, and asset catalog. The project uses the modern Xcode 16+ format (objectVersion 77) with automatic file discovery. Args: parent_directory: Directory where the project folder will be created. Must be within the allowed folders configured for this server. project_name: Name of the project (e.g. "MyApp"). Used for the folder name, target name, and scheme name. platform: Target platform…
| Parameter | Type | Description |
|---|---|---|
parent_directory * | string | Directory where the project folder will be created. Must be within the allowed folders configured for this server. |
project_name * | string | Name of the project (e.g. "MyApp"). Used for the folder name, target name, and scheme name. |
bundle_identifier | string | Bundle identifier (e.g. "com.mycompany.MyApp"). Defaults to "com.example.{ProjectName}". |
deployment_target | string | Minimum deployment target version (e.g. "26.0"). Defaults to "26.0". |
platform | string | Target platform - "ios" or "macos" (case-insensitive). Defaults to "ios". |
list_run_destinations
List available run destinations (devices and simulators) for a project scheme. By default, only destinations the scheme can actually build and run for are returned. xcodebuild also reports destinations whose platform doesn't match the scheme (e.g. every iOS simulator for a macOS-only app); each carries an 'error' explaining the mismatch. Those are excluded unless include_incompatible_destinations is True. Excluding them can drop dozens of simulator entries for a single-platform app. 'arch' is included only on destinations that share an 'id' with another d…
| Parameter | Type | Description |
|---|---|---|
project_path * | string | Path to an Xcode project (.xcodeproj) or workspace (.xcworkspace). |
include_incompatible_destinations | boolean | If True, also include destinations whose platform is incompatible with the scheme (each with an 'error' field describing why). Defaults to False. |
platform | Return only destinations with exactly this platform, as xcodebuild names it (e.g. "macOS", "iOS", "iOS Simulator", "watchOS Simulator"). Case-sensitive; "iOS" does not match "iOS Simulator". An error… | |
scheme | Scheme name to list destinations for. If not provided, uses the first scheme found via xcodebuild. |
set_run_destination
Set the active run destination (device or simulator) in Xcode. Use list_run_destinations to get available destination IDs, then pass the desired 'id' value here to select it. Subsequent build and run operations will target this destination. Args: project_path: Path to an Xcode project (.xcodeproj) or workspace (.xcworkspace). destination_id: The destination identifier (UDID) to select. This must be the 'id' field from list_run_destinations output, for example "E1A98967-DE69-4DF3-8ED4-8715BA6F566C". The destination's 'name' cannot b…
| Parameter | Type | Description |
|---|---|---|
destination_id * | string | The destination identifier (UDID) to select. This must be the 'id' field from list_run_destinations output, for example "E1A98967-DE69-4DF3-8ED4-8715BA6F566C". The destination's 'name' cannot be used… |
project_path * | string | Path to an Xcode project (.xcodeproj) or workspace (.xcworkspace). |
get_active_run_destination
Get the currently active run destination for a project. Returns the device or simulator that Xcode will use for the next build or run operation. This reads from Xcode's workspace state file without opening the project in Xcode. Note: Xcode stores a destination per scheme, and both this tool and set_run_destination resolve the same selected scheme from Xcode's own workspace state. Xcode flushes that state lazily, so set_run_destination waits for the write and reports 'active_destination_confirmed': true when it lands; after a confirmed set this reports the…
| Parameter | Type | Description |
|---|---|---|
project_path * | string | Path to an Xcode project (.xcodeproj) or workspace (.xcworkspace). |