Skip to main content

IDB-MCP

PyPI Python Versions License

An open-source MCP server and Python library that wraps Facebook IDB to control iOS simulators for automation. Built by AskUI.

This project is based on the Facebook IDB CLI (fb-idb). See the GitHub repository (facebook/idb) and the Python package (fb-idb on PyPI).

What it is

  • MCP server: Exposes a set of iOS automation tools (list/select device, screenshot, tap, swipe, type, etc.) over MCP transports (HTTP, SSE or stdio) using fastmcp.
  • Python module: Import to manage and control iOS simulators programmatically.

Table of contents

Key features

  • Device management 🔧: list devices, select by UDID or name, boot/shutdown, kill IDB.
  • Input control 👆: tap, swipe, type text, tap keys, tap buttons.
  • Screen utilities 🖼️: capture screenshots, query screen size, get view description.
  • Image/coord scaling 📐: optional scaling to a target viewport for consistent coordinates.

Limitations

⚠️ Only iOS simulators are supported for UI control. Due to iOS security constraints, idb cannot interact with or automate the UI on real, physical devices. AskUI offers a solution for real-device UI automation—contact support@askui.com for more information.

Requirements

  • Runs on macOS only.

  • Python >= 3.10

  • Xcode with iOS Simulators installed and configured.

    • Verify simulators are visible:

      xcrun xctrace list devices
      
  • Facebook IDB companion (using brew):

    brew tap facebook/fb
    brew install idb-companion
    

Install

pip install idb-mcp

Quick start (CLI)

Why MCP?

Using MCP lets your favorite AI tools connect to idb-mcp seamlessly. The client handles launching and communicating with the server, so you can ask for screenshots, taps, swipes, and more—without leaving your workflow. ✨

Start MCP server

The package installs an idb-mcp command.

# Start MCP server over HTTP (default host/port managed by fastmcp)
idb-mcp start http
# Or start over SSE
idb-mcp start sse
# Or start over stdio
idb-mcp start stdio
# Optionally scale images/coordinates to a given target viewport (width height)
idb-mcp start http --target-screen-size 1280 800
# Discover available options
idb-mcp --help
idb-mcp start --help

Programmatic usage (Python)

from idb_mcp import IDBController, IOSDevice

# Initialize the IDB controller
controller = IDBController()
# Select the device by name
selected_device: IOSDevice = controller.select_device_by_name("iPhone 17 Pro Max")
# Boot the selected device
selected_device.boot()
# Get the current view description of the selected device
current_view_description: str = selected_device.get_current_view_description()
print(current_view_description)
# Shutdown the selected device
selected_device.shutdown()

Add to your favorite tools

You can use idb-mcp in any MCP-compatible client (e.g., Cursor, Claude Desktop) by adding a server entry to your client's MCP config. The client will launch the server on demand.

Steps:

  • Open your client's MCP configuration file (location varies by client).
  • Add an entry named askui-idb-mcp that starts the server over STDIO and sets a recommended target screen size.

Example configuration:

using uv (Make sure you have uv installed):

{
  "mcpServers": {
    "askui-idb-mcp": {
      "command": "uvx",
      "args": [
        "idb-mcp@latest",
        "start",
        "stdio",
        "--target-screen-size",
        "1280",
        "800"
      ]
    }
  }
}

Alternative (if idb-mcp is directly on your PATH without uv):

{
  "mcpServers": {
    "askui-idb-mcp": {
      "command": "idb-mcp",
      "args": [
        "start",
        "stdio",
        "--target-screen-size",
        "1280",
        "800"
      ]
    }
  }
}

Notes:

  • The --target-screen-size 1280 800 setting improves coordinate reliability, especially for models like Claude.

Configuration

  • Target screen size 📐: You can scale screenshots and coordinate inputs to a target viewport when starting the MCP server via CLI (--target-screen-size W H) or programmatically (target_screen_size=(W, H)).
  • Mode 📐: You can start the MCP server in stdio, http, or sse mode.
  • Port 📐: You can start the MCP server on a specific port via CLI (--port PORT) or programmatically (port=PORT).

Troubleshooting

  • Cannot see devices 🔍: Make sure you have an iOS simulator or device connected and running. Verify with:

    xcrun xctrace list devices
    

    Example output:

    iPhone 17 Simulator (26.0) (32E2219C-ED40-452F-9A4D-XXXXXXX)
    iPhone 17 Pro Simulator (26.0) (764CCCB7-D84D-46EC-B62D-XXXXXXX)
    iPhone 17 Pro Max Simulator (26.0) (065382B5-56B4-4864-8174-XXXXXXX)
    
  • High-resolution screenshots with some LLMs 🧠: Some LLM backends struggle to process very high-resolution images, resulting in poor coordinate detection or tapping errors. Use rescaling via --target-screen-size (or target_screen_size in Python) to downscale screenshots and coordinates. For Claude models, we recommend 1280 800.

Development

This repository uses PDM and Ruff for dev tooling.

# Install dev deps
pip install pdm
pdm install --with dev

# Lint / Format
pdm run lint-check
pdm run format-check
# Type check
pdm run type-check

Contributing

Contributions are welcome! 🙌 Please open an issue or pull request on GitHub. Questions? Email us at support@askui.com.

License

MIT License

Links

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

idb_mcp-0.1.2.tar.gz (18.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

idb_mcp-0.1.2-py3-none-any.whl (18.0 kB view details)

Uploaded Python 3

File details

Details for the file idb_mcp-0.1.2.tar.gz.

File metadata

  • Download URL: idb_mcp-0.1.2.tar.gz
  • Upload date:
  • Size: 18.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: pdm/2.26.6 CPython/3.14.3 Darwin/24.6.0

File hashes

Hashes for idb_mcp-0.1.2.tar.gz
Algorithm Hash digest
SHA256 4c295fdd8b5f36c0af12efdeafdae41a793efce6b97854b79683344bb75e0747
MD5 51be9befbb81a31cfc2dfef88cc56540
BLAKE2b-256 a9ce1cc63b6448d1ffd8cfa2c04d14712a2353841111997cd4a461d7639772cc

See more details on using hashes here.

File details

Details for the file idb_mcp-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: idb_mcp-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 18.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: pdm/2.26.6 CPython/3.14.3 Darwin/24.6.0

File hashes

Hashes for idb_mcp-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4c95948247c0409221e70e591ba492be633f6bcba1bd73c655628ee9c7f7a7b1
MD5 95750ddba8a16dd298cf6084b52ecabf
BLAKE2b-256 875dd12a301d405502f72226951476fbf30c9b0bd5684b4a851d2bb23a22ebca

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 files

0.1.1

2 files

0.1.0

2 files

0.0.8

2 files

0.0.7

2 files

0.0.6

2 files

0.0.5

2 files

0.0.4

2 files

0.0.3

2 files

0.0.2

2 files

0.0.1

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page