appium-mcp 1.51.0 → 1.52.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.
- package/CHANGELOG.md +6 -0
- package/README.md +1 -0
- package/dist/tools/app-management/permissions.d.ts +3 -0
- package/dist/tools/app-management/permissions.d.ts.map +1 -0
- package/dist/tools/app-management/permissions.js +167 -0
- package/dist/tools/app-management/permissions.js.map +1 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +2 -0
- package/dist/tools/index.js.map +1 -1
- package/package.json +1 -1
- package/server.json +2 -2
- package/src/resources/submodules.zip +0 -0
- package/src/tools/README.md +1 -0
- package/src/tools/app-management/permissions.ts +205 -0
- package/src/tools/index.ts +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
## [1.52.0](https://github.com/appium/appium-mcp/compare/v1.51.0...v1.52.0) (2026-04-10)
|
|
2
|
+
|
|
3
|
+
### Features
|
|
4
|
+
|
|
5
|
+
* **app-management:** add mobile permission tools ([#248](https://github.com/appium/appium-mcp/issues/248)) ([d5a5b5a](https://github.com/appium/appium-mcp/commit/d5a5b5a6c2394ae49e30efb0fc4175a780257715))
|
|
6
|
+
|
|
1
7
|
## [1.51.0](https://github.com/appium/appium-mcp/compare/v1.50.0...v1.51.0) (2026-04-10)
|
|
2
8
|
|
|
3
9
|
### Features
|
package/README.md
CHANGED
|
@@ -369,6 +369,7 @@ The default regex pattern allows any URL that starts with `http://` or `https://
|
|
|
369
369
|
| `appium_is_app_installed` | Check whether an app is installed. Package name for Android, bundle ID for iOS. |
|
|
370
370
|
| `appium_query_app_state` | Query the current state of an app. Package name for Android, bundle ID for iOS. |
|
|
371
371
|
| `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. |
|
|
372
|
+
| `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. |
|
|
372
373
|
|
|
373
374
|
### Test Generation & Documentation
|
|
374
375
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../../../src/tools/app-management/permissions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,OAAO,EAAE,MAAM,SAAS,CAAC;AAOtD,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAqM/D"}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { getDriver, getPlatformName, PLATFORM } from '../../session-store.js';
|
|
3
|
+
import { execute } from '../../command.js';
|
|
4
|
+
const iosPermissionStateSchema = z.enum(['yes', 'no', 'unset', 'limited']);
|
|
5
|
+
export default function mobilePermissions(server) {
|
|
6
|
+
const schema = z.object({
|
|
7
|
+
action: z
|
|
8
|
+
.enum(['get', 'update', 'reset'])
|
|
9
|
+
.describe('get: list (Android) or read one privacy state (iOS Simulator). ' +
|
|
10
|
+
'update: grant/revoke (Android) or set privacy map (iOS Simulator). ' +
|
|
11
|
+
'reset: restore a privacy prompt for the app under test (iOS only).'),
|
|
12
|
+
sessionId: z
|
|
13
|
+
.string()
|
|
14
|
+
.optional()
|
|
15
|
+
.describe('Session ID to target. If omitted, uses the active session.'),
|
|
16
|
+
permissionFilter: z
|
|
17
|
+
.enum(['denied', 'granted', 'requested'])
|
|
18
|
+
.optional()
|
|
19
|
+
.describe('Android get only: which bucket to return. Defaults to requested per UiAutomator2.'),
|
|
20
|
+
appPackage: z
|
|
21
|
+
.string()
|
|
22
|
+
.optional()
|
|
23
|
+
.describe('Android get/update: package to target. Defaults to the app under test.'),
|
|
24
|
+
bundleId: z
|
|
25
|
+
.string()
|
|
26
|
+
.optional()
|
|
27
|
+
.describe('iOS get/update: bundle id of the app. Required for iOS get and update.'),
|
|
28
|
+
service: z
|
|
29
|
+
.union([z.string(), z.number()])
|
|
30
|
+
.optional()
|
|
31
|
+
.describe('iOS get: privacy service name (e.g. camera, microphone, photos). ' +
|
|
32
|
+
'iOS reset: service name or numeric XCUIProtectedResource id.'),
|
|
33
|
+
permissions: z
|
|
34
|
+
.union([z.string(), z.array(z.string())])
|
|
35
|
+
.optional()
|
|
36
|
+
.describe('Android update only: permission name(s), `all` (with pm target), or appops names. Required for Android update.'),
|
|
37
|
+
permissionChangeAction: z
|
|
38
|
+
.string()
|
|
39
|
+
.optional()
|
|
40
|
+
.describe('Android update: for pm target grant (default) or revoke; for appops allow, deny, ignore, default.'),
|
|
41
|
+
target: z
|
|
42
|
+
.enum(['pm', 'appops'])
|
|
43
|
+
.optional()
|
|
44
|
+
.describe('Android update: pm (default) or appops.'),
|
|
45
|
+
access: z
|
|
46
|
+
.record(z.string(), iosPermissionStateSchema)
|
|
47
|
+
.optional()
|
|
48
|
+
.describe('iOS update only: map of access rule → yes|no|unset|limited (Simulator + AppleSimulatorUtils). Required for iOS update.'),
|
|
49
|
+
});
|
|
50
|
+
server.addTool({
|
|
51
|
+
name: 'appium_mobile_permissions',
|
|
52
|
+
description: 'Manage mobile app permissions in one place. action=get: Android lists runtime permissions for a package; iOS Simulator reads one service state for a bundle id (needs bundleId + service). action=update: Android changes permissions (grant/revoke or AppOps); iOS Simulator sets privacy via access map (needs bundleId + access). action=reset: iOS only — resets one privacy service for the AUT (needs service).',
|
|
53
|
+
parameters: schema,
|
|
54
|
+
annotations: {
|
|
55
|
+
readOnlyHint: false,
|
|
56
|
+
openWorldHint: false,
|
|
57
|
+
},
|
|
58
|
+
execute: async (args, _context) => {
|
|
59
|
+
const driver = getDriver(args.sessionId);
|
|
60
|
+
if (!driver) {
|
|
61
|
+
throw new Error('No driver found');
|
|
62
|
+
}
|
|
63
|
+
try {
|
|
64
|
+
const platform = getPlatformName(driver);
|
|
65
|
+
if (args.action === 'get') {
|
|
66
|
+
if (platform === PLATFORM.android) {
|
|
67
|
+
const params = {};
|
|
68
|
+
if (args.permissionFilter != null) {
|
|
69
|
+
params.type = args.permissionFilter;
|
|
70
|
+
}
|
|
71
|
+
if (args.appPackage != null) {
|
|
72
|
+
params.appPackage = args.appPackage;
|
|
73
|
+
}
|
|
74
|
+
const raw = await execute(driver, 'mobile: getPermissions', params);
|
|
75
|
+
return {
|
|
76
|
+
content: [{ type: 'text', text: JSON.stringify(raw, null, 2) }],
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
if (platform === PLATFORM.ios) {
|
|
80
|
+
if (!args.bundleId) {
|
|
81
|
+
throw new Error('iOS get requires bundleId and service (string).');
|
|
82
|
+
}
|
|
83
|
+
if (args.service === undefined ||
|
|
84
|
+
typeof args.service === 'number') {
|
|
85
|
+
throw new Error('iOS get requires service as a string name (e.g. camera, photos).');
|
|
86
|
+
}
|
|
87
|
+
const raw = await execute(driver, 'mobile: getPermission', {
|
|
88
|
+
bundleId: args.bundleId,
|
|
89
|
+
service: args.service,
|
|
90
|
+
});
|
|
91
|
+
return {
|
|
92
|
+
content: [{ type: 'text', text: String(raw) }],
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
throw new Error(`Unsupported platform: ${platform}. Only Android and iOS are supported.`);
|
|
96
|
+
}
|
|
97
|
+
if (args.action === 'update') {
|
|
98
|
+
if (platform === PLATFORM.android) {
|
|
99
|
+
if (args.permissions === undefined) {
|
|
100
|
+
throw new Error('Android update requires permissions.');
|
|
101
|
+
}
|
|
102
|
+
const params = {
|
|
103
|
+
permissions: args.permissions,
|
|
104
|
+
};
|
|
105
|
+
if (args.appPackage != null) {
|
|
106
|
+
params.appPackage = args.appPackage;
|
|
107
|
+
}
|
|
108
|
+
if (args.permissionChangeAction != null) {
|
|
109
|
+
params.action = args.permissionChangeAction;
|
|
110
|
+
}
|
|
111
|
+
if (args.target != null) {
|
|
112
|
+
params.target = args.target;
|
|
113
|
+
}
|
|
114
|
+
await execute(driver, 'mobile: changePermissions', params);
|
|
115
|
+
return {
|
|
116
|
+
content: [
|
|
117
|
+
{ type: 'text', text: 'Permissions updated successfully.' },
|
|
118
|
+
],
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
if (platform === PLATFORM.ios) {
|
|
122
|
+
if (!args.bundleId || !args.access) {
|
|
123
|
+
throw new Error('iOS update requires bundleId and access map.');
|
|
124
|
+
}
|
|
125
|
+
await execute(driver, 'mobile: setPermission', {
|
|
126
|
+
bundleId: args.bundleId,
|
|
127
|
+
access: args.access,
|
|
128
|
+
});
|
|
129
|
+
return {
|
|
130
|
+
content: [
|
|
131
|
+
{
|
|
132
|
+
type: 'text',
|
|
133
|
+
text: 'Permission settings updated successfully.',
|
|
134
|
+
},
|
|
135
|
+
],
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
throw new Error(`Unsupported platform: ${platform}. Only Android and iOS are supported.`);
|
|
139
|
+
}
|
|
140
|
+
if (platform !== PLATFORM.ios) {
|
|
141
|
+
throw new Error('action=reset is only supported on iOS (mobile: resetPermission for the AUT).');
|
|
142
|
+
}
|
|
143
|
+
if (args.service === undefined) {
|
|
144
|
+
throw new Error('iOS reset requires service (name or numeric id).');
|
|
145
|
+
}
|
|
146
|
+
await execute(driver, 'mobile: resetPermission', {
|
|
147
|
+
service: args.service,
|
|
148
|
+
});
|
|
149
|
+
return {
|
|
150
|
+
content: [{ type: 'text', text: 'Permission reset successfully.' }],
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
catch (err) {
|
|
154
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
155
|
+
return {
|
|
156
|
+
content: [
|
|
157
|
+
{
|
|
158
|
+
type: 'text',
|
|
159
|
+
text: `Failed permissions action ${args.action}. err: ${message}`,
|
|
160
|
+
},
|
|
161
|
+
],
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
//# sourceMappingURL=permissions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"permissions.js","sourceRoot":"","sources":["../../../src/tools/app-management/permissions.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;AAE3C,MAAM,wBAAwB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC;AAE3E,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,MAAe;IACvD,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;QACtB,MAAM,EAAE,CAAC;aACN,IAAI,CAAC,CAAC,KAAK,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;aAChC,QAAQ,CACP,iEAAiE;YAC/D,qEAAqE;YACrE,oEAAoE,CACvE;QACH,SAAS,EAAE,CAAC;aACT,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CAAC,4DAA4D,CAAC;QACzE,gBAAgB,EAAE,CAAC;aAChB,IAAI,CAAC,CAAC,QAAQ,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC;aACxC,QAAQ,EAAE;aACV,QAAQ,CACP,mFAAmF,CACpF;QACH,UAAU,EAAE,CAAC;aACV,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CACP,wEAAwE,CACzE;QACH,QAAQ,EAAE,CAAC;aACR,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CACP,wEAAwE,CACzE;QACH,OAAO,EAAE,CAAC;aACP,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;aAC/B,QAAQ,EAAE;aACV,Q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C;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AA8DlC,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAiJ3D"}
|
package/dist/tools/index.js
CHANGED
|
@@ -50,6 +50,7 @@ import listApps from './app-management/list-apps.js';
|
|
|
50
50
|
import isAppInstalled from './app-management/is-app-installed.js';
|
|
51
51
|
import queryAppState from './app-management/query-app-state.js';
|
|
52
52
|
import clearApp from './app-management/clear-app.js';
|
|
53
|
+
import mobilePermissions from './app-management/permissions.js';
|
|
53
54
|
import deepLink from './app-management/deep-link.js';
|
|
54
55
|
import getContexts from './context/get-contexts.js';
|
|
55
56
|
import switchContext from './context/switch-context.js';
|
|
@@ -174,6 +175,7 @@ export default function registerTools(server) {
|
|
|
174
175
|
isAppInstalled(server);
|
|
175
176
|
queryAppState(server);
|
|
176
177
|
clearApp(server);
|
|
178
|
+
mobilePermissions(server);
|
|
177
179
|
deepLink(server);
|
|
178
180
|
// Context Management
|
|
179
181
|
getContexts(server);
|
package/dist/tools/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAeA,OAAO,GAAG,MAAM,cAAc,CAAC;AAC/B,OAAO,YAAY,MAAM,kCAAkC,CAAC;AAC5D,OAAO,YAAY,MAAM,kCAAkC,CAAC;AAC5D,OAAO,aAAa,MAAM,6BAA6B,CAAC;AACxD,OAAO,aAAa,MAAM,6BAA6B,CAAC;AACxD,OAAO,YAAY,MAAM,4BAA4B,CAAC;AACtD,OAAO,aAAa,MAAM,6BAA6B,CAAC;AACxD,OAAO,gBAAgB,MAAM,+BAA+B,CAAC;AAC7D,OAAO,YAAY,MAAM,4BAA4B,CAAC;A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mobile Development and Automation Server",
|
|
5
5
|
"description": "MCP server for Appium mobile automation on iOS and Android devices with test creation tools.",
|
|
6
|
-
"version": "1.
|
|
6
|
+
"version": "1.52.0",
|
|
7
7
|
"packages": [
|
|
8
8
|
{
|
|
9
9
|
"registryType": "npm",
|
|
10
10
|
"identifier": "appium-mcp",
|
|
11
|
-
"version": "1.
|
|
11
|
+
"version": "1.52.0",
|
|
12
12
|
"transport": {
|
|
13
13
|
"type": "stdio"
|
|
14
14
|
}
|
|
Binary file
|
package/src/tools/README.md
CHANGED
|
@@ -68,6 +68,7 @@ When searching for elements, follow this priority order for efficiency:
|
|
|
68
68
|
- `install-app.ts` - Install apps
|
|
69
69
|
- `uninstall-app.ts` - Uninstall apps
|
|
70
70
|
- `clear-app.ts` - Clear app data / cache without uninstall (`appium_mobile_clear_app`; iOS Simulator only, Android broadly)
|
|
71
|
+
- `permissions.ts` - Unified mobile permissions (`appium_mobile_permissions`; action get / update / reset, platform-specific fields)
|
|
71
72
|
- `list-apps.ts` - List installed apps
|
|
72
73
|
|
|
73
74
|
### Test Generation (`test-generation/`)
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import type { ContentResult, FastMCP } from 'fastmcp';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { getDriver, getPlatformName, PLATFORM } from '../../session-store.js';
|
|
4
|
+
import { execute } from '../../command.js';
|
|
5
|
+
|
|
6
|
+
const iosPermissionStateSchema = z.enum(['yes', 'no', 'unset', 'limited']);
|
|
7
|
+
|
|
8
|
+
export default function mobilePermissions(server: FastMCP): void {
|
|
9
|
+
const schema = z.object({
|
|
10
|
+
action: z
|
|
11
|
+
.enum(['get', 'update', 'reset'])
|
|
12
|
+
.describe(
|
|
13
|
+
'get: list (Android) or read one privacy state (iOS Simulator). ' +
|
|
14
|
+
'update: grant/revoke (Android) or set privacy map (iOS Simulator). ' +
|
|
15
|
+
'reset: restore a privacy prompt for the app under test (iOS only).'
|
|
16
|
+
),
|
|
17
|
+
sessionId: z
|
|
18
|
+
.string()
|
|
19
|
+
.optional()
|
|
20
|
+
.describe('Session ID to target. If omitted, uses the active session.'),
|
|
21
|
+
permissionFilter: z
|
|
22
|
+
.enum(['denied', 'granted', 'requested'])
|
|
23
|
+
.optional()
|
|
24
|
+
.describe(
|
|
25
|
+
'Android get only: which bucket to return. Defaults to requested per UiAutomator2.'
|
|
26
|
+
),
|
|
27
|
+
appPackage: z
|
|
28
|
+
.string()
|
|
29
|
+
.optional()
|
|
30
|
+
.describe(
|
|
31
|
+
'Android get/update: package to target. Defaults to the app under test.'
|
|
32
|
+
),
|
|
33
|
+
bundleId: z
|
|
34
|
+
.string()
|
|
35
|
+
.optional()
|
|
36
|
+
.describe(
|
|
37
|
+
'iOS get/update: bundle id of the app. Required for iOS get and update.'
|
|
38
|
+
),
|
|
39
|
+
service: z
|
|
40
|
+
.union([z.string(), z.number()])
|
|
41
|
+
.optional()
|
|
42
|
+
.describe(
|
|
43
|
+
'iOS get: privacy service name (e.g. camera, microphone, photos). ' +
|
|
44
|
+
'iOS reset: service name or numeric XCUIProtectedResource id.'
|
|
45
|
+
),
|
|
46
|
+
permissions: z
|
|
47
|
+
.union([z.string(), z.array(z.string())])
|
|
48
|
+
.optional()
|
|
49
|
+
.describe(
|
|
50
|
+
'Android update only: permission name(s), `all` (with pm target), or appops names. Required for Android update.'
|
|
51
|
+
),
|
|
52
|
+
permissionChangeAction: z
|
|
53
|
+
.string()
|
|
54
|
+
.optional()
|
|
55
|
+
.describe(
|
|
56
|
+
'Android update: for pm target grant (default) or revoke; for appops allow, deny, ignore, default.'
|
|
57
|
+
),
|
|
58
|
+
target: z
|
|
59
|
+
.enum(['pm', 'appops'])
|
|
60
|
+
.optional()
|
|
61
|
+
.describe('Android update: pm (default) or appops.'),
|
|
62
|
+
access: z
|
|
63
|
+
.record(z.string(), iosPermissionStateSchema)
|
|
64
|
+
.optional()
|
|
65
|
+
.describe(
|
|
66
|
+
'iOS update only: map of access rule → yes|no|unset|limited (Simulator + AppleSimulatorUtils). Required for iOS update.'
|
|
67
|
+
),
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
server.addTool({
|
|
71
|
+
name: 'appium_mobile_permissions',
|
|
72
|
+
description:
|
|
73
|
+
'Manage mobile app permissions in one place. action=get: Android lists runtime permissions for a package; iOS Simulator reads one service state for a bundle id (needs bundleId + service). action=update: Android changes permissions (grant/revoke or AppOps); iOS Simulator sets privacy via access map (needs bundleId + access). action=reset: iOS only — resets one privacy service for the AUT (needs service).',
|
|
74
|
+
parameters: schema,
|
|
75
|
+
annotations: {
|
|
76
|
+
readOnlyHint: false,
|
|
77
|
+
openWorldHint: false,
|
|
78
|
+
},
|
|
79
|
+
execute: async (
|
|
80
|
+
args: z.infer<typeof schema>,
|
|
81
|
+
_context: Record<string, unknown> | undefined
|
|
82
|
+
): Promise<ContentResult> => {
|
|
83
|
+
const driver = getDriver(args.sessionId);
|
|
84
|
+
if (!driver) {
|
|
85
|
+
throw new Error('No driver found');
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
try {
|
|
89
|
+
const platform = getPlatformName(driver);
|
|
90
|
+
|
|
91
|
+
if (args.action === 'get') {
|
|
92
|
+
if (platform === PLATFORM.android) {
|
|
93
|
+
const params: Record<string, unknown> = {};
|
|
94
|
+
if (args.permissionFilter != null) {
|
|
95
|
+
params.type = args.permissionFilter;
|
|
96
|
+
}
|
|
97
|
+
if (args.appPackage != null) {
|
|
98
|
+
params.appPackage = args.appPackage;
|
|
99
|
+
}
|
|
100
|
+
const raw = await execute(driver, 'mobile: getPermissions', params);
|
|
101
|
+
return {
|
|
102
|
+
content: [{ type: 'text', text: JSON.stringify(raw, null, 2) }],
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
if (platform === PLATFORM.ios) {
|
|
106
|
+
if (!args.bundleId) {
|
|
107
|
+
throw new Error(
|
|
108
|
+
'iOS get requires bundleId and service (string).'
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
if (
|
|
112
|
+
args.service === undefined ||
|
|
113
|
+
typeof args.service === 'number'
|
|
114
|
+
) {
|
|
115
|
+
throw new Error(
|
|
116
|
+
'iOS get requires service as a string name (e.g. camera, photos).'
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
const raw = await execute(driver, 'mobile: getPermission', {
|
|
120
|
+
bundleId: args.bundleId,
|
|
121
|
+
service: args.service,
|
|
122
|
+
});
|
|
123
|
+
return {
|
|
124
|
+
content: [{ type: 'text', text: String(raw) }],
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
throw new Error(
|
|
128
|
+
`Unsupported platform: ${platform}. Only Android and iOS are supported.`
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
if (args.action === 'update') {
|
|
133
|
+
if (platform === PLATFORM.android) {
|
|
134
|
+
if (args.permissions === undefined) {
|
|
135
|
+
throw new Error('Android update requires permissions.');
|
|
136
|
+
}
|
|
137
|
+
const params: Record<string, unknown> = {
|
|
138
|
+
permissions: args.permissions,
|
|
139
|
+
};
|
|
140
|
+
if (args.appPackage != null) {
|
|
141
|
+
params.appPackage = args.appPackage;
|
|
142
|
+
}
|
|
143
|
+
if (args.permissionChangeAction != null) {
|
|
144
|
+
params.action = args.permissionChangeAction;
|
|
145
|
+
}
|
|
146
|
+
if (args.target != null) {
|
|
147
|
+
params.target = args.target;
|
|
148
|
+
}
|
|
149
|
+
await execute(driver, 'mobile: changePermissions', params);
|
|
150
|
+
return {
|
|
151
|
+
content: [
|
|
152
|
+
{ type: 'text', text: 'Permissions updated successfully.' },
|
|
153
|
+
],
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
if (platform === PLATFORM.ios) {
|
|
157
|
+
if (!args.bundleId || !args.access) {
|
|
158
|
+
throw new Error('iOS update requires bundleId and access map.');
|
|
159
|
+
}
|
|
160
|
+
await execute(driver, 'mobile: setPermission', {
|
|
161
|
+
bundleId: args.bundleId,
|
|
162
|
+
access: args.access,
|
|
163
|
+
});
|
|
164
|
+
return {
|
|
165
|
+
content: [
|
|
166
|
+
{
|
|
167
|
+
type: 'text',
|
|
168
|
+
text: 'Permission settings updated successfully.',
|
|
169
|
+
},
|
|
170
|
+
],
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
throw new Error(
|
|
174
|
+
`Unsupported platform: ${platform}. Only Android and iOS are supported.`
|
|
175
|
+
);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
if (platform !== PLATFORM.ios) {
|
|
179
|
+
throw new Error(
|
|
180
|
+
'action=reset is only supported on iOS (mobile: resetPermission for the AUT).'
|
|
181
|
+
);
|
|
182
|
+
}
|
|
183
|
+
if (args.service === undefined) {
|
|
184
|
+
throw new Error('iOS reset requires service (name or numeric id).');
|
|
185
|
+
}
|
|
186
|
+
await execute(driver, 'mobile: resetPermission', {
|
|
187
|
+
service: args.service,
|
|
188
|
+
});
|
|
189
|
+
return {
|
|
190
|
+
content: [{ type: 'text', text: 'Permission reset successfully.' }],
|
|
191
|
+
};
|
|
192
|
+
} catch (err: unknown) {
|
|
193
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
194
|
+
return {
|
|
195
|
+
content: [
|
|
196
|
+
{
|
|
197
|
+
type: 'text',
|
|
198
|
+
text: `Failed permissions action ${args.action}. err: ${message}`,
|
|
199
|
+
},
|
|
200
|
+
],
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
});
|
|
205
|
+
}
|
package/src/tools/index.ts
CHANGED
|
@@ -69,6 +69,7 @@ import listApps from './app-management/list-apps.js';
|
|
|
69
69
|
import isAppInstalled from './app-management/is-app-installed.js';
|
|
70
70
|
import queryAppState from './app-management/query-app-state.js';
|
|
71
71
|
import clearApp from './app-management/clear-app.js';
|
|
72
|
+
import mobilePermissions from './app-management/permissions.js';
|
|
72
73
|
import deepLink from './app-management/deep-link.js';
|
|
73
74
|
import getContexts from './context/get-contexts.js';
|
|
74
75
|
import switchContext from './context/switch-context.js';
|
|
@@ -203,6 +204,7 @@ export default function registerTools(server: FastMCP): void {
|
|
|
203
204
|
isAppInstalled(server);
|
|
204
205
|
queryAppState(server);
|
|
205
206
|
clearApp(server);
|
|
207
|
+
mobilePermissions(server);
|
|
206
208
|
deepLink(server);
|
|
207
209
|
|
|
208
210
|
// Context Management
|