home / mcp / xcf xcode mcp server

XCF Xcode MCP Server

Provides MCP-driven control over Xcode projects, file operations, document handling, and Swift code analysis for streamlined AI-assisted development.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "codefreezeai-xcf": {
      "command": "Applications/xcf.app/Contents/MacOS/xcf",
      "args": [
        "server"
      ],
      "env": {
        "XCODE_PROJECT": "/path/to/project/project.xcodeproj",
        "XCODE_PROJECT_FOLDER": "/path/to/project/"
      }
    }
  }
}

You set up and run the XCF Xcode MCP Server to control and automate your Swift development workflow from your preferred MCP client. This server lets you manage Xcode projects, read and write files, work with documents in Xcode, and analyze Swift code directly from your AI environment with minimal setup and zero dependencies.

How to use

You connect your MCP client to the XCF MCP server to perform actions such as listing open Xcode projects, selecting a project, building, running, and analyzing Swift code. Use the server to read and write files, manage directories, and interact with Xcode documents without leaving your AI IDE. Start by configuring the MCP server in your client, then issue commands like show, open, build, run, and various file and document operations. Use the analysis tools to inspect Swift code for style, complexity, and potential bugs, and leverage the snippet and analyzer features to extract code snippets or analyze code ranges.

How to install

Prerequisites: ensure you have the macOS environment ready for running a Swift-based MCP server. You will install the XCF app, then configure it in your MCP setup.

Step 1: Download the XCF application and move it to your /Applications folder.

Step 2: Launch the application to approve the internet download.

Step 3: You will see an alert confirming the server is ready once the approval completes.

Step 4: If no alert appears, you may need to fix codesigning with the following command and try launching again.

codesign --force --deep --sign - /Applications/xcf.app

Minimum setup and configuration

Add XCF as a MCP server in your configuration so your AI tools can communicate with it.

{
  "mcpServers": {
    "xcf": {
      "type": "stdio",
      "command": "Applications/xcf.app/Contents/MacOS/xcf",
      "args": ["server"]
    }
  }
}

Configuration locations

Store the MCP config in these locations depending on your environment.

Cursor: ~/.cursor/mcp.json

Claude Desktop: ~/Library/Application Support/Claude/claude_desktop_config.json

Available tools

mcp_xcf_snippet

Extract code snippets from a file or range, usable by human or AI assistants.

mcp_xcf_analyzer

Analyze Swift code for potential issues, such as style deviations, high complexity, and unused symbols.

mcp_xcf_read_file

Read contents of a file from the workspace.

mcp_xcf_write_file

Write content to a file in the workspace.

mcp_xcf_edit_file

Edit specific lines in a file with a replacement block.

mcp_xcf_open_doc

Open a document in Xcode for reading or editing.

mcp_xcf_save_doc

Save changes to an open Xcode document.

mcp_xcf_read_dir

List contents of a directory.

mcp_xcf_add_dir

Create a new directory in the workspace.

mcp_xcf_rm_dir

Remove a directory from the workspace.