XCF Xcode MCP Server
A Swift-based MCP server that integrates with Xcode to enhance AI development workflows.
š XCF Xcode MCP Server
The Swift way to Super Charge your AI Workflow!
šļø New features in 1.0.5!
- ā File & Directory Operations
- ā Scripting Bridge Xcode Doc Operations
- ā Fuzzy Logic Path Resolution
- ā Swift Code Analysis (without building in Xcode)
- ā 21 MCP Tools for Xcode Automation
Speed up writing Xcode apps with xcf, a dead simple Swift-based MCP server designed for Cursor, Claude Code, and VSCode ā no TypeScript, no JavaScript, no BS!
š§° XCF Installation & Configuration
Installation Steps
- Download the XCF application and drag it to your /Applications folder.
- Launch the application to approve the internet download.
- You will see the following alert (this is expected):
- Click the "Press to Quit this XCF Xcode MCP Server" button.
š” Troubleshooting: If XCF doesn't display the alert, run this command:
codesign --force --deep --sign - /Applications/xcf.app
You can also build xcf from source using Xcode. It's 100% Swift and easy to build locally.
š§ Quick Setup
Minimum Requirements:
Add xcf to your MCP configuration file:
{
"mcpServers": {
"xcf": {
"type": "stdio",
"command": "Applications/xcf.app/Contents/MacOS/xcf",
"args": ["server"]
}
}
}
Configuration Locations
- Cursor:
~/.cursor/mcp.json - Claude Desktop:
~/Library/Application Support/Claude/claude_desktop_config.json
ā ļø Important: Restart your AI assistant after setup or refresh the tool.
āļø Advanced Configuration
For non-Cursor clients or users requiring strict project-level control:
{
"mcpServers": {
"xcf": {
"type": "stdio",
"command": "Applications/xcf.app/Contents/MacOS/xcf",
"args": ["server"],
"env": {
"XCODE_PROJECT_FOLDER": "/path/to/project/",
"XCODE_PROJECT": "/path/to/project/project.xcodeproj"
}
}
}
}
These environment variables let you:
- Pre-select a specific Xcode project to work with
- Define a custom workspace boundary for security
⨠Key Features
- Zero Dependencies: Easy to install, no reliance on other MCP servers
- Automatic Project Detection: Auto-selects your Xcode project so you can start coding immediately
- Real-time Error Handling:
xcf buildorxcf runsends errors and warnings from Xcode directly to your AI IDE - AI-Powered Fixes: Let Claude fix bugs and mistakes during your coding sessions
- Intuitive Commands: Simple, developer-friendly command structure for maximum productivity
- Comprehensive File Operations: Read files and directories with ease
- Xcode Integration: Build, run, and manage Xcode projects directly
- Advanced Code Analysis: Get detailed Swift code analysis without building in Xcode
š ļø Perfect for Swift Developers
The tool is designed by Swift developers, for Swift developers. Commands like build, run, show, and our new file and directory operations make the workflow intuitive and natural.
š Commands Reference
| xcf Command | action Description |
|---|---|
show | List open Xcode projects |
open # | Select project by number |
run | Run current project |
build | Build current project |
current | Show selected project |
env | Show environment variables |
pwd | Show current folder (aliases: dir, path) |
help | Display all available commands |
File Operations
| Command | Description |
|---|---|
read_file <file> | Read content from a file |
read_dir [path] [extension] | List directory contents |
cd_dir <path> | Change directory |
Analysis Tools
| Command | Description |
|---|---|
snippet <file> [start] [end] | Extract code snippets |
analyzer <file> [start] [end] | Analyze Swift code |
lz <file> | Shorthand for analyzer |
š Using Snippets
For Human Commands
xcf supports simplified, user-friendly snippet commands:
To get an entire file, just use the filename:
xcf snippet filename.swift
No need for full paths in many cases - xcf will intelligently find and display the complete file contents.
For specific line ranges:
xcf snippet filename.swift 10 20
You can use either format for file operations:
xcf snippet /path/to/file.swift // Direct path
xcf snippet filePath=/path/to/file.swift // Named parameter
xcf analyze /path/to/file.swift // Direct path
xcf analyze filePath=/path/to/file.swift // Named parameter
xcf lz /path/to/file.swift // Direct path (shorthand)
xcf lz filePath=/path/to/file.swift // Named parameter (shorthand)
For specific line ranges:
xcf snippet /path/to/file.swift 10 20 // Direct path with line range
xcf snippet filePath=/path/to/file.swift startLine=10 endLine=20 // Named parameters
For AI Assistants
When using xcf through MCP tools, use this syntax:
mcp_xcf_snippet filePath="filename.swift" entireFile=true
For specific line ranges:
mcp_xcf_snippet filePath="filename.swift" startLine=10 endLine=20
Smart Path Resolution
When a file isn't found at the exact path, xcf will intelligently search for it in:
- First tries the exact path provided
- Resolves relative paths using the current working directory
- Searches in the current project directory and one level up
- Searches in the workspace folder defined by WORKSPACE_FOLDER_PATHS
- Searches recursively in workspace folders with limited depth
- As a last resort, performs a fuzzy search for similar filenames
This smart path resolution is used consistently across ALL file operations in xcf, including:
- File reading and code snippets
- Code analysis
- Directory operations
This means you can usually just use the filename without any path for any operation:
xcf snippet Constants.swift // For humans
xcf analyze Constants.swift // For humans
Or for AI assistants:
mcp_xcf_snippet filePath="Constants.swift" entireFile=true
mcp_xcf_analyzer filePath="Constants.swift" entireFile=true
š Swift Code Analysis
For Human Commands
Analyze an entire Swift file for potential issues:
xcf analyze filename.swift
Or use the shorthand version:
xcf lz filename.swift
For specific line ranges:
xcf analyze filename.swift --startLine 10 --endLine 50
For AI Assistants
When using xcf through MCP tools, use this syntax:
mcp_xcf_analyzer filePath="filename.swift" entireFile=true
Or use the shorthand version:
mcp_xcf_xcf action="lz filename.swift"
For specific line ranges:
mcp_xcf_analyzer filePath="filename.swift" startLine=10 endLine=50
The analysis identifies issues like:
- Code style and formatting problems
- Functions with high complexity
- Unused variables and symbols
- Magic numbers
- Long methods
- And more
š§© MCP Tools (21 Tools)
Core Tools
| Tool | Description |
|---|---|
xcf | Execute xcf actions (show, open, build, run, current, env, pwd, analyze, lz) |
list | Lists all available tools on this server |
xcf_help | Quick help for xcf actions only |
help | Regular help with common examples |
use_xcf | Activate XCF mode |
tools | Show detailed reference for all tools including AI function calls |
show_help | Display help information about available commands |
Project Management Tools
| Tool | Description |
|---|---|
build_project | Build the current Xcode project |
run_project | Run the current Xcode project |
list_projects | List all open Xcode projects |
select_project | Select an Xcode project by number |
show_current_project | Show information about the currently selected project |
show_env | Display all environment variables |
show_folder | Display the current working folder |
grant_permission | Grant Xcode automation permissions |
File System Tools
| Tool | Description |
|---|---|
read_file | Read content from a file |
read_dir | List contents of a directory |
cd_dir | Change current directory |
Code Analysis Tools
| Tool | Description |
|---|---|
snippet | Extract code snippets from files |
analyzer | Analyze Swift code for potential issues |
analyze_swift_code | Analyze Swift code with customizable check groups (syntax, style, safety, performance, bestPractices) |
For AI Function Calls
To get an entire file:
mcp_xcf_snippet(filePath="/full/path/to/file.swift", entireFile=true)
For specific line ranges:
mcp_xcf_snippet(filePath="/full/path/to/file.swift", startLine=10, endLine=20)
To analyze an entire file:
mcp_xcf_analyzer(filePath="/full/path/to/file.swift", entireFile=true)
For specific line ranges:
mcp_xcf_analyzer(filePath="/full/path/to/file.swift", startLine=10, endLine=50)
Working with Files and Directories
Read a file:
mcp_xcf_read_file filePath="main.swift"
List directory contents:
mcp_xcf_read_dir directoryPath="."
List Swift files only:
mcp_xcf_read_dir directoryPath="src" fileExtension="swift"
Change directory:
mcp_xcf_cd_dir directoryPath="src"
š Security Features
- Safely works with projects in your designated workspace
- Automatically prevents access outside your workspace boundaries
- Redirects to safe alternatives when needed
- Uses environment variables to define secure boundaries
š Workflow Examples
Basic Workflow (For Humans)
xcf show- See available projectsxcf open 1- Select a projectxcf build- Build the projectxcf run- Run the project
Code Analysis Workflow (For Humans)
xcf current- Check current projectxcf snippet filename.swift- Examine codexcf lz filename.swift- Analyze codexcf build- Build after fixing issues
File Manipulation Workflow (For Humans)
read_dir .- List files in current directoryread_file main.swift- View file contents- Use Agent native tools for file editing
xcf build- Build after changes
Basic Workflow (For AI Assistants)
mcp_xcf_xcf action="show"- See available projectsmcp_xcf_xcf action="open 1"- Select a projectmcp_xcf_xcf action="build"- Build the projectmcp_xcf_xcf action="run"- Run the project
Code Analysis Workflow (For AI Assistants)
mcp_xcf_xcf action="current"- Check current projectmcp_xcf_snippet filePath="filename.swift" entireFile=true- Examine codemcp_xcf_analyzer filePath="filename.swift" entireFile=true- Analyze codemcp_xcf_xcf action="build"- Build after fixing issues
File Manipulation Workflow (For AI Assistants)
mcp_xcf_read_dir directoryPath="."- List files in current directorymcp_xcf_read_file filePath="main.swift"- View file contents- Use Agent native
edit_filetool for file editing mcp_xcf_xcf action="build"- Build after changes
šŗ Demo
Watch XCF in action: YouTube Demo
ā Troubleshooting
If commands fail, check:
- xcf installation is correct
- Refreshing xcf MCP Server
- Verify the server launches and is in your /Applications folder
- Environment variables with
envsuch as "server" - Relaunch your AI assistant
š¤ Open Source Community
Swift Engineers are welcome to contribute! Help us make xcf even better.
šÆ 100% Swift. 100% Open Source.
Created by XCodeFreeze Automation and CodeFreeze.ai - Bringing the future of Swift development to your fingertips!
Related Servers
Scout Monitoring MCP
sponsorPut performance and error data directly in the hands of your AI assistant.
Alpha Vantage MCP Server
sponsorAccess financial market data: realtime & historical stock, ETF, options, forex, crypto, commodities, fundamentals, technical indicators, & more
TouchDesigner MCP
Control and operate TouchDesigner projects with AI agents using the Model Context Protocol.
Verilator MCP Server
An MCP server for Verilator providing RTL simulation, automatic testbench generation, and natural language query capabilities.
MCP Ollama Agent
A TypeScript agent that integrates MCP servers with Ollama, allowing AI models to use various tools through a unified interface.
Nessus MCP Server
An MCP server for interacting with the Tenable Nessus vulnerability scanner.
Flowise
Integrate with the Flowise API to create predictions and manage chatflows and assistants.
Norce Assistant
Provides AI-powered knowledge and code examples for Norce Commerce development directly in your preferred AI environment.
Sequa MCP
A proxy that connects local STDIO with remote MCP servers, enabling IDEs to use MCP without extra infrastructure.
promptz.dev
Access and manage prompts from promptz.dev for developers.
MCP DevTools
A development tools server for Git management, file operations, AI-assisted editing, and terminal execution, integrable with AI assistants and code editors.
Laravel Loop
An MCP server for Laravel applications to connect with AI assistants using the MCP protocol.