Skip to content

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.

feat: added mobile_double_tap tool

Saksham Sahgald8aac0070b01
diff --git a/.gitignore b/.gitignore
index 49aee41..309cdce 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,3 +2,4 @@
node_modules
lib
.nyc_output
+.vscode
\ No newline at end of file
diff --git a/src/android.ts b/src/android.ts
index 055727c..1439dd5 100644
--- a/src/android.ts
+++ b/src/android.ts
@@ -384,6 +384,12 @@ export class AndroidRobot implements Robot {
this.adb("shell", "input", "swipe", `${x}`, `${y}`, `${x}`, `${y}`, "500");
}
+ public async doubleTap(x: number, y: number): Promise<void> {
+ await this.tap(x, y);
+ await new Promise(r => setTimeout(r, 100)); // short delay
+ await this.tap(x, y);
+ }
+
public async setOrientation(orientation: Orientation): Promise<void> {
const value = orientation === "portrait" ? 0 : 1;
diff --git a/src/ios.ts b/src/ios.ts
index ccd4a8a..8b0d318 100644
--- a/src/ios.ts
+++ b/src/ios.ts
@@ -191,6 +191,11 @@ export class IosRobot implements Robot {
await wda.tap(x, y);
}
+ public async doubleTap(x: number, y: number): Promise<void> {
+ // const wda = await this.wda();
+ // await wda.tap(x, y);
+ }
+
public async longPress(x: number, y: number): Promise<void> {
const wda = await this.wda();
await wda.longPress(x, y);
diff --git a/src/iphone-simulator.ts b/src/iphone-simulator.ts
index 6b3b1b2..10e7d9c 100644
--- a/src/iphone-simulator.ts
+++ b/src/iphone-simulator.ts
@@ -251,6 +251,13 @@ export class Simctl implements Robot {
return wda.tap(x, y);
}
+ public async doubleTap(x: number, y: number): Promise<void> {
+ // const wda = await this.wda();
+ // await wda.tap(x, y);
+ // await new Promise(r => setTimeout(r, 100)); // short delay
+ // await wda.tap(x, y);
+ }
+
public async longPress(x: number, y: number) {
const wda = await this.wda();
return wda.longPress(x, y);
diff --git a/src/robot.ts b/src/robot.ts
index becea03..d6fec4f 100644
--- a/src/robot.ts
+++ b/src/robot.ts
@@ -114,6 +114,11 @@ export interface Robot {
*/
tap(x: number, y: number): Promise<void>;
+ /**
+ * Tap on a specific coordinate on the screen.
+ */
+ doubleTap(x: number, y: number): Promise<void>;
+
/**
* Long press on a specific coordinate on the screen.
*/
diff --git a/src/server.ts b/src/server.ts
index 119695d..098d8c4 100644
--- a/src/server.ts
+++ b/src/server.ts
@@ -294,6 +294,21 @@ export const createMcpServer = (): McpServer => {
}
);
+ tool(
+ "mobile_double_tap_on_screen",
+ "Double-tap on the screen at given x,y coordinates.",
+ {
+ device: z.string().describe("The device identifier to use. Use mobile_list_available_devices to find which devices are available to you."),
+ x: z.number().describe("The x coordinate to double-tap, in pixels"),
+ y: z.number().describe("The y coordinate to double-tap, in pixels"),
+ },
+ async ({ device, x, y }) => {
+ const robot = getRobotFromDevice(device);
+ await robot!.doubleTap(x, y);
+ return `Double-tapped on screen at coordinates: ${x}, ${y}`;
+ }
+ );
+
tool(
"mobile_long_press_on_screen_at_coordinates",
"Long press on the screen at given x,y coordinates. If long pressing on an element, use the list_elements_on_screen tool to find the coordinates.",