The xcodeproj-mcp-server is a powerful Model Context Protocol (MCP) server that allows you to programmatically manipulate Xcode project files (.xcodeproj) using Swift. It provides AI assistants and MCP clients with the ability to create, inspect, and modify Xcode projects without directly opening Xcode.
Pull the pre-built Docker image from GitHub Container Registry:
docker pull ghcr.io/giginet/xcodeproj-mcp-server
Configure the MCP server for Claude Code with this command:
# Add MCP server using Docker
claude mcp add xcodeproj -- docker run --rm -i -v $PWD:/workspace ghcr.io/giginet/xcodeproj-mcp-server /workspace
This mounts your current working directory ($PWD
) to /workspace
inside the container, allowing the server to access your Xcode projects.
Add the following to your Claude Desktop configuration file located at ~/Library/Application Support/Claude/claude_desktop_config.json
:
{
"mcpServers": {
"xcodeproj": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"-v",
"${workspaceFolder}:/workspace",
"ghcr.io/giginet/xcodeproj-mcp-server",
"/workspace"
]
}
}
}
The server supports restricting file operations to a specific base directory:
This is particularly useful when running the server in Docker containers or other sandboxed environments.
create_xcodeproj
Parameters:
project_name
- Name of the new projectpath
- Where to create the projectorganization_name
- Organization name for the projectbundle_identifier
- Bundle identifier (e.g., com.example.appname)list_targets
Parameters:
project_path
- Path to the .xcodeproj filelist_build_configurations
Parameters:
project_path
- Path to the .xcodeproj filelist_files
Parameters:
project_path
- Path to the .xcodeproj filetarget_name
- Name of the target to list files forlist_groups
Parameters:
project_path
- Path to the .xcodeproj filetarget_name
(optional) - Filter by target nameadd_file
Parameters:
project_path
- Path to the .xcodeproj filefile_path
- Path to the file to addtarget_name
- Target to add the file togroup_path
- Path of the group to add the file toremove_file
Parameters:
project_path
- Path to the .xcodeproj filefile_path
- Path to the file to removemove_file
Parameters:
project_path
- Path to the .xcodeproj filesource_path
- Current path of the filedestination_path
- New path for the fileadd_synchronized_folder
Parameters:
project_path
- Path to the .xcodeproj filefolder_path
- Path to the folder to addgroup_name
- Name of the group to createtarget_name
- Target to add the folder tocreate_group
Parameters:
project_path
- Path to the .xcodeproj filegroup_name
- Name of the new groupparent_group_path
- Path of the parent groupadd_target
Parameters:
project_path
- Path to the .xcodeproj filetarget_name
- Name for the new targettype
- Target type (e.g., application, framework)platform
- Platform (e.g., iOS, macOS)bundle_identifier
- Bundle identifier for the targetremove_target
Parameters:
project_path
- Path to the .xcodeproj filetarget_name
- Name of the target to removeduplicate_target
Parameters:
project_path
- Path to the .xcodeproj filesource_target_name
- Name of the target to duplicatenew_target_name
- Name for the duplicated targetadd_dependency
Parameters:
project_path
- Path to the .xcodeproj filetarget_name
- Name of the dependent targetdependency_name
- Name of the target to depend onget_build_settings
Parameters:
project_path
- Path to the .xcodeproj filetarget_name
- Target to get settings forconfiguration_name
- Build configuration (e.g., Debug, Release)set_build_setting
Parameters:
project_path
- Path to the .xcodeproj filetarget_name
- Target to modifysetting_name
- Name of the build settingvalue
- New value for the settingconfiguration_name
- Build configuration to modifyadd_framework
Parameters:
project_path
- Path to the .xcodeproj filetarget_name
- Target to add the framework toframework_name
- Name of the frameworkembed
- Whether to embed the frameworkadd_build_phase
Parameters:
project_path
- Path to the .xcodeproj filetarget_name
- Target to add the phase tophase_type
- Type of build phasename
- Name for the build phasescript
- Script content (for script phases)add_swift_package
Parameters:
project_path
- Path to the .xcodeproj filepackage_url
- URL of the Swift Packagerequirement
- Version requirementtarget_name
- Target to add the package toproduct_name
- Name of the product to uselist_swift_packages
Parameters:
project_path
- Path to the .xcodeproj fileremove_swift_package
Parameters:
project_path
- Path to the .xcodeproj filepackage_url
- URL of the package to removeremove_from_targets
- Whether to remove from all targetsTo add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "xcodeproj" '{"command":"docker","args":["run","--rm","-i","-v","${workspaceFolder}:/workspace","ghcr.io/giginet/xcodeproj-mcp-server","/workspace"]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"xcodeproj": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"-v",
"${workspaceFolder}:/workspace",
"ghcr.io/giginet/xcodeproj-mcp-server",
"/workspace"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"xcodeproj": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"-v",
"${workspaceFolder}:/workspace",
"ghcr.io/giginet/xcodeproj-mcp-server",
"/workspace"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect