This project is a Model Context Protocol (MCP) server designed to provide a foundational knowledge base for Large Language Models (LLMs) on the fundamentals of iOS development.
I created this because I found myself frequently reminding my AI models about the core concepts, best practices, and common design patterns for building iOS apps. This server acts as a simple, accessible reference tool that any MCP-compatible AI can use to get up-to-speed on iOS development, ensuring they have a consistent and accurate set of fundamentals to work with.
This is so very much a work-in-progress and a prototype. It is literally vibe-coded to vibe-code better. Take it with a grain of salt, and please feel free to contribute or suggest improvements!
- Best Practices: Access a curated database of best practices for iOS development, covering topics like:
- Architecture (MVVM, Dependency Injection)
- Networking (async/await)
- Accessibility (VoiceOver, Dynamic Type)
- App Store Submission Guidelines
- Swift Concurrency (async/await, Actors, Structured Concurrency)
- Design Patterns: Get clear explanations and code examples for common Swift design patterns, including:
- MVVM with SwiftUI
- Combine for Networking
- Singleton
- Delegate
- Framework Documentation: A (mocked) interface for browsing Apple's developer documentation for frameworks like SwiftUI and UIKit.
- Clone the repository:
git clone <your-repo-url>
- Navigate to the project directory:
cd ios_development_mcp - Install the dependencies:
npm install
Before running the server, you need to compile the TypeScript source code:
npm run buildYou can run the server directly with:
npm startThis will start the MCP server, which will listen for connections on stdio.
You can configure your code editor to use this server, allowing your AI assistant to access its tools directly.
For both Cursor and VSCode, you can add a local MCP server configuration to your user settings.
-
Open Settings:
- Press
Cmd + Shift + P(orCtrl + Shift + Pon Windows) to open the Command Palette. - Search for "Preferences: Open User Settings (JSON)" and select it.
- Press
-
Add Server Configuration:
- Add the following
mcp.serversconfiguration to yoursettings.jsonfile. Make sure to use the absolute path to theindex.jsfile in your project'sdistdirectory.
"mcp.servers": [ { "name": "iOS Dev MCP", "command": "node", "args": ["{path_to_this_repo}/dist/index.js"], "transport": "stdio" } ]
- Add the following
-
Reload and Use:
- Save the
settings.jsonfile and reload your editor. - Your AI assistant (like the one in Cursor) will now have access to the tools provided by this server. You can ask it questions like "What are the best practices for accessibility on iOS?" or "Show me the delegate pattern in Swift," and it will use this server to get the answers.
- Save the
The best way to interact with this server is by using an MCP-compatible client, such as the @modelcontextprotocol/inspector.
-
Start the Inspector: From your project directory, run the following command. This will start the inspector's web UI and automatically connect it to your server.
npx @modelcontextprotocol/inspector node dist/index.js
If you encounter issues, you can also start the inspector manually (
npx @modelcontextprotocol/inspector) and connect from the UI using thestdiotransport with the commandnodeand argumentsdist/index.js. -
Test the Tools: Use the inspector's web UI (usually at
http://localhost:6274) to call the available tools and see their responses. For example, you can get a list of best practices for Swift Concurrency by calling theget_best_practicestool with the following input:{ "topic": "swift-concurrency" }
I want to get the actual full-fetched Apple Developer Documentation in here next, as well as more best practices and design patterns. If you have suggestions or contributions, please see the Contributing section below.
Contributions are welcome! If you have suggestions for additional best practices, design patterns, or improvements to the server, please open an issue or submit a pull request.