89 lines
2.2 KiB
Markdown
89 lines
2.2 KiB
Markdown
|
|
# MCP for iOS in VS Code
|
|
|
|
You are here: [AI Docs Home](../index.md) > MCP for iOS in VS Code
|
|
|
|
## Contents
|
|
- Overview
|
|
- Prerequisites
|
|
- XcodeBuildMCP Setup
|
|
- Xcode Native MCP Setup
|
|
- Example Prompts
|
|
- Troubleshooting
|
|
- Next Steps
|
|
|
|
---
|
|
|
|
## Overview
|
|
|
|
This guide covers how to set up MCP (Model Context Protocol) automation for iOS development in VS Code. Complete the [VS Code Initial Setup](../vscode-setup.md) first.
|
|
|
|
---
|
|
|
|
## Prerequisites
|
|
- macOS with Xcode 26.3+ installed (for native MCP) or Xcode 13+ (for XcodeBuildMCP)
|
|
- VS Code with GitHub Copilot and Copilot Chat enabled ([see setup guide](../vscode-setup.md))
|
|
- Node.js 18+ (for XcodeBuildMCP)
|
|
- This repo opened in VS Code (workspace root)
|
|
|
|
---
|
|
|
|
## XcodeBuildMCP Setup (External Tool)
|
|
1. Install XcodeBuildMCP:
|
|
```bash
|
|
brew tap getsentry/xcodebuildmcp
|
|
brew install xcodebuildmcp
|
|
```
|
|
2. Ensure `.xcodebuildmcp/config.yaml` is present and configured for your workspace, scheme, and simulator. ([What is config.yaml? See reference and sample.](xcodebuildmcp-config.yaml.md))
|
|
3. Add or update `.vscode/mcp.json`:
|
|
```json
|
|
{
|
|
"servers": {
|
|
"XcodeBuildMCP": {
|
|
"command": "xcodebuildmcp",
|
|
"args": ["mcp"]
|
|
}
|
|
}
|
|
}
|
|
```
|
|
4. Restart VS Code. Copilot Chat will discover MCP tools.
|
|
|
|
---
|
|
|
|
## Xcode Native MCP Setup (Xcode 26.3+)
|
|
1. Open Xcode.
|
|
2. Go to Settings > Intelligence tab.
|
|
3. Enable Model Context Protocol (toggle on Xcode Tools or Allow external connections).
|
|
4. Add or update `.vscode/mcp.json`:
|
|
```json
|
|
{
|
|
"servers": {
|
|
"XcodeNative": {
|
|
"command": "xcrun",
|
|
"args": ["mcpbridge"]
|
|
}
|
|
}
|
|
}
|
|
```
|
|
5. Restart VS Code. Copilot Chat will discover the native MCP server.
|
|
|
|
---
|
|
|
|
## Example Prompts
|
|
- "Build and run ToyotaOneApp on the iPhone 17 Pro Max simulator."
|
|
- "Run all UI tests and summarize failures."
|
|
- "Take a screenshot of the home screen."
|
|
|
|
---
|
|
|
|
## Troubleshooting
|
|
- If MCP tools are not available, confirm `.vscode/mcp.json` is present and correct.
|
|
- For XcodeBuildMCP, check `.xcodebuildmcp/config.yaml` for correct paths and scheme.
|
|
- Simulator not found? Boot it in Xcode or Simulator.app first.
|
|
|
|
---
|
|
|
|
## Next Steps
|
|
- For general VS Code setup, see [VS Code Initial Setup](../vscode-setup.md).
|
|
- For iOS basics, see [iOS Setup](ios.md).
|