mcp-server-demo

iHackSubhodip/mcp-server-demo

3.4

If you are the rightful owner of mcp-server-demo and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

A production-ready iOS automation MCP server that transforms monolithic automation scripts into maintainable, extensible architecture.

iOS MCP Server

Modern iOS automation server built with FastMCP 2.0 and clean architecture

A production-ready iOS automation MCP server built with FastMCP 2.0, offering both local and cloud deployment options. Features clean architecture, comprehensive error handling, and professional logging.

šŸ“ŗ Demo Video

šŸŽ¬ Watch the Complete Demo: iOS MCP Server in Action

✨ Features

  • šŸš€ FastMCP 2.0 - Modern Python-first MCP implementation
  • 🌐 Cloud Deployment - Ready for Railway, Heroku, or other platforms
  • šŸ“± Real iOS Automation - Appium + WebDriverAgent integration
  • šŸ—ļø Clean Architecture - SOLID principles and design patterns
  • šŸŽØ Beautiful Logging - Colored console output with emojis
  • šŸ”§ Type-Safe - Comprehensive type hints throughout
  • šŸ”Œ Extensible - Plugin-style tool system

šŸš€ Quick Start

Option 1: Remote Server (Recommended)

Use the hosted version on Railway - no local setup required:

{
  "mcpServers": {
    "ios-automation-railway": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "https://mcp-server-demo-production.up.railway.app/sse/"
      ]
    }
  }
}

Option 2: Local Development

  1. Prerequisites

    • macOS (required for iOS automation)
    • Python 3.11+
    • Xcode with iOS Simulator
    • Node.js (for Appium)
  2. Installation

    git clone https://github.com/iHackSubhodip/mcp-server-demo.git
    cd mcp-server-demo
    pip install -r ios_mcp_server/requirements.txt
    
  3. Claude Desktop Configuration

    {
      "mcpServers": {
        "ios-automation-local": {
          "command": "python",
          "args": ["-m", "ios_mcp_server.main"],
          "cwd": "/path/to/mcp-server-demo"
        }
      }
    }
    

šŸ—ļø Architecture

Directory Structure

ios_mcp_server/
ā”œā”€ā”€ main.py                     # Entry point
ā”œā”€ā”€ fastmcp_server.py          # FastMCP 2.0 server
ā”œā”€ā”€ config/
│   └── settings.py           # Configuration management
ā”œā”€ā”€ automation/               # Core automation services
│   ā”œā”€ā”€ appium_client.py     # iOS automation client
│   ā”œā”€ā”€ screenshot_service.py # Screenshot handling
│   └── simulator_manager.py # Simulator management
ā”œā”€ā”€ tools/                   # MCP tools
│   ā”œā”€ā”€ base_tool.py        # Abstract base class
│   ā”œā”€ā”€ tool_registry.py    # Tool management
│   ā”œā”€ā”€ appium_tap_type_tool.py
│   ā”œā”€ā”€ find_and_tap_tool.py
│   ā”œā”€ā”€ launch_app_tool.py
│   └── screenshot_tool.py
ā”œā”€ā”€ utils/                   # Shared utilities
│   ā”œā”€ā”€ logger.py           # Colored logging
│   ā”œā”€ā”€ exceptions.py       # Custom exceptions
│   └── command_runner.py   # Async command execution
ā”œā”€ā”€ server/                  # Traditional MCP server
ā”œā”€ā”€ screenshots/             # Screenshot storage
ā”œā”€ā”€ Dockerfile              # Container deployment
ā”œā”€ā”€ Procfile                # Railway deployment
└── requirements.txt        # Dependencies

šŸ”§ Available Tools

take_screenshot

Capture iOS simulator screenshots

{
  "filename": "optional_name.png",
  "device_id": "booted"
}

launch_app

Launch iOS applications

{
  "bundle_id": "com.apple.mobilesafari",
  "device_id": "booted"
}

find_and_tap

Find and tap UI elements with smart automation

{
  "accessibility_id": "submitButton",
  "take_screenshot": true,
  "dismiss_after_screenshot": false
}

appium_tap_and_type

Enhanced text input with element finding

{
  "text": "Hello World!",
  "element_type": "textField",
  "timeout": 10
}

list_simulators

List available iOS simulators

{}

get_server_status

Check server and Appium status

{}

šŸ› ļø Development

Local FastMCP Development

# Install dependencies
pip install -r ios_mcp_server/requirements.txt

# Run FastMCP server
python ios_mcp_server/fastmcp_server.py

Traditional MCP Development

# Run traditional MCP server
python -m ios_mcp_server.main

Appium Setup

# Install Appium
npm install -g appium
appium driver install xcuitest

# Start Appium server
appium server --port 4723

🌐 Cloud Deployment

This server is deployed on Railway and accessible via:

  • HTTP Endpoint: https://mcp-server-demo-production.up.railway.app/
  • SSE Endpoint: https://mcp-server-demo-production.up.railway.app/sse/

The cloud deployment simulates iOS automation responses for demonstration purposes.

šŸ“Š Key Improvements

FeatureTraditional MCPFastMCP 2.0
SetupComplex configurationSimple Python decorators
Type SafetyManual validationBuilt-in Pydantic models
Error HandlingBasic try-catchRich context and logging
DeploymentLocal onlyCloud-ready with Railway
DevelopmentBoilerplate heavyClean, intuitive API

šŸ” Troubleshooting

Simulator Issues

# List available simulators
xcrun simctl list devices

# Boot a simulator
xcrun simctl boot "iPhone 16 Pro"

Appium Connection

# Check Appium status
curl http://localhost:4723/status

# Restart Appium
pkill -f appium && appium server --port 4723

šŸ“ Dependencies

Core dependencies:

  • fastmcp>=2.9.2 - FastMCP 2.0 framework
  • mcp>=1.0.0 - Traditional MCP protocol
  • aiohttp>=3.9.0 - HTTP client for automation
  • appium-python-client>=3.0.0 - iOS automation
  • pydantic>=2.4.0 - Data validation

šŸ¤ Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Follow the existing architecture patterns
  4. Add comprehensive error handling
  5. Submit a pull request

šŸ“„ License

This project is licensed under the MIT License - see the file for details.