A Swift-based MCP server that integrates with Xcode to enhance AI development workflows.
Speed up writing Xcode apps with xcf, a dead simple Swift-based MCP server specifically designed for Cursor. Works seamlessly with VSCode and Claude, with no TypeScript, no JavaScript, no BS!
💡 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.
Add xcf to your MCP configuration file:
{
"mcpServers": {
"xcf": {
"type": "stdio",
"command": "Applications/xcf.app/Contents/MacOS/xcf",
"args": ["server"]
}
}
}
~/.cursor/mcp.json
~/Library/Application Support/Claude/claude_desktop_config.json
⚠️ Important: Restart your AI assistant after setup or refresh the tool.
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:
xcf build
or xcf run
sends errors and warnings from Xcode directly to your AI IDEThe 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.
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 |
Command | Description |
---|---|
read_file <file> | Read content from a file |
write_file <file> <content> | Write content to a file |
edit_file <file> <start> <end> <content> | Edit specific lines in a file |
delete_file <file> | Delete a file |
move_file <source> <destination> | Move a file from one location to another |
Command | Description |
---|---|
cd_dir <path> | Change directory |
read_dir [path] [extension] | List directory contents |
add_dir <path> | Create directory |
rm_dir <path> | Remove directory |
move_dir <source> <destination> | Move a directory from one location to another |
Command | Description |
---|---|
open_doc <file> | Open document in Xcode |
create_doc <file> [content] | Create new Xcode document |
read_doc <file> | Read Xcode document |
save_doc <file> | Save Xcode document |
edit_doc <file> <start> <end> <content> | Edit Xcode document |
close_doc <file> <saving> | Close a document in Xcode |
Command | Description |
---|---|
snippet <file> [start] [end] | Extract code snippets |
analyzer <file> [start] [end] | Analyze Swift code |
lz <file> | Shorthand for analyzer |
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
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
When a file isn't found at the exact path, xcf will intelligently search for it in:
This smart path resolution is used consistently across ALL file operations in xcf, including:
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
xcf edit Constants.swift // For humans
Or for AI assistants:
mcp_xcf_snippet filePath="Constants.swift" entireFile=true
mcp_xcf_analyzer filePath="Constants.swift" entireFile=true
mcp_xcf_xcf action="edit Constants.swift"
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
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:
mcp_xcf_xcf
: Execute xcf actions/commandsmcp_xcf_list
: Show all available toolsmcp_xcf_snippet
: Extract code snippets from filesmcp_xcf_analyzer
: Analyze Swift code for potential issuesmcp_xcf_help
: Get help informationmcp_xcf_xcf_help
: Get help for xcf actions onlymcp_xcf_tools
: Show detailed reference for all toolsmcp_xcf_read_dir
: List contents of a directorymcp_xcf_read_file
: Read content from a filemcp_xcf_write_file
: Write content to a filemcp_xcf_edit_file
: Edit content in a filemcp_xcf_delete_file
: Delete a filemcp_xcf_cd_dir
: Change current directorymcp_xcf_add_dir
: Create a new directorymcp_xcf_rm_dir
: Remove a directorymcp_xcf_move_file
: Move a file from one location to anothermcp_xcf_move_dir
: Move a directory from one location to anothermcp_xcf_open_doc
: Open a document in Xcodemcp_xcf_close_doc
: Close a document in Xcodemcp_xcf_create_doc
: Create a new document in Xcodemcp_xcf_read_doc
: Read document content from Xcodemcp_xcf_save_doc
: Save document in Xcodemcp_xcf_edit_doc
: Edit document content in Xcodemcp_xcf_use_xcf
: Activate XCF modemcp_xcf_show_help
: Display help information about available commandsmcp_xcf_grant_permission
: Grant Xcode automation permissionsmcp_xcf_run_project
: Run the current Xcode projectmcp_xcf_build_project
: Build the current Xcode projectmcp_xcf_show_current_project
: Show information about the currently selected projectmcp_xcf_show_env
: Display all environment variablesmcp_xcf_show_folder
: Display the current working foldermcp_xcf_list_projects
: List all open Xcode projectsmcp_xcf_select_project
: Select an Xcode project by numbermcp_xcf_analyze_swift_code
: Analyze Swift code for potential issuesTo 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)
Read a file:
mcp_xcf_read_file filePath="main.swift"
Write to a file:
mcp_xcf_write_file filePath="test.txt" content="Hello World"
Edit specific lines in a file:
mcp_xcf_edit_file filePath="main.swift" startLine=10 endLine=20 replacement="new code here"
List directory contents:
mcp_xcf_read_dir directoryPath="."
Create a new directory:
mcp_xcf_add_dir directoryPath="new_folder"
Open a document in Xcode:
mcp_xcf_open_doc filePath="main.swift"
Create a new document:
mcp_xcf_create_doc filePath="new_file.swift" content="import Foundation"
Edit a document:
mcp_xcf_edit_doc filePath="main.swift" startLine=5 endLine=10 replacement="// New code"
Close a document:
mcp_xcf_close_doc filePath="main.swift" saving=true
xcf show
- See available projectsxcf open 1
- Select a projectxcf build
- Build the projectxcf run
- Run the projectxcf current
- Check current projectxcf snippet filename.swift
- Examine codexcf lz filename.swift
- Analyze codexcf build
- Build after fixing issuesread_dir .
- List files in current directoryread_file main.swift
- View file contentsedit_file main.swift 10 15 "// Updated code"
- Edit the filexcf build
- Build after changesopen_doc main.swift
- Open document in Xcodeedit_doc main.swift 10 20 "// New implementation"
- Edit in Xcodesave_doc main.swift
- Save the documentxcf build
- Build after changesmcp_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 projectmcp_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 issuesmcp_xcf_read_dir directoryPath="."
- List files in current directorymcp_xcf_read_file filePath="main.swift"
- View file contentsmcp_xcf_edit_file filePath="main.swift" startLine=10 endLine=15 replacement="// Updated code"
- Edit the filemcp_xcf_xcf action="build"
- Build after changesmcp_xcf_open_doc filePath="main.swift"
- Open document in Xcodemcp_xcf_edit_doc filePath="main.swift" startLine=10 endLine=20 replacement="// New implementation"
- Edit in Xcodemcp_xcf_save_doc filePath="main.swift"
- Save the documentmcp_xcf_xcf action="build"
- Build after changesWatch XCF in action: YouTube Demo
If commands fail, check:
env
such as "server"Swift Engineers are welcome to contribute! Help us make xcf even better.
Created by XCodeFreeze Automation and CodeFreeze.ai - Bringing the future of Swift development to your fingertips!
Integration with QA Sphere test management system, enabling LLMs to discover, summarize, and interact with test cases directly from AI-powered IDEs
A proxy server that enables existing REST APIs to be used as Model Context Protocol (MCP) servers.
Perform symbolic mathematics and computer algebra using the SymPy library.
Access and control local iTerm2 terminal sessions.
An MCP server for accessing YAPI interface details, configured via environment variables.
Bridges AI coding assistants with Neovim's Language Server Protocol for AI-powered code intelligence and navigation.
An MCP server that integrates with Ollama to provide tools for file operations, calculations, and text processing. Requires a running Ollama instance.
An example of a remote MCP server deployable on Cloudflare Workers without authentication.
A powerful and flexible MCP server designed to enhance the development experience with Shadcn UI components, providing tools for component management, documentation, and installation.
An MCP server for interacting with the Clay API, which requires a Clay API key.