智能体
dev.to ·
@Nagarjuna Reddy
我为 Swift、Xcode 和 iOS Simulator 构建 MCP 工具箱
作者介绍其开源 MCP server 项目 ios-agent-mcp,旨在把 iOS 开发环境暴露给 AI coding agent:除源码外,还尝试覆盖 Swift 项目分析、SwiftUI 审查、Swift 并发审查、架构分析,以及用 Xcode 构建、启动 iOS Simulator、安装并启动应用、截图、查看日志、定位失败并修复后重测。文中称这些能力部分已实现、部分在扩展中,未给出仓库链接或实测结果。
AI推荐理由 作者自述正在开发开源 MCP server ios-agent-mcp,目标是让 AI coding agent 不只读写 Swift 源码,还能分析 Swift 项目结构、审查 SwiftUI 架构与 Swift 并发问题、调用 Xcode 构建、启动 iOS Simulator、安装启动应用、截图与查看日志。这是开发者工具与 Agent 落地结合的具体方向,但内容为个人项目自述,未提供代码仓库、实测数据或效果验证,功能多为规划中('currently covers or is expanding toward'),需保留不确定性。
62
正文
AI coding agents are getting surprisingly good at writing Swift.
But generating Swift code is only a small part of actually building an iOS app.
A real iOS development workflow involves much more.
Can an AI agent understand the structure of an existing Swift project?
Can it review SwiftUI architecture?
Can it catch Swift concurrency problems?
Can it build the project with Xcode?
Can it boot an iOS Simulator?
Can it install and launch the app?
Can it capture screenshots, inspect logs, understand a failure, make a fix and test everything again?
That is the problem I’m exploring with ios-agent-mcp.
What is ios-agent-mcp?
ios-agent-mcp is an open source MCP server built specifically for iOS development and AI coding agents.
Instead of only giving an agent access to source code, the idea is to expose more of the actual iOS development environment.
The project currently covers or is expanding toward:
• Swift project analysis
• SwiftUI review
• Swift concurrency review
• architecture analysis
• API availability checks
• App Store readiness auditing
• Xcode project inspection
• xcodebuild
• xcrun
• simctl
• iOS Simulator discovery
• Simulator boot and shutdown
• app installation
• app launching
• screenshot capture
• Simulator and application logs
• device discovery
• build workflows
• test workflows
• debugging workflows
• MCP integration with coding agents
Why build this?
Most AI coding workflows still look something like this:
prompt → generate code → developer runs it → error → copy error back to AI → generate another fix
I want to reduce that manual loop.
A coding agent should eventually be able to work more like this:
project inspection → code analysis → Xcode build → Simulator → launch → observe → logs → debug → fix → test again
The important part is the feedback loop.
Writing code should not be where the agent stops.
Swift and SwiftUI understanding
An iOS specific agent should understand more than syntax.
It should be able to inspect how a project is structured and reason about things such as:
SwiftUI state management
navigation
view architecture
async and await
actors
Sendable issues
MainActor usage
API availability
deployment targets
project configuration
potential App Store problems
The goal is to give the agent tools designed specifically around these problems rather than expecting a general purpose model to infer everything from source files.
Xcode tooling
Another major part of the project is connecting agents to the tools iOS developers already use.
That includes:
xcodebuild
xcrun
simctl
These tools make much more interesting agent workflows possible.
For example, an agent could build a project, inspect the build output, identify the error, modify the relevant code and build again.
That starts moving from simple code generation toward an actual development loop.
iOS Simulator
Simulator automation is one of the areas I’m especially interested in.
An agent should eventually be able to:
discover installed Simulator runtimes
list available devices
boot a device
shut down a device
install an application
launch an application
capture screenshots
read application logs
inspect runtime failures
run tests
This opens up some interesting possibilities.
Imagine giving an agent a task like:
“Build this screen and make sure it works on the latest iPhone Simulator.”
Instead of only returning SwiftUI code, the agent could actually build the project, boot the Simulator, launch the app and inspect the result.
The bigger idea
I don’t want ios-agent-mcp to become just another collection of prompts.
The goal is to build a toolbox that lets coding agents interact with the real iOS development environment.
Eventually I want the workflow to feel closer to:
Understand → Build → Run → Observe → Debug → Fix → Verify
There is still a lot to build, but I think this is one of the more interesting directions for AI assisted iOS development.
Open source
The project is completely open source.
GitHub:
https://github.com/Nagarjuna2997/ios-agent-skill
npm:
https://www.npmjs.com/package/ios-agent-mcp
You can install it through npm and follow the project on GitHub as it evolves.
I’d love feedback
If you work with Swift, SwiftUI, Xcode, MCP servers or AI coding agents, I’d love to hear what you think.
What part of iOS development do current coding agents struggle with the most?
What Xcode or Simulator capability would you want an AI agent to have?
And what should I build next?
swift #ios #mcp #ai