Xcode MCP Server
Facilitates iOS app development by providing build and test capabilities for iOS simulator targets, with default configuration for iPhone 15 Pro simulator.
Enables building and testing Xcode projects with the ability to specify schemes, configurations, and destinations. Supports running specific tests, generating code coverage reports, and accessing build and test logs.
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 MCP Server run tests for the LoginTests scheme in my project"
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 MCP Server
The Xcode MCP Server provides a Model Context Protocol interface for building and testing Xcode projects. It enables AI assistants to directly trigger builds, run tests, monitor progress, and access logs through a standardized interface.
Features
Build Xcode projects with custom schemes and configurations
Run unit tests with granular control (run specific tests or skip tests)
Generate code coverage reports
Stream build and test logs in real-time
Access detailed build and test reports
JSON-formatted output
Automatic log persistence
Related MCP server: sl-test
Requirements
Node.js 16+
Xcode Command Line Tools
TypeScript
MCP-compatible client (e.g., Claude Desktop)
Installation
# Clone the repository
git clone https://github.com/PolarVista/Xcode-mcp-server.git
cd xcode-mcp-server
# Install dependencies
npm install
# Build the server
npm run buildUsage with Claude Desktop
Start the server:
npm run start /path/to/build/logs/directoryIn Claude Desktop settings:
"command": "node", "args": ["/path/to/the/xcode-mcp-server/build/index.js", "/path/to/your/project/folder"], "env": { "PATH": "/usr/bin:/bin:/usr/local/bin:/usr/sbin:/sbin" }
Available Tools
build_project
Builds an Xcode project with specified parameters.
Parameters:
projectPath(required): Path to the .xcodeproj or .xcworkspacescheme(required): Build scheme nameconfiguration(optional): Build configuration (Debug/Release, defaults to Debug)destination(optional): Build destination (defaults to "platform=iOS Simulator,name=iPhone 15 Pro")
Example usage in Claude:
build_project({
projectPath: "/path/to/Project.xcodeproj",
scheme: "MyApp",
configuration: "Debug"
})run_tests
Runs unit tests with optional filtering.
Parameters:
projectPath(required): Path to the .xcodeproj or .xcworkspacescheme(required): Test scheme nametestIdentifier(optional): Specific test to run (e.g., 'MyTests/testExample')skipTests(optional): Array of test identifiers to skipconfiguration(optional): Build configuration (Debug/Release, defaults to Debug)destination(optional): Test destination (defaults to "platform=iOS Simulator,name=iPhone 15 Pro")
Example usage in Claude:
run_tests({
projectPath: "/path/to/Project.xcodeproj",
scheme: "MyAppTests",
testIdentifier: "LoginTests/testSuccessfulLogin",
skipTests: ["PerformanceTests/testLargeDataLoad"],
configuration: "Debug"
})Logs
All logs are stored in the specified base directory under
build-logs/Build operations create:
Plain text log (
build-[timestamp].log)JSON-formatted log (
build-[timestamp].log.json)Xcode report (
report-[timestamp].txt)
Test operations create:
Test log (
test-[timestamp].log)JSON-formatted log (
test-[timestamp].log.json)Test report (
test-report-[timestamp].txt)Code coverage report (
coverage-[timestamp].txt)
Latest log (build or test) is accessible via the
xcode-build://latest-logresource
Available Tools
18 toolsanalyze_fileB
Analyzes a source file for potential issues using Xcode's static analyzer.
Inputs: filePath (required).
boot_simulatorC
Boots an iOS simulator identified by its UDID.
Inputs: udid (required).
build_projectC
Builds the active Xcode project using the specified configuration and scheme.
Inputs: configuration (required), scheme (required).
compile_asset_catalogC
Compiles an asset catalog using 'actool'.
Inputs: catalogPath (required), outputDir (required).
get_active_projectB
Retrieves detailed information about the currently active Xcode project.
Inputs: no named parameters.
list_directoryC
Lists the contents of a directory, showing both files and subdirectories.
Inputs: path (required).
list_project_filesC
Lists all files within an Xcode project.
Inputs: projectPath (required), fileType.
list_simulatorsA
Lists all available iOS simulators with their details by invoking 'xcrun simctl list --json'.
Inputs: no named parameters.
read_fileC
Reads the contents of a file within the active Xcode project.
Inputs: filePath (required).
run_lldbC
Launches the LLDB debugger with custom arguments.
Inputs: lldbArgs.
run_testsC
Executes tests for the active Xcode project.
Inputs: testPlan.
run_xcrunC
Executes a specified Xcode tool via 'xcrun'.
Inputs: tool (required), arguments.
set_project_pathC
Sets the active Xcode project by specifying the path to its .xcodeproj directory.
Inputs: projectPath (required).
set_projects_base_dirC
Sets the base directory where your Xcode projects are stored.
Inputs: baseDir (required).
shutdown_simulatorA
Shuts down an active iOS simulator using its UDID.
Inputs: udid (required).
swift_package_updateA
Updates the dependencies of your Swift project using Swift Package Manager by invoking 'swift package update'.
Inputs: no named parameters.
trace_appC
Captures a performance trace of an application using 'xctrace'.
Inputs: appPath (required), duration.
write_fileB
Writes or updates the content of a file in the active Xcode project.
Inputs: filePath (required), content (required), createIfMissing.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 18 tools
Most tools have distinct purposes, but there is some overlap between list_directory and list_project_files, as both list files, though one is general and the other project-specific. Tools like analyze_file and trace_app are clearly differentiated for static analysis vs. performance tracing.
All tool names follow a consistent verb_noun pattern using snake_case, such as analyze_file, boot_simulator, and build_project. There are no deviations in naming style, making the set predictable and easy to parse.
With 18 tools, the count is slightly high but reasonable for an Xcode server covering project management, building, testing, debugging, and simulator operations. It might feel a bit heavy, but each tool appears to serve a specific function in the domain.
The toolset provides good coverage for Xcode workflows, including project setup, building, testing, debugging, and simulator control. Minor gaps might include tools for code signing or managing provisioning profiles, but core operations are well-represented.
Maintenance
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
A Model Context Protocol server for Wix AI tools
The Buildkite MCP server exposes Buildkite product data (pipelines, builds, jobs, and test data) to AI tools, editors, and agents through the Model Context Protocol. It provides capabilities including pipeline creation and management, build monitoring with specialized tools like 'wait_for_build', efficient log querying using Apache Parquet conversion and caching, and OAuth-based authentication for both read-write and read-only access to Buildkite's REST API.
MCP server for building and testing AI agents with multi-model experimentation and insights.
Related MCP Servers
- AlicenseDqualityDmaintenanceA Model Context Protocol server that provides tools for Xcode-related operations, making it easier to work with iOS project management, building, testing, archiving, and deploying apps to both simulators and physical devices.912 npm9MIT
- AlicenseBqualityDmaintenanceA Model Context Protocol (MCP) server that provides Xcode-related tools for integration with AI assistants and other MCP clients.541MIT
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that enables AI assistants to interact with iOS simulators, perform accessibility testing, manage apps, and automate complex iOS workflows.32Apache 2.0
- AlicenseNot gradedqualityDmaintenanceAn 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.8MIT