Mobile MCP: let AI agents drive your iOS and Android apps. MCP server for simulators, emulators and real devices. Works with Claude Code, Codex, Cursor and any MCP client.
TypeScript agentandroidandroid-automationappium-alternativeclaude-codecodexcursoremulatoriosios-automationmcpmcp-servermobilemobile-automationmobile-testingreal-devicesimulatorskills
feat: added 'list crashes' tool, replaced use of WebdriverAgent with iOS Device Kit on Simulator (#325)
Gil Megidish2e994b52ee77
diff --git a/.github/workflows/build.yml b/.github/workflows/build.ymlindex 99e4935..28bbe05 100644--- a/.github/workflows/build.yml+++ b/.github/workflows/build.yml@@ -1,7 +1,7 @@name: Buildpermissions:id-token: write- contents: write+ contents: readon:push:@@ -16,20 +16,14 @@ on:jobs:build:permissions:- id-token: write # Required for npm trusted publishing with OIDC- contents: write+ id-token: write+ contents: readruns-on: ubuntu-lateststeps:- uses: actions/checkout@v5- - name: Setup Java- uses: actions/setup-java@v5- with:- distribution: 'temurin'- java-version: '17'-- name: Use Node.js 24uses: actions/setup-node@v5with:@@ -72,4 +66,3 @@ jobs:sed -i "s/{{VERSION}}/$VERSION/g" server.jsonmcp-publisher publishmcp-publisher logout-diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 0aec434..c6d35de 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -1,3 +1,11 @@+## [0.0.53](https://github.com/mobile-next/mobile-mcp/releases/tag/0.0.53) (2026-05-01)+* Server: Add `mobile_list_crashes` tool to list crash reports on a device+* Server: Add `mobile_get_crash` tool to retrieve full crash report content+* Server: Upgrade mobilecli from 0.2.0 to 0.3.68+* iOS: Replaced use of WebdriverAgent with iOS Device Kit (open source, apache license)+* CI: Restrict `contents` permission to `read`+* CI: Remove Java setup step from build workflow+## [0.0.52](https://github.com/mobile-next/mobile-mcp/releases/tag/0.0.52) (2026-04-13)* Server: Block cross-origin requests on SSE transport ([#311](https://github.com/mobile-next/mobile-mcp/pull/311))* Server: Warn when SSE server starts without `MOBILEMCP_AUTH` set ([#311](https://github.com/mobile-next/mobile-mcp/pull/311))diff --git a/SECURITY.md b/SECURITY.mdindex dd70f90..3dca51b 100644--- a/SECURITY.md+++ b/SECURITY.md@@ -8,6 +8,16 @@ All versions of this project are currently being supported with security updates| ------- | ------------------ || All | :white_check_mark: |+## Important notes regarding use of mobile-mcp++**mobile-mcp** is an MCP server for controlling a mobile device. Device may be a real iOS device, real Android device, an iOS Simulator or Android+Emulator.++You may use mobile-mcp for various tasks, such as app development, marketing automation, quality assurance and so on.++As a rule of thumb, verify which tools your Agent is invoking. It has access to the device or simulator, it may operate the device to the security+scope of that device. It is suggested that you use a device that is purposed for this use.+## Reporting a VulnerabilityTo report a security vulnerability, please join our Slack channel at http://mobilenexthq.com/join-slack and DM the moderators with details of the vulnerability.diff --git a/package-lock.json b/package-lock.jsonindex ee50cf0..d232ca2 100644--- a/package-lock.json+++ b/package-lock.json@@ -46,7 +46,7 @@"node": ">=18"},"optionalDependencies": {- "mobilecli": "0.2.0"+ "mobilecli": "0.3.68"}},"node_modules/@babel/code-frame": {@@ -3599,9 +3599,9 @@}},"node_modules/hono": {- "version": "4.12.12",- "resolved": "https://registry.npmjs.org/hono/-/hono-4.12.12.tgz",- "integrity": "sha512-p1JfQMKaceuCbpJKAPKVqyqviZdS0eUxH9v82oWo1kb9xjQ5wA6iP3FNVAPDFlz5/p7d45lO+BpSk1tuSZMF4Q==",+ "version": "4.12.16",+ "resolved": "https://registry.npmjs.org/hono/-/hono-4.12.16.tgz",+ "integrity": "sha512-jN0ZewiNAWSe5khM3EyCmBb250+b40wWbwNILNfEvq84VREWwOIkuUsFONk/3i3nqkz7Oe1PcpM2mwQEK2L9Kg==","license": "MIT","engines": {"node": ">=16.9.0"@@ -4717,9 +4717,9 @@}},"node_modules/mobilecli": {- "version": "0.2.0",- "resolved": "https://registry.npmjs.org/mobilecli/-/mobilecli-0.2.0.tgz",- "integrity": "sha512-kVRRu+az5zDC2Y0iEBwW659HdItEPfNZHk/zrVQubdgP2eCztECqcZcYeT98EmGvjQZnmQGo1Vt2QvxIIcPlug==",+ "version": "0.3.68",+ "resolved": "https://registry.npmjs.org/mobilecli/-/mobilecli-0.3.68.tgz",+ "integrity": "sha512-0waRE3hqwyB1OVYzStqgojizOr+ToIYG7TkunBE32JtP4qOCi8TfY71N6MDHRinxJsoEfxXL2pQJfOr12gZ2RA==","license": "MIT","optional": true,"bin": {diff --git a/package.json b/package.jsonindex 8241b02..89ad89c 100644--- a/package.json+++ b/package.json@@ -34,7 +34,7 @@"zod-to-json-schema": "3.25.0"},"optionalDependencies": {- "mobilecli": "0.2.0"+ "mobilecli": "0.3.68"},"devDependencies": {"@eslint/eslintrc": "^3.2.0",diff --git a/src/mobilecli.ts b/src/mobilecli.tsindex f917129..a94ab0b 100644--- a/src/mobilecli.ts+++ b/src/mobilecli.ts@@ -2,6 +2,32 @@ import { existsSync } from "node:fs";import { dirname, join, sep } from "node:path";import { execFileSync, spawn, ChildProcess } from "node:child_process";+export interface MobilecliCrashEntry {+ processName: string;+ timestamp: string;+ id: string;+}++export interface MobilecliCrashesListResponse {+ status: "ok";+ data: MobilecliCrashEntry[];+}++export interface MobilecliCrashGetResponse {+ status: "ok";+ data: {+ content: string;+ id: string;+ };+}++export interface MobilecliAgentStatusResponse {+ status: "ok" | "fail";+ data: {+ message: string;+ };+}+export interface MobilecliDevicesOptions {includeOffline?: boolean;platform?: "ios" | "android";@@ -111,16 +137,35 @@ export class Mobilecli {}}- fleetListDevices(): string {- return this.executeCommand(["fleet", "list-devices"]);+ remoteListDevices(): string {+ return this.executeCommand(["remote", "list-devices"]);+ }++ remoteAllocate(platform: "ios" | "android"): string {+ return this.executeCommand(["remote", "allocate", "--platform", platform]);+ }++ remoteRelease(deviceId: string): string {+ return this.executeCommand(["remote", "release", "--device", deviceId]);+ }++ crashesList(deviceId: string): MobilecliCrashesListResponse {+ const output = this.executeCommand(["device", "crashes", "list", "--device", deviceId]);+ return JSON.parse(output) as MobilecliCrashesListResponse;+ }++ crashesGet(deviceId: string, id: string): MobilecliCrashGetResponse {+ const output = this.executeCommand(["device", "crashes", "get", id, "--device", deviceId]);+ return JSON.parse(output) as MobilecliCrashGetResponse;}- fleetAllocate(platform: "ios" | "android"): string {- return this.executeCommand(["fleet", "allocate", "--platform", platform]);+ agentStatus(deviceId: string): MobilecliAgentStatusResponse {+ const output = this.executeCommand(["agent", "status", "--device", deviceId]);+ return JSON.parse(output) as MobilecliAgentStatusResponse;}- fleetRelease(deviceId: string): string {- return this.executeCommand(["fleet", "release", "--device", deviceId]);+ agentInstall(deviceId: string): void {+ this.executeCommand(["agent", "install", "--device", deviceId]);}getDevices(options?: MobilecliDevicesOptions): MobilecliDevicesResponse {diff --git a/src/server.ts b/src/server.tsindex 64a833a..22565ec 100644--- a/src/server.ts+++ b/src/server.ts@@ -118,6 +118,7 @@ export const createMcpServer = (): McpServer => {Product: "mobile-mcp",Version: getAgentVersion(),NodeVersion: process.version,+ CI: process.env.CI || "0",};const clientName = getClientName();@@ -147,6 +148,7 @@ export const createMcpServer = (): McpServer => {const mobilecli = new Mobilecli();const activeRecordings = new Map<string, ActiveRecording>();+ const agentVerifiedSimulators = new Set<string>();posthog("launch", {}).then();const ensureMobilecliAvailable = (): void => {@@ -191,6 +193,15 @@ export const createMcpServer = (): McpServer => {if (response.status === "ok" && response.data && response.data.devices) {for (const device of response.data.devices) {if (device.id === deviceId) {+ if (!agentVerifiedSimulators.has(deviceId)) {+ const agentStatus = mobilecli.agentStatus(deviceId);+ if (agentStatus.status === "fail") {+ mobilecli.agentInstall(deviceId);+ }++ agentVerifiedSimulators.add(deviceId);+ }+return new MobileDevice(deviceId);}}@@ -271,21 +282,21 @@ export const createMcpServer = (): McpServer => {if (process.env.MOBILEFLEET_ENABLE === "1") {tool(- "mobile_list_fleet_devices",- "List Fleet Devices",+ "mobile_list_remote_devices",+ "List Remote Devices","List devices available in the remote fleet",{},{ readOnlyHint: true },async ({}) => {ensureMobilecliAvailable();- const result = mobilecli.fleetListDevices();+ const result = mobilecli.remoteListDevices();return result;});tool(- "mobile_allocate_fleet_device",- "Allocate Fleet Device",+ "mobile_allocate_remote_device",+ "Allocate Remote Device","Reserve a device from the remote fleet",{platform: z.enum(["ios", "android"]).describe("The platform to allocate a device for"),@@ -293,22 +304,22 @@ export const createMcpServer = (): McpServer => {{ destructiveHint: true },async ({ platform }) => {ensureMobilecliAvailable();- const result = mobilecli.fleetAllocate(platform);+ const result = mobilecli.remoteAllocate(platform);return result;});tool(- "mobile_release_fleet_device",- "Release Fleet Device",+ "mobile_release_remote_device",+ "Release Remote Device","Release a device back to the remote fleet",{- device: z.string().describe("The device identifier to release back to the fleet"),+ device: z.string().describe("The device identifier to release back to the remote fleet"),},{ destructiveHint: true },async ({ device }) => {ensureMobilecliAvailable();- const result = mobilecli.fleetRelease(device);+ const result = mobilecli.remoteRelease(device);return result;});@@ -796,5 +807,36 @@ export const createMcpServer = (): McpServer => {});+ tool(+ "mobile_list_crashes",+ "List Crash Reports",+ "List crash reports available on the device",+ {+ device: z.string().describe("The device identifier to use. Use mobile_list_available_devices to find which devices are available to you."),+ },+ { readOnlyHint: true },+ async ({ device }) => {+ ensureMobilecliAvailable();+ const response = mobilecli.crashesList(device);+ return JSON.stringify(response.data);+ }+ );++ tool(+ "mobile_get_crash",+ "Get Crash Report",+ "Get the full content of a crash report by its ID. Use mobile_list_crashes to find available crash IDs.",+ {+ device: z.string().describe("The device identifier to use. Use mobile_list_available_devices to find which devices are available to you."),+ id: z.string().describe("The crash report ID to retrieve"),+ },+ { readOnlyHint: true },+ async ({ device, id }) => {+ ensureMobilecliAvailable();+ const response = mobilecli.crashesGet(device, id);+ return response.data.content;+ }+ );+return server;};