xcode-mcp-server (drewster99)
This MCP server enables AI assistants to control and interact with Xcode for Apple platform development, covering the full development lifecycle from project discovery to building, testing, and debugging.
Project Discovery & Navigation
Find
.xcodeprojand.xcworkspacefiles, including recently opened projectsBrowse directory trees and list directory contents with metadata (size, modification time, type)
Build Management
Build projects/workspaces with configurable timeout and error/warning filtering
Retrieve errors and warnings from the last build, or aggregate results across incremental builds (avoids missing warnings from unchanged files)
Clean projects and stop in-progress builds or runs
Running Applications
Interactive: Launch app and display an alert dialog; stops when user clicks "finished"
Monitored: Launch and wait for natural termination (up to a timeout)
Unmonitored: Launch and return immediately; retrieve console logs later
Testing
List all available test identifiers in a project
Run the test suite and get structured results (pass/fail/skip counts, failure messages)
Retrieve results from the most recent test run without re-running
Simulator & Device Management
List booted simulators and available run destinations (devices/simulators) for a scheme
Set or get the active run destination for a project
Screenshots
Capture Xcode windows, booted iOS simulator screens, or any macOS window by ID or name
Capture all windows for a given macOS app by name
macOS App Introspection
List all running macOS applications and enumerate on-screen windows with their IDs
Project Creation
Scaffold a new SwiftUI app project for iOS or macOS with configurable bundle ID and deployment target
Security
Restrict accessible folders via environment variable or command-line arguments
Enables AI assistants to control and interact with Xcode projects, including building and running projects, retrieving build errors, getting project hierarchy, cleaning projects, and accessing runtime output.
Click on "Install 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 (drewster99)build the project at /Users/me/Documents/MyApp.xcodeproj"
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.
Drew's Xcode MCP Server (drews-xcode-mcp)
An MCP (Model Context Protocol) server that enables AI assistants to control and interact with Xcode for Apple platform development.
Renamed from
xcode-mcp-server. With several unrelated projects sharing that name — and Xcode itself now shipping a built-in MCP server — this project is nowdrews-xcode-mcp. Existing setups keep working: the old PyPI name is a compatibility package that forwards to this one, and all settings carry over. When convenient, update your MCP configuration to rundrews-xcode-mcp. If your server key/name is the old defaultxcode-mcp-server, we recommend renaming it todrews-xcode-mcptoo — just remember to update any tool permission allowlists referencing the old tool names (mcp__xcode-mcp-server__*becomesmcp__drews-xcode-mcp__*). If you chose a custom key, keep it and tool permissions are unaffected.
What It Does
This server allows AI assistants (like Claude, Cursor, or other MCP clients) to:
Discover and navigate your Xcode projects and source files
Build and run iOS, macOS, tvOS, and watchOS applications
Execute and monitor tests with detailed results
Debug build failures by retrieving errors and warnings
Capture console output from running applications
Take screenshots of Xcode windows and iOS simulators
Manage simulators and view their status
The AI can perform complete development workflows - from finding a project, to building it, running tests, debugging failures, and capturing results.
Related MCP server: Xcode Diagnostics MCP Plugin
Requirements
macOS - This server only works on macOS
Xcode - Xcode must be installed
Python 3.10+ - For running the server (uvx will fetch a compatible Python automatically if your system Python is older)
Security
The server implements path-based security to control which directories are accessible:
With restrictions: Set
XCODEMCP_ALLOWED_FOLDERS=/path1:/path2:/path3to limit access to specific directoriesDefault: If not specified, allows access to your home directory (
$HOME)
Security requirements:
All paths must be absolute (starting with
/)No
..path components allowedAll paths must exist and be directories
Setup
First, ensure uv is installed (required for all methods below):
which uv || brew install uv1. Claude Code (Recommended)
claude mcp add --scope user --transport stdio -- drews-xcode-mcp `which uvx` drews-xcode-mcpTo run a specific version, use:
# Example: How to run v1.3.0b6
claude mcp add --scope user --transport stdio -- drews-xcode-mcp `which uvx` drews-xcode-mcp==1.3.0b6That's it! Claude Code handles the rest automatically.
2. Claude Desktop
Edit your Claude Desktop config file (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"drews-xcode-mcp": {
"command": "uvx",
"args": [
"drews-xcode-mcp"
]
}
}
}If you'd like to allow only certain projects or folders to be accessible by drews-xcode-mcp, add the env option, with a colon-separated list of absolute folder paths, like this:
{
"mcpServers": {
"drews-xcode-mcp": {
"command": "uvx",
"args": [
"drews-xcode-mcp"
],
"env": {
"XCODEMCP_ALLOWED_FOLDERS": "/Users/andrew/my_project:/Users/andrew/Documents/source"
}
}
}
}3. Cursor AI
In Cursor: Settings → Tools & Integrations → + New MCP Server
Or edit ~/.cursor/mcp.json directly:
{
"mcpServers": {
"drews-xcode-mcp": {
"command": "uvx",
"args": ["drews-xcode-mcp"]
}
}
}Optional: Add folder restrictions with an env section (same format as Claude Desktop above).
Usage
Once configured, simply ask your AI assistant to help with Xcode tasks:
"Find all Xcode projects in my home directory"
"Build the project at /path/to/MyProject.xcodeproj"
"Run tests for this project and show me any failures"
"What are the build errors in this project?"
"Show me the directory structure of this project"
"Take a screenshot of the Xcode window"
Most tools work with paths to .xcodeproj or .xcworkspace files, or with regular directory paths for browsing and navigation.
Advanced Configuration
Command Line Arguments
When running the server directly (for development or custom setups), these options are available:
Build output control:
--no-build-warnings- Show only errors, exclude warnings--always-include-build-warnings- Always show warnings (default)
Notifications:
--show-notifications- Enable macOS notifications for operations--hide-notifications- Disable notifications (default)
Access control:
--allowed /path- Add allowed folder (can be repeated)
Example:
drews-xcode-mcp --no-build-warnings --show-notifications --allowed ~/ProjectsNote: When using MCP clients (Claude, Cursor), configure these via the env section in your client's config file instead.
Development
The server is built with FastMCP and uses AppleScript to communicate with Xcode.
Local Testing
Test with MCP Inspector:
export XCODEMCP_ALLOWED_FOLDERS=~/Projects
mcp dev drews_xcode_mcp/__main__.pyThis opens an inspector interface where you can test tools directly. Provide paths as quoted strings: "/Users/you/Projects/MyApp.xcodeproj"
Limitations
AppleScript syntax may need adjustments for specific Xcode versions
Some operations require the project to be open in Xcode first
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/drewster99/drews-xcode-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server