Welcome to the second demo of this lesson and the final demo of this module. In this demo, you’ll learn how to connect a new IDE or an AI tool, in this case, Cursor, to Xcode.
The reason you’d want to do this is Xcode is providing a number of capabilities, as the one you’ve seen in the previous demo, where it was able to let the AI model control the simulator. Since the simulator is part of development tools from Xcode, it’s part of what is called an MCP server. MCP is short for Model Context Protocol. It’s something that you can have or plug-ins to connect to your AI agents to improve their capabilities or give them specialized extensions. In this case, the extension is to control Xcode and to control the simulator through Xcode.
To do this in Cursor, let’s go to customization. I’ll create a new. It opened a text file. You’ll find in the materials file, a file called mcp_config. It has a very small JSON, copy it, and paste it here. Let me make this a little bit bigger. Here you go. It’s very short. You can find even this online, and many MCPs expose how to connect them to different tools. Let’s save and put this back.
I already have Xcode open, and it will show an alert to confirm that you have an agent that wants to connect to Xcode’s tools. Feel free to allow it. It’s important to allow it to allow Cursor to do its work. So here you go, allow. Let’s close the file and put the simulator back. Here you can see the available tools. If I expand this, you’re going to see all the capabilities or the different services that the MCP is exposing to Cursor. You can go through them.
Let’s try it out. Go to a new chat. Similar to before, run the app using Xcode tools on iPhone 17 Pro simulator, then describe what you can see on the main screen.
run the app using Xcode tools on iPhone 17 Pro simulator, then describe what you can see on the main screen.
The first time you use the tools, you’ll probably get a number of different permissions. Feel free to select always run. I’ve done this before, that’s why the permissions are not showing up now. You can see here it’s showing the different tools explored, all the different ones for the multiple steps. Xcode launched. Let’s keep it open. Go back to Cursor. Prepare device, always run. Simulator is launching. Here’s the first screen. Let’s see what it finds.
Here we go. It found all the information needed, and before writing the response, it actually ended the session from the simulator by stopping the build directly from Xcode, and here it’s printing down information. There’s no point running the same game again as before, but feel free if you want to do that, but better not to save your tokens.
This can be very useful for running automated tests or even allowing your AI agents to explore your application, find different corner cases, think as if it’s a person, or can even teach it how to interact with application for different purposes. Can be very useful, but it is also a little bit more expensive in terms of token consumption, so use it carefully.
Thank you for listening to this demo. Thank you for covering all the lessons. You learned a lot. Set up Xcode, set up Cursor, ran your first prompts on the AI agents, figured out how this application or from the starter project looked like with the help of an AI agent. You implemented two features with the different AI tools, and above all, you gave control to the AI agent from Xcode and from Cursor to control the game that you’re building. You’ve covered a lot of grounds, but we’re just getting started.