Skip to content

ufukkaraca/ios_development_mcp

Repository files navigation

iOS Development MCP Server

Introduction

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!

Features

  • 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.

Getting Started

Prerequisites

Installation

  1. Clone the repository:
    git clone <your-repo-url>
  2. Navigate to the project directory:
    cd ios_development_mcp
  3. Install the dependencies:
    npm install

Build

Before running the server, you need to compile the TypeScript source code:

npm run build

Running the Server

You can run the server directly with:

npm start

This will start the MCP server, which will listen for connections on stdio.

Usage with Editors

You can configure your code editor to use this server, allowing your AI assistant to access its tools directly.

Cursor / VSCode

For both Cursor and VSCode, you can add a local MCP server configuration to your user settings.

  1. Open Settings:

    • Press Cmd + Shift + P (or Ctrl + Shift + P on Windows) to open the Command Palette.
    • Search for "Preferences: Open User Settings (JSON)" and select it.
  2. Add Server Configuration:

    • Add the following mcp.servers configuration to your settings.json file. Make sure to use the absolute path to the index.js file in your project's dist directory.
    "mcp.servers": [
        {
            "name": "iOS Dev MCP",
            "command": "node",
            "args": ["{path_to_this_repo}/dist/index.js"],
            "transport": "stdio"
        }
    ]
  3. Reload and Use:

    • Save the settings.json file 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.

Manual Testing with the Inspector

The best way to interact with this server is by using an MCP-compatible client, such as the @modelcontextprotocol/inspector.

  1. 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 the stdio transport with the command node and arguments dist/index.js.

  2. 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 the get_best_practices tool with the following input:

    {
      "topic": "swift-concurrency"
    }

Next Steps

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.

Contributing

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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors