MCP Server for iOS UI inspection — lets any AI agent (Claude Code, Cursor, Codex, etc.) inspect live iOS app UI hierarchy, attributes, and screenshots via LookinServer, no Lookin.app required.
- iOS App integrated with LookinServerMCP, running on simulator or device
- Node.js 18+
Add the following to your Podfile:
pod 'LookinServerMCP', :configurations => ['Debug']Only included in Debug builds — safe to leave in your Podfile permanently.
The MCP Server supports both iOS simulators and physical devices:
iOS Simulator:
AI Agent (Claude Code / Cursor / Codex / ...)
↓ stdio (MCP protocol)
lookin-mcp-ios (Node.js)
↓ HTTP local port
LookinServer (embedded in iOS App)
Physical Device:
AI Agent (Claude Code / Cursor / Codex / ...)
↓ stdio (MCP protocol)
lookin-mcp-ios (Node.js)
↓ native usbmuxd socket (/var/run/usbmuxd)
↓ TCP proxy on :47191
LookinServer (embedded in iOS App)
- Single device: Automatically connects when the app starts
- Multiple devices: Prompts user to select device via
lookin_connect_devicetool - Device events: Automatically reconnects when a physical device is unplugged (falls back to simulator)
claude mcp add --scope user lookin -- npx -y lookin-mcp-iosAdd to ~/.cursor/mcp.json (global) or .cursor/mcp.json in your project root:
{
"mcpServers": {
"lookin": {
"command": "npx",
"args": ["-y", "lookin-mcp-ios"]
}
}
}Add to ~/.codex/config.yaml:
mcp_servers:
- name: lookin
command: npx
args:
- -y
- lookin-mcp-iosLists all connectable iOS targets: USB physical devices and booted simulators.
Parameters: None
Response: JSON object containing:
activeTarget— currently connected target (type:"simulator"or"physical")devices— array of available devices, each with:udid— unique device identifiername— device name (e.g. "iPhone 15 Pro")type— device type ("simulator"or"physical")
hint— usage instructions
Example response:
{
"activeTarget": { "type": "simulator" },
"devices": [
{ "udid": "ABC123...", "name": "iPhone 16 Pro", "type": "simulator" },
{ "udid": "XYZ789...", "name": "John's iPhone", "type": "physical" }
],
"hint": "Found 2 device(s). Use lookin_connect_device with a udid to connect."
}Switch the connection target to a physical device or simulator.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
target |
string | Yes | Device UDID (from lookin_list_devices) or "simulator" to use the default simulator |
Response: Confirmation message and connection status
Returns the full UI view hierarchy tree of the running iOS app.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
includeSystemViews |
boolean | No | Reserved parameter, no filtering effect when connected directly to LookinServer |
maxDepth |
number | No | Maximum hierarchy depth. Returns all levels if omitted |
Example response:
{"appName":"Demo","totalViews":12,"hierarchy":[{"oid":4393842688,"className":"UIWindow","frame":[0,0,390,844],"children":[{"oid":4393842944,"className":"MyViewController","frame":[0,0,390,844],"children":[]}]}]}Node fields:
oid— unique view identifier, used as input for other toolsclassName— class nameframe— position and size[x, y, width, height]hidden— only present whentruealpha— only present when not 1.0
Returns all UI attributes of a specified view.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
oid |
number | Yes | View ID (from lookin_get_hierarchy) |
Response: Attributes grouped by group → section → attribute, each containing:
identifier— attribute identifiersetterSelector— setter method name, e.g.setBackgroundColor:attrType— value type enumvalue— current value
attrType values:
| Value | Type |
|---|---|
| 14 | BOOL |
| 12 | float |
| 13 | double |
| 5 | NSInteger |
| 20 | CGRect |
| 17 | CGPoint |
| 19 | CGSize |
| 22 | UIEdgeInsets |
| 23 | UIColor (RGBA array, 0~1) |
| 25 | enum int |
| 26 | enum long |
| 24 | NSString |
Captures a screenshot of a specified view from the live iOS app rendering.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
oid |
number | No | View ID. If omitted, automatically uses the root window for a full-screen screenshot |
Response: MCP image content in PNG format, viewable directly by the AI agent.
1. lookin_list_devices → list available iOS targets (simulators and physical devices)
2. lookin_connect_device(target) → select the target device (if multiple devices available)
3. lookin_get_hierarchy → get the view tree and find the target view's oid
4. lookin_get_attributes(oid) → inspect all attributes of that view
5. lookin_get_screenshot(oid) → capture a screenshot to see the current UI state
If only one device is available, steps 1-2 are handled automatically at startup.