Building iOS Apps with Amazon Q and Xcode MCP

Discover how AI-powered development tools are transforming iOS app creation through practical, real-world implementations.

Table of Contents

  1. Introduction
  2. Understanding the Technologies
  3. Enter LaxRef
  4. You too can do this
  5. Setup and Configuration
  6. Advanced Features and Technical Implementation
  7. Conclusion

Introduction

The world of iOS development is experiencing a revolutionary shift. Gone are the days where developers have to write every line of code from scratch, manually debug complex issues, or spend hours researching API documentation. Many may lament this for good reason. Regardless, AI-powered development assistants are transforming how we build applications, making development faster, more efficient, and on occasions even more creative.

An emerging frontrunner of this transformation is Amazon Q Developer, Amazon’s AI assistant that’s a collaboration with Anthropic. Q developer understands code, context, and developer intent. When combined with Model Context Protocol (MCP) integration, Amazon Q becomes a compellingly capable companion for iOS development, with capacity to understanding your entire project ecosystem and provide contextually aware assistance. Most of what I cover below also applies to any other agent capable LLM (Large Language Model).

Amazon Q offers support for many popular development environments (including their own VS code spinoff in Kiro), yet Xcode Apple’s IDE for iOS development notably lacks native integration. This might seem like a roadblock, but it’s also an opportunity to explore innovative workflows that combine the best of both worlds. For the past 5 months or so I’ve been using the XcodeBuildMCP agent and while not officially supported it’s performed brilliantly for my use case.

In this practical guide, I’ll detail the key steps taken on a journey to build a real iOS application using Amazon Q chat’s CLI capabilities alongside Xcode.

Understanding the Technologies

Amazon Q Developer: More Than Just Code Completion

Amazon Q Developer isn’t your typical autocomplete tool. It’s an AI assistant that:

  • Understands Context: Analyzes your entire codebase to provide relevant suggestions
  • Explains Complex Code: Breaks down intricate patterns into plain English
  • Generates Boilerplate: Creates repetitive code structures, allowing you to focus on core functional logic
  • Debugs Issues: Helps identify and resolve bugs with intelligent analysis. (Usually intelligent, occasionally eyes roll ;-)
  • Learns Domain Knowledge: Adapts to specific bespoke use cases (such as sports applications)

What makes Amazon Q particularly powerful is its ability to understand not just syntax, but the intent behind your code. For example, when building a lacrosse referee app, it doesn’t just help with Swift syntax, it also understands lacrosse rules, timing requirements, and impressively even some less obvious lacrosse specific officiating requirements.

Model Context Protocol (MCP): The Bridge Between AI and Tools

Model Context Protocol is an open standard that enables AI assistants to communicate with external tools and services. Think of MCP as a universal translator that allows Amazon Q to:

  • Access File Systems: Read and analyze your project files
  • Execute Commands: Run build scripts, tests, and deployment tasks
  • Connect to Services: Integrate with databases, APIs, the web and other cloud services
  • Understand Project Structure: Navigate complex codebases intelligently

MCP transforms Amazon Q from a simple chat interface into a comprehensive development environment that can interact with your entire toolchain.

The Xcode Integration Challenge

Here’s where things get interesting. While Amazon Q Developer has excellent native support for VS Code, JetBrains IDE, and other popular development environments, as previously mentioned, Xcode is not officially supported. This means we can’t get inline code suggestions or real-time AI assistance directly within Xcode. Unfazed and curious, I started a project to create a lacrosse referee app just prior to the 🥍 season in March, with Amazon Q version 1.7.0 the latest available. My knowledge of swift at this time would have struggled to fill the back of a drink coaster. The first instantiation had Q cutting the code, while I was handling the Xcode integration. It was tedious, slow progress, if you want to call it that, and so so repetitive.

10 Clean
200 build
300 copy compile errors
400 paste them back to Q
500 wait 5 minutes, examining proposed changes and clicking approve every so often...
600 gosub 10
I hope the vague apple basic gosub reference above doesn’t confuse so much as it shows my age… 😄

I disliked this development process so intensely, that I very nearly gave up on it. New Agentic workflows were starting to spring up everywhere around that time. I’d already been using them for work related tasks. Scratching my head a little, I googled xcode MCP and never looked back…

Despite the lack of direct IDE integration, it’s forced an innovative workflow that offers some distinct advantages. Using Amazon Q Developer CLI chat alongside Xcode, coupled with the XcodeBuildMCP works really well for me with my two screen setup.
##Primary benefits:

  • Focused AI Interaction: Dedicated terminal for AI conversations without IDE distractions
  • Q Code Generation and feedback loop: Generate code in the terminal with Q, have Q execute Xcode builds and feed back on results.
  • Custom Workflows: Create specialized development processes, such as deploy to simulation devices and perform tests, including swipe gestures etc.

Enter LaxRef:

With the revised workflow and a little spare time over the few weeks that passed, I managed to more or less vibe code the core functionality of LaxRef (Lacrosse Referee); an iOS and iWatch app written to assist me officiating lacrosse games. This project was an ideal example of AI in action. Not just because lacrosse is the fastest sport on two feet, has an ancient native American history and looks super cool with all that gear, but also because it combines:

Real-World Complexity

  • Multiple Timer Management: Game clock, penalty timers, shot clock coordination
  • Complex Logic: Lacrosse-specific rules and regulations
  • Real-Time Data: Live scoring, penalty tracking, and game statistics
  • User Experience Challenges: Interface design for high-pressure game situations

Technical Depth

  • Swift/SwiftUI Implementation: Modern iOS development patterns
  • Core Data Integration: Persistent game data and statistics
  • Background Processing: Timers that continue running when their view is back-grounded
  • Notification Systems: Audio and visual alerts for game events

Domain-Specific Knowledge

This is where AI assistance impressed me. Lacrosse has intricate rules about:

  • Penalty Types and Durations: Personal fouls, technical fouls, unsportsmanlike conduct
  • Game Structure: Periods, overtime rules, shot clock regulations
  • Referee Workflows: Efficient processes for managing game flow

Amazon Q helped not just with the code, but also with understanding and implementing these sport-specific requirements correctly (well mostly… it really struggled with verbal intents).

You too can do this.

By the end of this guide, you’ll be able to:

  1. Set up Amazon Q Developer CLI for iOS development workflows
  2. Configure MCP servers to enhance AI capabilities
  3. Create effective prompts for Swift code generation
  4. Integrate AI-generated code into Xcode projects
  5. Leverage AI for domain-specific development
  6. Build complex swift iOS apps with AI assistance
  7. Optimize your development workflow using AI tools

Whether you’re building sports apps, business applications, or any other iOS project, the techniques and workflows demonstrated here have the capacity to lift your development skills.

Setup and Configuration

Prerequisites

Before you begin, ensure you have:

  • macOS (required for Xcode development)
  • Xcode (latest version recommended - we’ll be using Xcode 16.3 in our examples)
  • Terminal access (we’ll be working extensively with the command line)
  • Internet connection (for downloading tools and authenticating with Amazon Q)
  • Basic familiarity with Swift and iOS development concepts
  • optional apple developer account (recommended)

Understanding the Architecture

Since Xcode doesn’t have native Amazon Q integration, we’ll use a hybrid approach that combines the best of both worlds:

┌─────────────────┐    ┌───────────────────┐    ┌─────────────────┐
│   Xcode IDE     │    │   Terminal        │    │   Amazon Q CLI  │
│                 │    │                   │    │                 │
│ • Code editing  │◄──►│ • AI interaction  │◄──►│ • MCP servers   │
│ • Building      │    │ • Code generation │    │ • Tool access   │
│ • Debugging     │    │ • Project analysis│    │ • Context aware │
└─────────────────┘    └───────────────────┘    └─────────────────┘
                                                        │
                                                        ▼
                                               ┌─────────────────┐
                                               │ MCP Ecosystem   │
                                               │ • Git           │
                                               │ • File system   │
                                               │ • Documentation │
                                               │ • Custom tools  │
                                               └─────────────────┘

This architecture allows us to:

  • Use Xcode for its considerable iOS development features
  • Leverage Amazon Q’s AI capabilities through the CLI
  • Access powerful MCP agents that extend AI automation
  • Maintain a smooth development workflow

Step 1: Install Amazon Q Developer CLI

  1. Download Amazon Q for macOS:

       # Download the DMG file directly
       curl -o "Amazon Q.dmg" "https://desktop-release.q.us-east-1.amazonaws.com/latest/Amazon%20Q.dmg"
       

  2. Install the application:

    • Double-click the downloaded DMG file to mount it
    • Drag the Amazon Q app into your Applications folder
    • Open Amazon Q from your Applications folder
  3. Enable shell integrations:

    • When you first open Amazon Q, it will prompt you to enable shell integrations
    • This allows you to run Amazon Q from the terminal and enables command auto-completions
    • Follow the prompts to install shell integrations and grant macOS accessibility permissions

Option B: Install with Homebrew

For those who prefer 🍺:

Install Amazon Q using Homebrew

brew install --cask amazon-q

Verify Installation

Check if the CLI is accessible

q --version

If the command isn’t found, the shell integration may not be complete You can manually add it to your PATH:

echo 'export PATH="/Applications/Amazon Q.app/Contents/MacOS:$PATH"' >> ~/.zshrc
source ~/.zshrc

You should see output similar to:

q 1.16.2

Troubleshooting Installation

If you encounter issues: Run the built-in diagnostic tool

q doctor

# This will check for common issues and provide fixes

The q doctor command will verify your installation and help resolve common problems like authentication issues, shell integration problems, or connectivity issues.

Step 2: Install uv (Python Package Manager)

Many MCP servers are Python-based, so we need uv (and its companion uvx) to manage them:

# Install uv using the official installer
curl -LsSf https://astral.sh/uv/install.sh | sh

# Reload your shell configuration
source $HOME/.cargo/env

# Verify installation
uvx --version
uvx 0.8.17

Step 3: Authenticate with Amazon Q

Amazon Q offers two authentication methods:

Option A: AWS Builder ID (Free)

Perfect for personal development and learning:

# Start the authentication process
q login

# Follow the browser prompts to:
# 1. Sign in with your AWS Builder ID
# 2. Authorize the Amazon Q CLI
# 3. Return to the terminal

Option B: IAM Identity Center (Pro)

For enterprise environments with existing AWS organizations or personal AWS accounts:

# Login with your organization's start URL
q login --start-url https://your-org.awsapps.com/start

# Follow the prompts to authenticate

Verify Authentication

# Check your authentication status
q whoami

You should see your user information displayed.

Step 4: Configure MCP for Swift Development

Amazon Q supports two approaches for MCP configuration:

The modern approach uses custom agents with embedded MCP server definitions. This provides better organization and project-specific configurations:

# Create the configuration directory
mkdir -p ~/.aws/amazonq/cli-agents

Create the Swift development agent configuration

cat > ~/.aws/amazonq/cli-agents/swift-development.json << 'EOF'
{
  "name": "swift-development-agent",
  "description": "Specialized agent for Swift and iOS development with Xcode project support",
  "prompt": "You are an expert Swift and iOS developer. You help with Swift code generation, Xcode project management, iOS app development. You understand Swift syntax, iOS frameworks, and mobile app best practices.",
  "mcpServers": {
    "git": {
      "command": "uvx",
      "args": ["mcp-server-git@latest"],
      "env": {
        "GIT_CONFIG_GLOBAL": "/dev/null"
      },
      "timeout": 120000
    },
    "filesystem": {
      "command": "uvx",
      "args": ["mcp-server-filesystem@latest"],
      "timeout": 60000
    },
    "fetch": {
      "command": "uvx",
      "args": ["mcp-server-fetch@latest"],
      "timeout": 60000
    },
    "xcodebuild": {
      "command": "npx",
      "args": ["xcodebuildmcp@latest"],
      "timeout": 120000
    }
  },
  "tools": [
    "fs_read",
    "fs_write",
    "execute_bash",
    "knowledge",
    "@git",
    "@filesystem",
    "@fetch",
    "@xcodebuild"
  ],
  "allowedTools": [
    "fs_read",
    "fs_write",
    "knowledge",
    "@git/git_status",
    "@git/git_log",
    "@fetch/fetch_url",
    "@xcodebuild/build_ios_simulator",
    "@xcodebuild/list_simulators",
    "@xcodebuild/install_app",
    "@xcodebuild/launch_app"
  ],
  "toolsSettings": {
    "fs_write": {
      "allowedPaths": [
        "**/*.swift",
        "**/*.xcodeproj/**",
        "**/*.xcworkspace/**",
        "**/*.plist",
        "**/*.json",
        "**/*.md",
        "**/Package.swift"
      ]
    },
    "fs_read": {
      "allowedPaths": [
        "**/*.swift",
        "**/*.xcodeproj/**",
        "**/*.xcworkspace/**",
        "**/*.plist",
        "**/*.json",
        "**/*.md",
        "**/Package.swift"
      ]
    },
    "execute_bash": {
      "allowedCommands": [
        "xcodebuild",
        "swift",
        "git status",
        "git log",
        "git diff",
        "git branch",
        "git add",
        "git commit",
        "find",
        "grep",
        "ls",
        "cat"
      ],
      "deniedCommands": [
        "git push.*",
        "git merge.*",
        "git rebase.*",
        "git reset --hard.*",
        "rm -rf.*",
        "sudo.*"
      ],
      "allowReadOnly": true
    }
  },
  "resources": [
    "file://.amazonq/rules/**/*.md",
    "file://README*",
    "file://docs/**/*.md"
  ],
  "useLegacyMcpJson": false
}
EOF

This configuration creates an agent that:

  • Understands Swift and iOS development through its specialized prompt
  • Has access to essential MCP servers for git, filesystem, and web operations
  • Can read and write project files with appropriate permissions

Flexible Resource Management

The resources section above uses flexible patterns that work across different projects:

  • file://.amazonq/rules/**/*.md: Project-specific rules and guidelines
  • file://README*: Matches README.md, README.txt, etc.
  • file://docs/**/*.md: Documentation files if they exist

For project-specific context, you can add files dynamically during your chat session, but do be careful not to load too much. Less can be more here…:

# Add Swift files from current project
/context add **/*.swift

# Add Xcode project files
/context add **/*.xcodeproj/project.pbxproj

# Add specific configuration files
/context add Info.plist Package.swift

# View current context
/context show

Best Practice: Keep the agent resources minimal and generic, then add project-specific files as needed using /context add commands. This makes your agent portable across different projects while still providing relevant context.

Option B: Legacy MCP Configuration

If you prefer the traditional approach or need to maintain compatibility with existing setups, you can use the legacy mcp.json configuration:

# Create global MCP configuration
mkdir -p ~/.aws/amazonq
cat > ~/.aws/amazonq/mcp.json << 'EOF'
{
  "mcpServers": {
    "git": {
      "command": "uvx",
      "args": ["mcp-server-git@latest"],
      "env": {
        "GIT_CONFIG_GLOBAL": "/dev/null"
      },
      "timeout": 120000
    },
    "filesystem": {
      "command": "uvx",
      "args": ["mcp-server-filesystem@latest"],
      "timeout": 60000
    },
    "fetch": {
      "command": "uvx",
      "args": ["mcp-server-fetch@latest"],
      "timeout": 60000
    },
    "xcodebuild": {
      "command": "npx",
      "args": ["xcodebuildmcp@latest"],
      "timeout": 120000
    }
  }
}
EOF

# Create a simple agent that uses legacy MCP configuration
cat > ~/.aws/amazonq/cli-agents/swift-legacy.json << 'EOF'
{
  "name": "swift-legacy-agent",
  "description": "Swift development agent using legacy MCP configuration",
  "prompt": "You are an expert Swift and iOS developer. You help with Swift code generation, Xcode project management, iOS app development, and lacrosse referee app features.",
  "useLegacyMcpJson": true,
  "tools": [
    "fs_read",
    "fs_write",
    "execute_bash",
    "knowledge",
    "@git",
    "@filesystem",
    "@fetch",
    "@xcodebuild"
  ]
}
EOF

Note: The legacy approach is still supported, but the agent-based configuration is recommended for new setups as it provides better organization and project-specific control.

The XcodeBuildMCP:

The most crucial component in our setup is XcodeBuildMCP by Cameron Cooke. This MCP server bridges the gap between Amazon Q and Xcode, providing essential tools that make AI-assisted iOS development truly effective:

Key XcodeBuildMCP Features:

  • Build Operations: Platform-specific builds for macOS, iOS simulator, and device targets
  • Simulator Management: List, boot, install apps, and capture logs from simulators
  • Device Management: Deploy on physical devices over USB or Wi-Fi
  • Project Discovery: Automatically find and analyze Xcode projects and workspaces
  • Real-time Feedback: Capture build errors and runtime logs for AI analysis
  • UI Automation: Interact with simulator UI elements for functional testing

Why XcodeBuildMCP is Essential: Without XcodeBuildMCP, Amazon Q would be limited to generating code without the ability to:

  • Build and test the code it generates
  • Deploy apps to simulators or devices
  • Capture and analyze build errors
  • Iterate on fixes based on runtime feedback

This creates the crucial feedback loop that transforms Amazon Q from a code generator into a practical development partner.

Installation Requirements: XcodeBuildMCP requires Node.js (18.x or later) and is installed via npm. The configuration above uses npx to automatically download and run the latest version, so no separate installation is needed.

Project-Specific Agent Configurations

For maximum flexibility, you can create project-specific agent configurations. Here’s an approach that worked well for me:

1. Create a workspace-specific agent:

# In the LaxRef project directory
mkdir -p .amazonq/agents
cat > .amazonq/agents/laxref-agent.json << 'EOF'
{
  "name": "laxref-agent",
  "description": "LaxRef project-specific agent with lacrosse domain knowledge",
  "prompt": "You are an expert Swift developer working on the LaxRef lacrosse referee app. You understand lacrosse rules, iOS development, and this specific project structure.",
  "useLegacyMcpJson": true,
  "resources": [
    "file://README.md",
    "file://LaxRef/**/*.swift",
    "file://LaxRef.xcodeproj/project.pbxproj",
    "file://docs/**/*.md",
    "file://.amazonq/rules/**/*.md"
  ],
  "tools": [
    "fs_read", "fs_write", "execute_bash", "knowledge",
    "@git", "@filesystem", "@fetch", "@xcodebuild"
  ]
}
EOF

# Use the project-specific agent
q chat --agent .amazonq/agents/laxref-agent.json

2. Create project rules for context:

mkdir -p .amazonq/rules
cat > .amazonq/rules/lacrosse-rules.md << 'EOF'
# Lacrosse Rules for LaxRef App

## Game Structure
- 4 periods of 12 minutes each
- 30-second shot clock
- 2 timeouts per team per half

## Penalty Types
- Personal fouls: 1-3 minutes
- Technical fouls: 30 seconds
- Unsportsmanlike conduct: 1-3 minutes (non-releasable)
EOF

This approach gives you:

  • Portable base agent for general Swift development
  • Project-specific agents with tailored context and rules
  • Dynamic context management for different development phases

Step 5: Validate Your Setup

Let’s verify everything is working correctly:

# Check available agents
q agent list

# You should see your swift-development agent listed

# Test the agent
q chat --agent swift-development

# In the chat session, try these commands:
# /tools          (shows available tools)
# /mcp            (shows MCP server status)

Step 6: Configure Your Development Workflow

For the best experience, set up your terminal alongside Xcode:

  1. Open Xcode with your iOS project
  2. Open Terminal (or iTerm2) in a split-screen or separate window
  3. Navigate to your project directory:
       cd /path/to/your/xcode/project
       
  4. Start your Amazon Q session:
       q chat --agent swift-development
       

Example Workflow Commands

Once your agent is running, you can use natural language to interact with your project:

# Analyze project structure
"What Swift files are in this project?"

# Generate code
"Create a SwiftUI view for a lacrosse game timer"

# Get help with implementation
"How should I implement a penalty tracking system in Swift?"

# Check git status
"What's the current git status of this project?"

# Analyze existing code
"Explain what this ContentView.swift file does"

XcodeBuildMCP Workflow Commands

With XcodeBuildMCP integrated, you can now perform complete development workflows:

# Build and test cycle
"Build this project for iOS simulator and show me any errors"

# Simulator management
"List available iOS simulators and boot the iPhone 15 Pro simulator"

# Deploy and test
"Install the LaxRef app on the simulator and launch it"

# Debug and iterate
"The app crashed on launch. Capture the simulator logs and help me fix the issue"

# Complete development cycle
"Build the project, install it on simulator, launch it, and capture any runtime logs"

This feedback loop extends Amazon Q so it can:

  1. Generate code based on your requirements
  2. Build the project to check for compilation errors
  3. Deploy to simulator to test functionality
  4. Capture logs to identify runtime issues
  5. Iterate and fix problems automatically

Troubleshooting Common Setup Issues

Issue: “q command not found”

Solution:

# Check if Amazon Q is installed
ls -la "/Applications/Amazon Q.app/Contents/MacOS/q"

# Add to PATH if needed
echo 'export PATH="/Applications/Amazon Q.app/Contents/MacOS:$PATH"' >> ~/.zshrc
source ~/.zshrc

Issue: “Authentication required”

There were quite a number of early problems with Q sessions dropping oauth tokens, forcing you to log in each session. Very painful, but well sorted these days.
Solution:

# Re-authenticate
q logout
q login

# Check authentication status
q whoami

Issue: MCP servers not loading

Solution:

# Check uvx installation
uvx --version

# Test MCP server manually
uvx mcp-server-git@latest

# Check agent configuration syntax
python3 -m json.tool ~/.aws/amazonq/cli-agents/swift-development.json

Issue: Permission denied for file operations

Solution: Ensure your allowedPaths in the agent configuration include the directories you’re working with:

{
  "toolsSettings": {
    "fs_read": {
      "allowedPaths": [
        "/path/to/your/project/**",
        "**/*.swift"
      ]
    }
  }
}

Issue: Timeout errors with MCP servers

Solution: Increase timeout values in your configuration:

{
  "mcpServers": {
    "git": {
      "timeout": 180000
    }
  }
}

Advanced Features and Technical Implementation

Now that we’ve covered the basics of Amazon Q + MCP integration for iOS development, for the serious pundits, let’s examine advanced configurations and technical implementations that can truly amplify your development workflow.

Advanced MCP Configuration Options

Custom MCP Server Configuration

While our basic setup included essential MCP servers, you can create sophisticated configurations tailored to your specific development needs. Here’s an advanced configuration that includes specialized servers for iOS development:

{
  "name": "advanced-swift-agent",
  "description": "Advanced Swift development agent with comprehensive MCP server integration",
  "prompt": "You are an expert Swift and iOS developer with deep knowledge of Apple's frameworks, design patterns, and mobile app architecture.",
  "mcpServers": {
    "git": {
      "command": "uvx",
      "args": ["mcp-server-git@latest"],
      "env": {
        "GIT_CONFIG_GLOBAL": "/dev/null",
        "GIT_AUTHOR_NAME": "Amazon Q Assistant",
        "GIT_AUTHOR_EMAIL": "amazonq@example.com"
      },
      "timeout": 120000,
      "retries": 3
    },
    "filesystem": {
      "command": "uvx",
      "args": ["mcp-server-filesystem@latest"],
      "env": {
        "FS_WATCH_ENABLED": "true",
        "FS_MAX_FILE_SIZE": "10485760"
      },
      "timeout": 60000
    },
    "fetch": {
      "command": "uvx",
      "args": ["mcp-server-fetch@latest"],
      "env": {
        "FETCH_TIMEOUT": "30000",
        "FETCH_MAX_SIZE": "5242880"
      },
      "timeout": 60000
    },
    "aws-docs": {
      "command": "uvx",
      "args": ["awslabs.aws-documentation-mcp-server@latest"],
      "env": {
        "FASTMCP_LOG_LEVEL": "ERROR",
        "AWS_DOCS_CACHE_TTL": "3600"
      },
      "timeout": 90000
    },
    "sqlite": {
      "command": "uvx",
      "args": ["mcp-server-sqlite@latest"],
      "env": {
        "SQLITE_MAX_CONNECTIONS": "10",
        "SQLITE_TIMEOUT": "30000"
      },
      "timeout": 60000
    },
    "docker": {
      "command": "uvx",
      "args": ["mcp-server-docker@latest"],
      "env": {
        "DOCKER_HOST": "unix:///var/run/docker.sock"
      },
      "timeout": 120000
    }
  },
  "tools": [
    "fs_read",
    "fs_write",
    "fs_watch",
    "execute_bash",
    "knowledge",
    "@git",
    "@filesystem",
    "@fetch",
    "@aws-docs",
    "@sqlite",
    "@docker"
  ],
  "allowedTools": [
    "fs_read",
    "fs_write",
    "fs_watch",
    "knowledge",
    "@git/git_status",
    "@git/git_log",
    "@git/git_diff",
    "@git/git_commit",
    "@git/git_branch",
    "@fetch/fetch_url",
    "@aws-docs/search_documentation",
    "@aws-docs/read_documentation",
    "@sqlite/execute_query",
    "@docker/list_containers",
    "@docker/inspect_container"
  ],
  "toolsSettings": {
    "fs_write": {
      "allowedPaths": [
        "**/*.swift",
        "**/*.xcodeproj/**",
        "**/*.xcworkspace/**",
        "**/*.plist",
        "**/*.json",
        "**/*.md",
        "**/*.yaml",
        "**/*.yml",
        "**/Package.swift",
        "**/Podfile",
        "**/Cartfile",
        "**/*.storyboard",
        "**/*.xib"
      ],
      "maxFileSize": 1048576,
      "backupEnabled": true
    },
    "fs_read": {
      "allowedPaths": [
        "**/*.swift",
        "**/*.xcodeproj/**",
        "**/*.xcworkspace/**",
        "**/*.plist",
        "**/*.json",
        "**/*.md",
        "**/*.yaml",
        "**/*.yml",
        "**/Package.swift",
        "**/Podfile",
        "**/Cartfile",
        "**/*.storyboard",
        "**/*.xib",
        "**/Info.plist",
        "**/project.pbxproj"
      ],
      "maxFileSize": 5242880
    },
    "fs_watch": {
      "watchPaths": [
        "**/*.swift",
        "**/project.pbxproj",
        "**/*.plist"
      ],
      "ignorePatterns": [
        "**/build/**",
        "**/DerivedData/**",
        "**/.git/**"
      ]
    },
    "execute_bash": {
      "allowedCommands": [
        "xcodebuild",
        "swift",
        "swiftc",
        "git status",
        "git log",
        "git diff",
        "git branch",
        "git add",
        "git commit",
        "find",
        "grep",
        "ls",
        "cat",
        "head",
        "tail",
        "wc",
        "sort",
        "uniq",
        "awk",
        "sed",
        "xcrun",
        "plutil",
        "defaults"
      ],
      "workingDirectory": ".",
      "timeout": 300000,
      "environment": {
        "DEVELOPER_DIR": "/Applications/Xcode.app/Contents/Developer"
      }
    }
  },
  "resources": [
    "file://README.md",
    "file://**/*.swift",
    "file://**/*.xcodeproj/project.pbxproj",
    "file://**/*.plist",
    "file://Package.swift",
    "file://Podfile"
  ],
  "contextSettings": {
    "maxTokens": 128000,
    "temperature": 0.1,
    "topP": 0.9,
    "frequencyPenalty": 0.0,
    "presencePenalty": 0.0
  },
  "useLegacyMcpJson": false,
  "enableLogging": true,
  "logLevel": "INFO"
}

Key Advanced Configuration Features

Enhanced File System Operations:

  • File watching for automatic project analysis when files change
  • Backup functionality to prevent accidental overwrites
  • Size limits to prevent processing of large binary files
  • Pattern matching for precise file type targeting

Extended Tool Access:

  • Git operations including commits, branches, and diffs
  • AWS documentation integration for cloud services
  • SQLite support for Core Data and database operations
  • Docker integration for containerized development environments

Security and Performance:

  • Command restrictions to prevent dangerous operations
  • Timeout configurations to prevent hanging operations
  • Retry mechanisms for unreliable network operations
  • Resource limits to prevent excessive resource usage

Technical Integration Details

MCP Communication Flow

Understanding how MCP facilitates communication between Amazon Q and your development tools is crucial for advanced usage. Every time you’re prompted to approve an action from Q, you ought be asking, can I safely approve this each time? Finding the balance between true efficiency and safety is a bit of an artform. In my opinion, the allowed commands in the example above are a reasonably safe starting point.

Performance Optimization Tips

Efficient File Operations

  1. Use specific file patterns:

    {
      "resources": [
        "file://**/Models/*.swift",      // Only model files
        "file://**/ViewModels/*.swift",  // Only view models
        "file://README.md"               // Specific documentation
      ]
    }
    

  2. Implement file size limits:

    {
      "toolsSettings": {
        "fs_read": {
          "maxFileSize": 524288,  // 512KB limit
          "excludePatterns": [
            "**/*.xcassets/**",
            "**/build/**"
          ]
        }
      }
    }
    

Smart Context Management

  1. Use targeted prompts:

    // Instead of this:
    "Help me with my iOS app"
    
    // Use this:
    "Help me implement a penalty timer service in Swift that manages multiple concurrent timers for a lacrosse match 

  2. Leverage conversation history: “Based on the GameViewModel we created earlier, generate the corresponding SwiftUI view that binds to its published properties”

Caching and Persistence

  1. Enable MCP server caching:

    {
      "mcpServers": {
        "filesystem": {
          "env": {
            "FS_CACHE_ENABLED": "true",
            "FS_CACHE_TTL": "3600"
          }
        }
      }
    }
    

  2. Use persistent sessions:

    # Save session context
    q chat --agent swift-development --save-session lacrosse-dev
    
    # Resume session later
    q chat --load-session lacrosse-dev
    

Conclusion

The Transformative Power of AI-Assisted iOS Development

I hope that the example configurations provide some useful insights on how to maximize the effectiveness of Amazon Q + MCP integration for iOS development. The combination of proper configuration, effective troubleshooting, and performance optimization, truly creates a robust development environment that significantly boosts productivity; whereas without the configurable railings detailed above, it was far more hit and miss.

Amazon Q Developer combined with Model Context Protocol (MCP) can practically revolutionize iOS development workflows, especially for a novice such as myself, even without native Xcode integration. AI assistance extends beyond simple code completion, it offers capabilities in understanding a broader context, domain expertise, and complex technical requirements.

Resources and Documentation

Official Amazon Q Developer Resources

Model Context Protocol (MCP) Resources

Swift and iOS Development Resources

Development Tools and Utilities

The Road Ahead

As AI technology continues to evolve, we can expect more sophisticated integration between AI LLM’s and agents, AI agents to other AI agents or domain specific agentic services. We’ll want to navigate this next passage carefully, as the deeper you rely on AI to make decisions, the greater the risk of misunderstanding the decisions being made becomes, or the more the broader context implicit with those decisions is cloaked. For AI assistance in this specific domain, we can to a degree rest on CI processes coupled with testing strategies to mitigate this risk.

In this guide, I’ve endeavored to provide a foundation for adapting the latest wave of tools at our disposal for AI-assisted development. The combination of Amazon Q’s intelligent code understanding with MCP’s exploding tool ecosystem, creates genuine opportunities for improved productivity. Whether you’re building sports applications like our LaxRef example, enterprise software, or consumer apps, these tools can significantly accelerate your development process. If you’re from an infrastructural background like myself, it can also extend the range and improve the quality of code.

Careful investment in learning AI-assisted development techniques pays dividends, not just in immediate productivity gains, but in preparing for a future where AI collaboration becomes the standard in software development. Careless and hapless use of AI, on the other hand, has the potential to not only miss out the true productivity gains on offer, but may well take you out into deeper water and leave you there to sink or 🏊.
Let me know below if this guide has worked for you, or if you have any suggestions & tips for me!


Lew