appium-mcp 1.55.0 → 1.56.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +14 -13
  3. package/dist/tools/app-management/activate-app.d.ts +2 -2
  4. package/dist/tools/app-management/activate-app.d.ts.map +1 -1
  5. package/dist/tools/app-management/activate-app.js +21 -58
  6. package/dist/tools/app-management/activate-app.js.map +1 -1
  7. package/dist/tools/app-management/app.d.ts +6 -0
  8. package/dist/tools/app-management/app.d.ts.map +1 -0
  9. package/dist/tools/app-management/app.js +139 -0
  10. package/dist/tools/app-management/app.js.map +1 -0
  11. package/dist/tools/app-management/background-app.d.ts +2 -3
  12. package/dist/tools/app-management/background-app.d.ts.map +1 -1
  13. package/dist/tools/app-management/background-app.js +32 -61
  14. package/dist/tools/app-management/background-app.js.map +1 -1
  15. package/dist/tools/app-management/clear-app.d.ts +2 -2
  16. package/dist/tools/app-management/clear-app.d.ts.map +1 -1
  17. package/dist/tools/app-management/clear-app.js +23 -58
  18. package/dist/tools/app-management/clear-app.js.map +1 -1
  19. package/dist/tools/app-management/deep-link.d.ts +2 -2
  20. package/dist/tools/app-management/deep-link.d.ts.map +1 -1
  21. package/dist/tools/app-management/deep-link.js +52 -87
  22. package/dist/tools/app-management/deep-link.js.map +1 -1
  23. package/dist/tools/app-management/install-app.d.ts +2 -2
  24. package/dist/tools/app-management/install-app.d.ts.map +1 -1
  25. package/dist/tools/app-management/install-app.js +19 -45
  26. package/dist/tools/app-management/install-app.js.map +1 -1
  27. package/dist/tools/app-management/is-app-installed.d.ts +2 -2
  28. package/dist/tools/app-management/is-app-installed.d.ts.map +1 -1
  29. package/dist/tools/app-management/is-app-installed.js +43 -75
  30. package/dist/tools/app-management/is-app-installed.js.map +1 -1
  31. package/dist/tools/app-management/list-apps.d.ts +2 -2
  32. package/dist/tools/app-management/list-apps.d.ts.map +1 -1
  33. package/dist/tools/app-management/list-apps.js +21 -42
  34. package/dist/tools/app-management/list-apps.js.map +1 -1
  35. package/dist/tools/app-management/query-app-state.d.ts +2 -2
  36. package/dist/tools/app-management/query-app-state.d.ts.map +1 -1
  37. package/dist/tools/app-management/query-app-state.js +24 -57
  38. package/dist/tools/app-management/query-app-state.js.map +1 -1
  39. package/dist/tools/app-management/resolve-app-id.js +1 -1
  40. package/dist/tools/app-management/resolve-app-id.js.map +1 -1
  41. package/dist/tools/app-management/terminate-app.d.ts +2 -2
  42. package/dist/tools/app-management/terminate-app.d.ts.map +1 -1
  43. package/dist/tools/app-management/terminate-app.js +21 -56
  44. package/dist/tools/app-management/terminate-app.js.map +1 -1
  45. package/dist/tools/app-management/uninstall-app.d.ts +2 -2
  46. package/dist/tools/app-management/uninstall-app.d.ts.map +1 -1
  47. package/dist/tools/app-management/uninstall-app.js +36 -68
  48. package/dist/tools/app-management/uninstall-app.js.map +1 -1
  49. package/dist/tools/index.d.ts.map +1 -1
  50. package/dist/tools/index.js +2 -22
  51. package/dist/tools/index.js.map +1 -1
  52. package/package.json +1 -1
  53. package/server.json +2 -2
  54. package/src/resources/submodules.zip +0 -0
  55. package/src/tools/app-management/activate-app.ts +24 -69
  56. package/src/tools/app-management/app.ts +171 -0
  57. package/src/tools/app-management/background-app.ts +37 -70
  58. package/src/tools/app-management/clear-app.ts +27 -65
  59. package/src/tools/app-management/deep-link.ts +62 -104
  60. package/src/tools/app-management/install-app.ts +23 -47
  61. package/src/tools/app-management/is-app-installed.ts +47 -83
  62. package/src/tools/app-management/list-apps.ts +27 -54
  63. package/src/tools/app-management/query-app-state.ts +27 -63
  64. package/src/tools/app-management/resolve-app-id.ts +1 -1
  65. package/src/tools/app-management/terminate-app.ts +25 -63
  66. package/src/tools/app-management/uninstall-app.ts +41 -77
  67. package/src/tools/index.ts +2 -22
package/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## [1.56.0](https://github.com/appium/appium-mcp/compare/v1.55.0...v1.56.0) (2026-04-13)
2
+
3
+ ### Features
4
+
5
+ * **app:** consolidate app commands ([#255](https://github.com/appium/appium-mcp/issues/255)) ([bad8cdc](https://github.com/appium/appium-mcp/commit/bad8cdc266b1646f8748bd73e5a6102689e03b7b))
6
+
1
7
  ## [1.55.0](https://github.com/appium/appium-mcp/compare/v1.54.0...v1.55.0) (2026-04-13)
2
8
 
3
9
  ### Features
package/README.md CHANGED
@@ -274,7 +274,7 @@ The following tools return lightweight text-only responses when NO_UI is enabled
274
274
  - `select_device` - Returns device list as text without picker UI
275
275
  - `create_session` - Returns session info as text without dashboard UI
276
276
  - `appium_context` - Returns context list as text with `action=list` without switcher UI
277
- - `appium_list_apps` - Returns app list as JSON without interactive UI
277
+ - `appium_app` (action=`list`) - Returns app list as JSON without interactive UI
278
278
 
279
279
  **When to Enable NO_UI:**
280
280
 
@@ -353,18 +353,19 @@ The default regex pattern allows any URL that starts with `http://` or `https://
353
353
 
354
354
  ### App Management
355
355
 
356
- | Tool | Description |
357
- |--------------------------------|---------------------------------------------------------------------------------|
358
- | `appium_activate_app` | Activate (launch/bring to foreground) a specified app by bundle ID |
359
- | `appium_mobile_background_app` | Background the current app for a duration (optional; defaults to 5 seconds) |
360
- | `appium_installApp` | Install an app on the device from a file path |
361
- | `appium_uninstallApp` | Uninstall an app from the device by bundle ID |
362
- | `appium_terminateApp` | Terminate (close) a specified app |
363
- | `appium_list_apps` | List all installed apps on the device (Android and iOS) |
364
- | `appium_is_app_installed` | Check whether an app is installed. Package name for Android, bundle ID for iOS. |
365
- | `appium_query_app_state` | Query the current state of an app. Package name for Android, bundle ID for iOS. |
366
- | `appium_mobile_clear_app` | Clear app data and cache without uninstalling (`mobile: clearApp`). Android: package name; stop the app first when possible. iOS: **Simulator only** (bundle ID); not supported for app data reset on real devices without uninstall. |
367
- | `appium_mobile_permissions` | Get, update, or reset app permissions in one tool (`action`: get / update / reset). Android: list or change runtime permissions. iOS Simulator: get/set privacy via bundle id; reset (`action=reset`) applies to the AUT on sim and device. |
356
+ | Tool | Action | Description |
357
+ |---------------|------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
358
+ | `appium_app` | `activate` | Activate (launch/bring to foreground) a specified app by bundle ID or name |
359
+ | `appium_app` | `terminate` | Terminate (close) a specified app |
360
+ | `appium_app` | `install` | Install an app on the device from a file path |
361
+ | `appium_app` | `uninstall` | Uninstall an app from the device by bundle ID or name |
362
+ | `appium_app` | `list` | List all installed apps on the device (Android and iOS) |
363
+ | `appium_app` | `is_installed` | Check whether an app is installed. Package name for Android, bundle ID for iOS. |
364
+ | `appium_app` | `query_state` | Query the current state of an app: 0=not installed, 1=not running, 2=background suspended, 3=background, 4=foreground |
365
+ | `appium_app` | `background` | Background the current app for a duration (optional; defaults to 5 seconds) |
366
+ | `appium_app` | `clear` | Clear app data and cache without uninstalling (`mobile: clearApp`). Android: stop the app first when possible. iOS: **Simulator only**; not supported on real devices. |
367
+ | `appium_app` | `deep_link` | Open a deep link URL with the default or a specified app
368
+ | `appium_mobile_permissions`| Get, update, or reset app permissions in one tool (`action`: get / update / reset) | Android: list or change runtime permissions. iOS Simulator: get/set privacy via bundle id; reset (`action=reset`) applies to the AUT on sim and device. |
368
369
 
369
370
  ### Test Generation & Documentation
370
371
 
@@ -1,3 +1,3 @@
1
- import { FastMCP } from 'fastmcp';
2
- export default function activateApp(server: FastMCP): void;
1
+ import type { ContentResult } from 'fastmcp';
2
+ export declare function activate(id: string, sessionId?: string): Promise<ContentResult>;
3
3
  //# sourceMappingURL=activate-app.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"activate-app.d.ts","sourceRoot":"","sources":["../../../src/tools/app-management/activate-app.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAMlC,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAkEzD"}
1
+ {"version":3,"file":"activate-app.d.ts","sourceRoot":"","sources":["../../../src/tools/app-management/activate-app.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAI7C,wBAAsB,QAAQ,CAC5B,EAAE,EAAE,MAAM,EACV,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,aAAa,CAAC,CAoBxB"}
@@ -1,62 +1,25 @@
1
1
  import { getDriver } from '../../session-store.js';
2
- import { z } from 'zod';
3
2
  import { activateApp as _activateApp } from '../../command.js';
4
- import { resolveId } from './resolve-app-id.js';
5
- export default function activateApp(server) {
6
- const activateAppSchema = z
7
- .object({
8
- id: z
9
- .string()
10
- .optional()
11
- .describe('The app id (package name for Android, bundle ID for iOS). Takes precedence over name. Required if name is not provided.'),
12
- name: z
13
- .string()
14
- .optional()
15
- .describe('Human-readable app name (e.g. "Spotify"). Used to resolve the app id when id is not provided. Required if id is not provided.'),
16
- sessionId: z
17
- .string()
18
- .optional()
19
- .describe('Session ID to target. If omitted, uses the active session.'),
20
- })
21
- .refine((args) => args.id || args.name, {
22
- message: 'Either id or name must be provided',
23
- });
24
- server.addTool({
25
- name: 'appium_activate_app',
26
- description: 'Activate app by id or human-readable name. Either id or name must be provided.',
27
- parameters: activateAppSchema,
28
- annotations: {
29
- readOnlyHint: false,
30
- openWorldHint: false,
31
- },
32
- execute: async (args, _context) => {
33
- const driver = getDriver(args.sessionId);
34
- if (!driver) {
35
- throw new Error('No driver found');
36
- }
37
- const appId = await resolveId(args.id, args.name, args.sessionId);
38
- try {
39
- await _activateApp(driver, appId);
40
- return {
41
- content: [
42
- {
43
- type: 'text',
44
- text: `App ${appId} activated correctly.`,
45
- },
46
- ],
47
- };
48
- }
49
- catch (err) {
50
- return {
51
- content: [
52
- {
53
- type: 'text',
54
- text: `Error activating the app ${appId}: ${err.toString()}`,
55
- },
56
- ],
57
- };
58
- }
59
- },
60
- });
3
+ export async function activate(id, sessionId) {
4
+ try {
5
+ const driver = getDriver(sessionId);
6
+ if (!driver) {
7
+ return { content: [{ type: 'text', text: 'No driver found' }] };
8
+ }
9
+ await _activateApp(driver, id);
10
+ return {
11
+ content: [{ type: 'text', text: `App ${id} activated correctly.` }],
12
+ };
13
+ }
14
+ catch (err) {
15
+ return {
16
+ content: [
17
+ {
18
+ type: 'text',
19
+ text: `Error activating the app ${id}: ${err.toString()}`,
20
+ },
21
+ ],
22
+ };
23
+ }
61
24
  }
62
25
  //# sourceMappingURL=activate-app.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"activate-app.js","sourceRoot":"","sources":["../../../src/tools/app-management/activate-app.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,WAAW,IAAI,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,MAAe;IACjD,MAAM,iBAAiB,GAAG,CAAC;SACxB,MAAM,CAAC;QACN,EAAE,EAAE,CAAC;aACF,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CACP,yHAAyH,CAC1H;QACH,IAAI,EAAE,CAAC;aACJ,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CACP,+HAA+H,CAChI;QACH,SAAS,EAAE,CAAC;aACT,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CAAC,4DAA4D,CAAC;KAC1E,CAAC;SACD,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,IAAI,IAAI,CAAC,IAAI,EAAE;QACtC,OAAO,EAAE,oCAAoC;KAC9C,CAAC,CAAC;IAEL,MAAM,CAAC,OAAO,CAAC;QACb,IAAI,EAAE,qBAAqB;QAC3B,WAAW,EACT,gFAAgF;QAClF,UAAU,EAAE,iBAAiB;QAC7B,WAAW,EAAE;YACX,YAAY,EAAE,KAAK;YACnB,aAAa,EAAE,KAAK;SACrB;QACD,OAAO,EAAE,KAAK,EACZ,IAAuC,EACvC,QAAa,EACC,EAAE;YAChB,MAAM,MAAM,GAAG,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YACzC,IAAI,CAAC,MAAM,EAAE,CAAC;gBACZ,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;YACrC,CAAC;YAED,MAAM,KAAK,GAAG,MAAM,SAAS,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;YAElE,IAAI,CAAC;gBACH,MAAM,YAAY,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;gBAClC,OAAO;oBACL,OAAO,EAAE;wBACP;4BACE,IAAI,EAAE,MAAM;4BACZ,IAAI,EAAE,OAAO,KAAK,uBAAuB;yBAC1C;qBACF;iBACF,CAAC;YACJ,CAAC;YAAC,OAAO,GAAQ,EAAE,CAAC;gBAClB,OAAO;oBACL,OAAO,EAAE;wBACP;4BACE,IAAI,EAAE,MAAM;4BACZ,IAAI,EAAE,4BAA4B,KAAK,KAAK,GAAG,CAAC,QAAQ,EAAE,EAAE;yBAC7D;qBACF;iBACF,CAAC;YACJ,CAAC;QACH,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
1
+ {"version":3,"file":"activate-app.js","sourceRoot":"","sources":["../../../src/tools/app-management/activate-app.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,WAAW,IAAI,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAE/D,MAAM,CAAC,KAAK,UAAU,QAAQ,CAC5B,EAAU,EACV,SAAkB;IAElB,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC;QACpC,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,iBAAiB,EAAE,CAAC,EAAE,CAAC;QAClE,CAAC;QACD,MAAM,YAAY,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QAC/B,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,uBAAuB,EAAE,CAAC;SACpE,CAAC;IACJ,CAAC;IAAC,OAAO,GAAQ,EAAE,CAAC;QAClB,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,4BAA4B,EAAE,KAAK,GAAG,CAAC,QAAQ,EAAE,EAAE;iBAC1D;aACF;SACF,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { FastMCP } from 'fastmcp';
2
+ declare const APP_ACTIONS: readonly ["activate", "terminate", "install", "uninstall", "list", "is_installed", "query_state", "background", "clear", "deep_link"];
3
+ export type AppAction = (typeof APP_ACTIONS)[number];
4
+ export default function app(server: FastMCP): void;
5
+ export {};
6
+ //# sourceMappingURL=app.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../../src/tools/app-management/app.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,OAAO,EAAE,MAAM,SAAS,CAAC;AActD,QAAA,MAAM,WAAW,uIAWP,CAAC;AAEX,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AAwErD,MAAM,CAAC,OAAO,UAAU,GAAG,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAuEjD"}
@@ -0,0 +1,139 @@
1
+ import { z } from 'zod';
2
+ import { resolveAppId, resolveId } from './resolve-app-id.js';
3
+ import { activate } from './activate-app.js';
4
+ import { terminate } from './terminate-app.js';
5
+ import { install } from './install-app.js';
6
+ import { uninstall } from './uninstall-app.js';
7
+ import { list } from './list-apps.js';
8
+ import { isInstalled } from './is-app-installed.js';
9
+ import { queryState } from './query-app-state.js';
10
+ import { background, DEFAULT_BACKGROUND_SECONDS } from './background-app.js';
11
+ import { clear } from './clear-app.js';
12
+ import { deepLink } from './deep-link.js';
13
+ const APP_ACTIONS = [
14
+ 'activate',
15
+ 'terminate',
16
+ 'install',
17
+ 'uninstall',
18
+ 'list',
19
+ 'is_installed',
20
+ 'query_state',
21
+ 'background',
22
+ 'clear',
23
+ 'deep_link',
24
+ ];
25
+ const schema = z.object({
26
+ action: z
27
+ .enum(APP_ACTIONS)
28
+ .describe('Action to perform. ' +
29
+ 'activate: bring app to foreground (requires id or name). ' +
30
+ 'terminate: stop a running app (requires id or name). ' +
31
+ 'install: install from file path (requires path). ' +
32
+ 'uninstall: remove from device (requires id or name; optional keepData for Android). ' +
33
+ 'list: list installed apps (optional applicationType for iOS). ' +
34
+ 'is_installed: check if app is installed (requires id or name). ' +
35
+ 'query_state: get state 0=not installed,1=not running,2=background suspended,3=background,4=foreground (requires id or name). ' +
36
+ 'background: send foreground app to background (optional seconds, default 5). ' +
37
+ 'clear: clear app data without uninstalling (requires id or name). ' +
38
+ 'deep_link: open a URL with an app (requires url; optional id or name).'),
39
+ id: z
40
+ .string()
41
+ .optional()
42
+ .describe('App identifier (package name for Android, bundle ID for iOS). Takes precedence over name. Required for: activate, terminate, uninstall, is_installed, query_state, clear.'),
43
+ name: z
44
+ .string()
45
+ .optional()
46
+ .describe('Human-readable app name (e.g. "Spotify"). Used to resolve the app id. Required (as alternative to id) for: activate, terminate, uninstall, is_installed, query_state, clear.'),
47
+ path: z
48
+ .string()
49
+ .optional()
50
+ .describe('Path to the app file to install. Required for: install.'),
51
+ keepData: z
52
+ .boolean()
53
+ .optional()
54
+ .describe('Keep app data and cache after uninstall. Android only. Used with: uninstall.'),
55
+ applicationType: z
56
+ .enum(['User', 'System'])
57
+ .optional()
58
+ .describe('iOS only: filter by "User" (default) or "System" apps. Used with: list.'),
59
+ seconds: z
60
+ .number()
61
+ .min(-1)
62
+ .max(86400)
63
+ .optional()
64
+ .describe(`Seconds to keep the app in the background. Defaults to ${DEFAULT_BACKGROUND_SECONDS}. Use -1 to stay in background without auto-resuming. Used with: background.`),
65
+ url: z
66
+ .string()
67
+ .optional()
68
+ .describe('Deep link URL to open (e.g. https://example.com, myapp://path). Required for: deep_link.'),
69
+ waitForLaunch: z
70
+ .boolean()
71
+ .optional()
72
+ .describe('Android only. If false, ADB does not wait for the activity to return. Defaults to true. Used with: deep_link.'),
73
+ sessionId: z
74
+ .string()
75
+ .optional()
76
+ .describe('Session ID to target. If omitted, uses the active session.'),
77
+ });
78
+ export default function app(server) {
79
+ server.addTool({
80
+ name: 'appium_app',
81
+ description: `Manage apps on the device. Use the action parameter to choose what to do: ${APP_ACTIONS.join(', ')}.`,
82
+ parameters: schema,
83
+ annotations: {
84
+ readOnlyHint: false,
85
+ openWorldHint: false,
86
+ },
87
+ execute: async (args, _context) => {
88
+ const { action, sessionId } = args;
89
+ if (action === 'list') {
90
+ return list(args.applicationType, sessionId);
91
+ }
92
+ if (action === 'background') {
93
+ return background(args.seconds ?? DEFAULT_BACKGROUND_SECONDS, sessionId);
94
+ }
95
+ if (action === 'install') {
96
+ if (!args.path) {
97
+ return {
98
+ content: [{ type: 'text', text: 'path is required for install' }],
99
+ };
100
+ }
101
+ return install(args.path, sessionId);
102
+ }
103
+ if (action === 'deep_link') {
104
+ if (!args.url) {
105
+ return {
106
+ content: [{ type: 'text', text: 'url is required for deep_link' }],
107
+ };
108
+ }
109
+ const appId = args.id ??
110
+ (args.name ? await resolveAppId(args.name, sessionId) : undefined);
111
+ return deepLink(args.url, appId, args.waitForLaunch, sessionId);
112
+ }
113
+ // activate, terminate, uninstall, is_installed, query_state, clear — all require id or name
114
+ const id = await resolveId(args.id, args.name, sessionId);
115
+ if (action === 'activate') {
116
+ return activate(id, sessionId);
117
+ }
118
+ if (action === 'terminate') {
119
+ return terminate(id, sessionId);
120
+ }
121
+ if (action === 'uninstall') {
122
+ return uninstall(id, args.keepData, sessionId);
123
+ }
124
+ if (action === 'is_installed') {
125
+ return isInstalled(id, sessionId);
126
+ }
127
+ if (action === 'query_state') {
128
+ return queryState(id, sessionId);
129
+ }
130
+ if (action === 'clear') {
131
+ return clear(id, sessionId);
132
+ }
133
+ return {
134
+ content: [{ type: 'text', text: `Unknown action: ${action}` }],
135
+ };
136
+ },
137
+ });
138
+ }
139
+ //# sourceMappingURL=app.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app.js","sourceRoot":"","sources":["../../../src/tools/app-management/app.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAC;AAC7E,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,MAAM,WAAW,GAAG;IAClB,UAAU;IACV,WAAW;IACX,SAAS;IACT,WAAW;IACX,MAAM;IACN,cAAc;IACd,aAAa;IACb,YAAY;IACZ,OAAO;IACP,WAAW;CACH,CAAC;AAIX,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;IACt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so the transition is visible without a long wait. */
1
+ import type { ContentResult } from 'fastmcp';
3
2
  export declare const DEFAULT_BACKGROUND_SECONDS = 5;
4
- export default function backgroundApp(server: FastMCP): void;
3
+ export declare function background(seconds: number, sessionId?: string): Promise<ContentResult>;
5
4
  //# sourceMappingURL=background-app.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"background-app.d.ts","sourceRoot":"","sources":["../../../src/tools/app-management/background-app.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,OAAO,EAAE,MAAM,SAAS,CAAC;AAKtD,iIAAiI;AACjI,eAAO,MAAM,0BAA0B,IAAI,CAAC;AAE5C,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAmE3D"}
1
+ {"version":3,"file":"background-app.d.ts","sourceRoot":"","sources":["../../../src/tools/app-management/background-app.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAI7C,eAAO,MAAM,0BAA0B,IAAI,CAAC;AAE5C,wBAAsB,UAAU,CAC9B,OAAO,EAAE,MAAM,EACf,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,aAAa,CAAC,CAiCxB"}
@@ -1,66 +1,37 @@
1
- import { z } from 'zod';
2
1
  import { getDriver } from '../../session-store.js';
3
2
  import { execute } from '../../command.js';
4
- /** When `seconds` is omitted, MCP clients often send `{}` — a middle ground so the transition is visible without a long wait. */
5
3
  export const DEFAULT_BACKGROUND_SECONDS = 5;
6
- export default function backgroundApp(server) {
7
- const schema = z.object({
8
- seconds: z
9
- .number()
10
- .min(-1)
11
- .max(86400)
12
- .default(DEFAULT_BACKGROUND_SECONDS)
13
- .describe(`Optional. How long to keep the current app in the background before returning it to the foreground (whole seconds). ` +
14
- `Defaults to ${DEFAULT_BACKGROUND_SECONDS} if omitted. ` +
15
- `Larger values make the transition easier to see. Use -1 to leave the app in the background without auto-resuming (driver-specific).`),
16
- sessionId: z
17
- .string()
18
- .optional()
19
- .describe('Session ID to target. If omitted, uses the active session.'),
20
- });
21
- server.addTool({
22
- name: 'appium_mobile_background_app',
23
- description: `Send the current foreground app to the background for a duration (default ${DEFAULT_BACKGROUND_SECONDS}s if not specified), then return to the foreground unless using driver-specific stay-in-background behavior. Uses the Appium mobile: backgroundApp execute method (UiAutomator2 and XCUITest).`,
24
- parameters: schema,
25
- annotations: {
26
- readOnlyHint: false,
27
- openWorldHint: false,
28
- },
29
- execute: async (args, _context) => {
30
- const { seconds } = args;
31
- const driver = getDriver(args.sessionId);
32
- if (!driver) {
33
- throw new Error('No driver found');
34
- }
35
- try {
36
- await execute(driver, 'mobile: backgroundApp', { seconds });
37
- const resumeHint = seconds < 0
38
- ? 'The app should stay in the background until you bring it back (e.g. appium_activate_app).'
39
- : 'The app is sent to the background, then brought back automatically after the wait.';
40
- return {
41
- content: [
42
- {
43
- type: 'text',
44
- text: `Background completed (${seconds}s). ${resumeHint}\n\n` +
45
- `Tips if you saw little or no change: (1) Short positive durations (e.g. 2s) are easy to miss—try 8–15 seconds to see the home/recents screen clearly. ` +
46
- `(2) The foreground app must be the one you expect—use appium_activate_app with the package/bundle id first if needed. ` +
47
- `(3) Some OEMs minimize animation; use appium_screenshot before and after to verify.`,
48
- },
49
- ],
50
- };
51
- }
52
- catch (err) {
53
- const message = err instanceof Error ? err.message : String(err);
54
- return {
55
- content: [
56
- {
57
- type: 'text',
58
- text: `Failed to background app. Error: ${message}`,
59
- },
60
- ],
61
- };
62
- }
63
- },
64
- });
4
+ export async function background(seconds, sessionId) {
5
+ try {
6
+ const driver = getDriver(sessionId);
7
+ if (!driver) {
8
+ return { content: [{ type: 'text', text: 'No driver found' }] };
9
+ }
10
+ await execute(driver, 'mobile: backgroundApp', { seconds });
11
+ const resumeHint = seconds < 0
12
+ ? 'The app should stay in the background until you bring it back (e.g. action=activate).'
13
+ : 'The app is sent to the background, then brought back automatically after the wait.';
14
+ return {
15
+ content: [
16
+ {
17
+ type: 'text',
18
+ text: `Background completed (${seconds}s). ${resumeHint}\n\n` +
19
+ `Tips if you saw little or no change: (1) Short positive durations (e.g. 2s) are easy to miss—try 8–15 seconds to see the home/recents screen clearly. ` +
20
+ `(2) The foreground app must be the one you expect—use action=activate with the package/bundle id first if needed. ` +
21
+ `(3) Some OEMs minimize animation; use appium_screenshot before and after to verify.`,
22
+ },
23
+ ],
24
+ };
25
+ }
26
+ catch (err) {
27
+ return {
28
+ content: [
29
+ {
30
+ type: 'text',
31
+ text: `Failed to background app. Error: ${err.toString()}`,
32
+ },
33
+ ],
34
+ };
35
+ }
65
36
  }
66
37
  //# sourceMappingURL=background-app.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"background-app.js","sourceRoot":"","sources":["../../../src/tools/app-management/background-app.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C,iIAAiI;AACjI,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC;AAE5C,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,MAAe;IACnD,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;QACtB,OAAO,EAAE,CAAC;aACP,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC,CAAC;aACP,GAAG,CAAC,KAAK,CAAC;aACV,OAAO,CAAC,0BAA0B,CAAC;aACnC,QAAQ,CACP,sHAAsH;YACpH,eAAe,0BAA0B,eAAe;YACxD,qIAAqI,CACxI;QACH,SAAS,EAAE,CAAC;aACT,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CAAC,4DAA4D,CAAC;KAC1E,CAAC,CAAC;IAEH,MAAM,CAAC,OAAO,CAAC;QACb,IAAI,EAAE,8BAA8B;QACpC,WAAW,EAAE,6EAA6E,0BAA0B,gMAAgM;QACpT,UAAU,EAAE,MAAM;QAClB,WAAW,EAAE;YACX,YAAY,EAAE,KAAK;YACnB,aAAa,EAAE,KAAK;SACrB;QACD,OAAO,EAAE,KAAK,EACZ,IAA4B,EAC5B,QAA6C,EACrB,EAAE;YAC1B,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;YACzB,MAAM,MAAM,GAAG,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YACzC,IAAI,CAAC,MAAM,EAAE,CAAC;gBACZ,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;YACrC,CAAC;YAED,IAAI,CAAC;gBACH,MAAM,OAAO,CAAC,MAAM,EAAE,uBAAuB,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;gBAC5D,MAAM,UAAU,GACd,OAAO,GAAG,CAAC;oBACT,CAAC,CAAC,2FAA2F;oBAC7F,CAAC,CAAC,oFAAoF,CAAC;gBAC3F,OAAO;oBACL,OAAO,EAAE;wBACP;4BACE,IAAI,EAAE,MAAM;4BACZ,IAAI,EACF,yBAAyB,OAAO,OAAO,UAAU,MAAM;gCACvD,wJAAwJ;gCACxJ,wHAAwH;gCACxH,qFAAqF;yBACxF;qBACF;iBACF,CAAC;YACJ,CAAC;YAAC,OAAO,GAAY,EAAE,CAAC;gBACtB,MAAM,OAAO,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;gBACjE,OAAO;oBACL,OAAO,EAAE;wBACP;4BACE,IAAI,EAAE,MAAM;4BACZ,IAAI,EAAE,oCAAoC,OAAO,EAAE;yBACpD;qBACF;iBACF,CAAC;YACJ,CAAC;QACH,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
1
+ {"version":3,"file":"background-app.js","sourceRoot":"","sources":["../../../src/tools/app-management/background-app.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC;AAE5C,MAAM,CAAC,KAAK,UAAU,UAAU,CAC9B,OAAe,EACf,SAAkB;IAElB,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC;QACpC,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,iBAAiB,EAAE,CAAC,EAAE,CAAC;QAClE,CAAC;QACD,MAAM,OAAO,CAAC,MAAM,EAAE,uBAAuB,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;QAC5D,MAAM,UAAU,GACd,OAAO,GAAG,CAAC;YACT,CAAC,CAAC,uFAAuF;YACzF,CAAC,CAAC,oFAAoF,CAAC;QAC3F,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EACF,yBAAyB,OAAO,OAAO,UAAU,MAAM;wBACvD,wJAAwJ;wBACxJ,oHAAoH;wBACpH,qFAAqF;iBACxF;aACF;SACF,CAAC;IACJ,CAAC;IAAC,OAAO,GAAQ,EAAE,CAAC;QAClB,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,oCAAoC,GAAG,CAAC,QAAQ,EAAE,EAAE;iBAC3D;aACF;SACF,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -1,3 +1,3 @@
1
- import { FastMCP } from 'fastmcp';
2
- export default function clearApp(server: FastMCP): void;
1
+ import type { ContentResult } from 'fastmcp';
2
+ export declare function clear(id: string, sessionId?: string): Promise<ContentResult>;
3
3
  //# sourceMappingURL=clear-app.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"clear-app.d.ts","sourceRoot":"","sources":["../../../src/tools/app-management/clear-app.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAMlC,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CA8DtD"}
1
+ {"version":3,"file":"clear-app.d.ts","sourceRoot":"","sources":["../../../src/tools/app-management/clear-app.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAI7C,wBAAsB,KAAK,CACzB,EAAE,EAAE,MAAM,EACV,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,aAAa,CAAC,CAuBxB"}
@@ -1,62 +1,27 @@
1
- import { z } from 'zod';
2
1
  import { getDriver, getPlatformName, PLATFORM } from '../../session-store.js';
3
2
  import { execute } from '../../command.js';
4
- import { resolveId } from './resolve-app-id.js';
5
- export default function clearApp(server) {
6
- const schema = z
7
- .object({
8
- id: z
9
- .string()
10
- .optional()
11
- .describe('App identifier (package name for Android, bundle ID for iOS). Takes precedence over name. Required if name is not provided.'),
12
- name: z
13
- .string()
14
- .optional()
15
- .describe('Human-readable app name (e.g. "Spotify"). Used to resolve the app id when id is not provided. Required if id is not provided.'),
16
- sessionId: z
17
- .string()
18
- .optional()
19
- .describe('Session ID to target. If omitted, uses the active session.'),
20
- })
21
- .refine((args) => args.id || args.name, {
22
- message: 'Either id or name must be provided',
23
- });
24
- server.addTool({
25
- name: 'appium_mobile_clear_app',
26
- description: 'Clear all user data and cache for an installed app without uninstalling it (Appium `mobile: clearApp`). Either id or name must be provided. ' +
27
- 'Android: uses `pm clear` (package name); stop the app first for reliable results on devices and emulators. ' +
28
- 'iOS: Simulator only (bundle ID); `mobile: clearApp` is not supported on real devices.',
29
- parameters: schema,
30
- execute: async (args) => {
31
- const driver = getDriver(args.sessionId);
32
- if (!driver) {
33
- throw new Error('No driver found');
34
- }
35
- const id = await resolveId(args.id, args.name, args.sessionId);
36
- try {
37
- const platform = getPlatformName(driver);
38
- const params = platform === PLATFORM.android ? { appId: id } : { bundleId: id };
39
- await execute(driver, 'mobile: clearApp', params);
40
- return {
41
- content: [
42
- {
43
- type: 'text',
44
- text: 'App data cleared successfully',
45
- },
46
- ],
47
- };
48
- }
49
- catch (err) {
50
- return {
51
- content: [
52
- {
53
- type: 'text',
54
- text: `Failed to clear app data. err: ${err.toString()}`,
55
- },
56
- ],
57
- };
58
- }
59
- },
60
- });
3
+ export async function clear(id, sessionId) {
4
+ try {
5
+ const driver = getDriver(sessionId);
6
+ if (!driver) {
7
+ return { content: [{ type: 'text', text: 'No driver found' }] };
8
+ }
9
+ const platform = getPlatformName(driver);
10
+ const params = platform === PLATFORM.android ? { appId: id } : { bundleId: id };
11
+ await execute(driver, 'mobile: clearApp', params);
12
+ return {
13
+ content: [{ type: 'text', text: 'App data cleared successfully' }],
14
+ };
15
+ }
16
+ catch (err) {
17
+ return {
18
+ content: [
19
+ {
20
+ type: 'text',
21
+ text: `Failed to clear app data. err: ${err.toString()}`,
22
+ },
23
+ ],
24
+ };
25
+ }
61
26
  }
62
27
  //# sourceMappingURL=clear-app.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"clear-app.js","sourceRoot":"","sources":["../../../src/tools/app-management/clear-app.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAC9E,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,MAAe;IAC9C,MAAM,MAAM,GAAG,CAAC;SACb,MAAM,CAAC;QACN,EAAE,EAAE,CAAC;aACF,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CACP,6HAA6H,CAC9H;QACH,IAAI,EAAE,CAAC;aACJ,MAAM,EAAE;aACR,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,EAAE;iBACzD;aACF;SACF,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -1,3 +1,3 @@
1
- import { FastMCP } from 'fastmcp';
2
- export default function deepLink(server: FastMCP): void;
1
+ import type { ContentResult } from 'fastmcp';
2
+ export declare function deepLink(url: string, appId?: string, waitForLaunch?: boolean, sessionId?: string): Promise<ContentResult>;
3
3
  //# sourceMappingURL=deep-link.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"deep-link.d.ts","sourceRoot":"","sources":["../../../src/tools/app-management/deep-link.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAelC,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAwGtD"}
1
+ {"version":3,"file":"deep-link.d.ts","sourceRoot":"","sources":["../../../src/tools/app-management/deep-link.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAa7C,wBAAsB,QAAQ,CAC5B,GAAG,EAAE,MAAM,EACX,KAAK,CAAC,EAAE,MAAM,EACd,aAAa,CAAC,EAAE,OAAO,EACvB,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,aAAa,CAAC,CA2DxB"}