appium-mcp 1.63.0 → 1.64.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 +12 -0
- package/README.md +25 -10
- package/dist/tests/tools/session/session.test.d.ts +2 -0
- package/dist/tests/tools/session/session.test.d.ts.map +1 -0
- package/dist/tests/tools/session/session.test.js +192 -0
- package/dist/tests/tools/session/session.test.js.map +1 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +2 -8
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/session/create-session.d.ts +5 -1
- package/dist/tools/session/create-session.d.ts.map +1 -1
- package/dist/tools/session/create-session.js +70 -110
- package/dist/tools/session/create-session.js.map +1 -1
- package/dist/tools/session/delete-session.d.ts +1 -1
- package/dist/tools/session/delete-session.d.ts.map +1 -1
- package/dist/tools/session/delete-session.js +18 -41
- package/dist/tools/session/delete-session.js.map +1 -1
- package/dist/tools/session/list-sessions.d.ts +1 -1
- package/dist/tools/session/list-sessions.d.ts.map +1 -1
- package/dist/tools/session/list-sessions.js +14 -26
- package/dist/tools/session/list-sessions.js.map +1 -1
- package/dist/tools/session/select-session.d.ts +1 -1
- package/dist/tools/session/select-session.d.ts.map +1 -1
- package/dist/tools/session/select-session.js +6 -20
- package/dist/tools/session/select-session.js.map +1 -1
- package/dist/tools/session/session.d.ts +3 -0
- package/dist/tools/session/session.d.ts.map +1 -0
- package/dist/tools/session/session.js +92 -0
- package/dist/tools/session/session.js.map +1 -0
- package/package.json +1 -1
- package/server.json +2 -2
- package/src/resources/submodules.zip +0 -0
- package/src/tools/README.md +6 -3
- package/src/tools/index.ts +2 -8
- package/src/tools/session/create-session.ts +106 -146
- package/src/tools/session/delete-session.ts +22 -49
- package/src/tools/session/list-sessions.ts +16 -29
- package/src/tools/session/select-session.ts +8 -25
- package/src/tools/session/session.ts +112 -0
- package/dist/tests/tools/session/create-session.test.d.ts +0 -2
- package/dist/tests/tools/session/create-session.test.d.ts.map +0 -1
- package/dist/tests/tools/session/create-session.test.js +0 -107
- package/dist/tests/tools/session/create-session.test.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## [1.64.0](https://github.com/appium/appium-mcp/compare/v1.63.1...v1.64.0) (2026-04-23)
|
|
2
|
+
|
|
3
|
+
### Features
|
|
4
|
+
|
|
5
|
+
* **session:** consolidate session tools ([#283](https://github.com/appium/appium-mcp/issues/283)) ([edc252e](https://github.com/appium/appium-mcp/commit/edc252e6cab5786cf394d47cf6f9bb06d310bd5b))
|
|
6
|
+
|
|
7
|
+
## [1.63.1](https://github.com/appium/appium-mcp/compare/v1.63.0...v1.63.1) (2026-04-22)
|
|
8
|
+
|
|
9
|
+
### Miscellaneous Chores
|
|
10
|
+
|
|
11
|
+
* **docs:** add env var section in configuration ([#285](https://github.com/appium/appium-mcp/issues/285)) ([fa6f483](https://github.com/appium/appium-mcp/commit/fa6f483682873bd6499ffd112504cc417337f298))
|
|
12
|
+
|
|
1
13
|
## [1.63.0](https://github.com/appium/appium-mcp/compare/v1.62.0...v1.63.0) (2026-04-22)
|
|
2
14
|
|
|
3
15
|
### Features
|
package/README.md
CHANGED
|
@@ -134,6 +134,25 @@ This will automatically configure the MCP server for use with Claude Code. Make
|
|
|
134
134
|
|
|
135
135
|
## ⚙️ Configuration
|
|
136
136
|
|
|
137
|
+
### Environment Variables
|
|
138
|
+
|
|
139
|
+
> **Note:** Appium driver prerequisites (`ANDROID_HOME`, `JAVA_HOME`, UiAutomator2/XCUITest driver setup) are not listed here, they are system-level requirements. Once this MCP server is configured, ask your AI assistant to set up the environment for you using the built-in `appium_skills` tool.
|
|
140
|
+
|
|
141
|
+
| Variable | Required | Description |
|
|
142
|
+
| -------- | -------- | ----------- |
|
|
143
|
+
| `CAPABILITIES_CONFIG` | Optional | Absolute path to a `capabilities.json` file with per-platform capability presets |
|
|
144
|
+
| `SCREENSHOTS_DIR` | Optional | Directory where screenshots and screen recordings are saved. Defaults to the current working directory |
|
|
145
|
+
| `NO_UI` | Optional | Set to `true` or `1` to disable HTML UI components — faster responses, fewer tokens. See [NO_UI Mode](#no_ui-mode) |
|
|
146
|
+
| `APPIUM_MCP_WDA_APP_PATH` | Optional | Absolute path to a pre-extracted `WebDriverAgentRunner-Runner.app` bundle. When set, `prepare_ios_simulator` skips all GitHub downloads and uses this bundle directly — useful in environments where external downloads are blocked |
|
|
147
|
+
| `REMOTE_SERVER_URL_ALLOW_REGEX` | Optional | Regex pattern that remote Appium server URLs must match. Defaults to `^https?://` |
|
|
148
|
+
| `AI_VISION_API_BASE_URL` | Required for AI Vision | Base URL of the OpenAI-compatible vision model API |
|
|
149
|
+
| `AI_VISION_API_KEY` | Required for AI Vision | API key for the vision model provider |
|
|
150
|
+
| `AI_VISION_MODEL` | Optional | Vision model name (default: `Qwen3-VL-235B-A22B-Instruct`) |
|
|
151
|
+
| `AI_VISION_COORD_TYPE` | Optional | Coordinate type: `normalized` (default) or `absolute` |
|
|
152
|
+
| `AI_VISION_IMAGE_MAX_WIDTH` | Optional | Max image width in pixels before compression (default: `1080`) |
|
|
153
|
+
| `AI_VISION_IMAGE_QUALITY` | Optional | JPEG quality 1–100 for compressed screenshots sent to the vision API (default: `80`) |
|
|
154
|
+
| `SENTENCE_TRANSFORMERS_MODEL` | Optional | Hugging Face model used for semantic search in Appium documentation queries (default: `Xenova/all-MiniLM-L6-v2`) |
|
|
155
|
+
|
|
137
156
|
### Capabilities
|
|
138
157
|
|
|
139
158
|
Create a `capabilities.json` file to define your device capabilities:
|
|
@@ -166,7 +185,7 @@ Set the `CAPABILITIES_CONFIG` environment variable to point to your configuratio
|
|
|
166
185
|
|
|
167
186
|
#### Platform names and "general" mode
|
|
168
187
|
|
|
169
|
-
- You can pass any platform name to `
|
|
188
|
+
- You can pass any platform name to `appium_session_management` (action=create).
|
|
170
189
|
- If the platform is `ios` or `android`, the server builds capabilities for that platform (including selected device info when local).
|
|
171
190
|
- If the platform is any other value, it is treated internally as `general`:
|
|
172
191
|
- The session will use the provided `capabilities` exactly as given, or
|
|
@@ -198,7 +217,7 @@ Configure AI-powered element finding using vision models. This feature allows yo
|
|
|
198
217
|
"env": {
|
|
199
218
|
"ANDROID_HOME": "/path/to/android/sdk",
|
|
200
219
|
"AI_VISION_API_BASE_URL": "https://dashscope.aliyuncs.com/compatible-mode/v1",
|
|
201
|
-
"
|
|
220
|
+
"AI_VISION_API_KEY": "your_api_key_here"
|
|
202
221
|
}
|
|
203
222
|
}
|
|
204
223
|
}
|
|
@@ -206,10 +225,7 @@ Configure AI-powered element finding using vision models. This feature allows yo
|
|
|
206
225
|
|
|
207
226
|
**Optional Environment Variables:**
|
|
208
227
|
|
|
209
|
-
- `
|
|
210
|
-
- `AI_VISION_COORD_TYPE`: Coordinate type - `normalized` or `absolute` (default: `normalized`)
|
|
211
|
-
- `AI_VISION_IMAGE_MAX_WIDTH`: Max image width for compression in pixels (default: `1080`)
|
|
212
|
-
- `AI_VISION_IMAGE_QUALITY`: JPEG quality 1-100 (default: `80`)
|
|
228
|
+
See the [Environment Variables](#environment-variables) table above for the full list of `AI_VISION_*` options and their defaults.
|
|
213
229
|
|
|
214
230
|
**Supported Vision Model Providers:**
|
|
215
231
|
|
|
@@ -272,7 +288,7 @@ The following tools return lightweight text-only responses when NO_UI is enabled
|
|
|
272
288
|
- `appium_get_page_source` - Returns XML as text without interactive inspector UI
|
|
273
289
|
- `generate_locators` - Returns locator data as JSON without interactive UI
|
|
274
290
|
- `select_device` - Returns device list as text without picker UI
|
|
275
|
-
- `
|
|
291
|
+
- `appium_session_management` (action=create) - Returns session info as text without dashboard UI
|
|
276
292
|
- `appium_context` - Returns context list as text with `action=list` without switcher UI
|
|
277
293
|
- `appium_app_lifecycle` (action=`list`) - Returns app list as JSON without interactive UI
|
|
278
294
|
|
|
@@ -300,13 +316,12 @@ MCP Appium provides a comprehensive set of tools organized into the following ca
|
|
|
300
316
|
|
|
301
317
|
| Tool | Description |
|
|
302
318
|
| ---------------- | ----------------------------------------------------------------------------------------------------------- |
|
|
303
|
-
| `
|
|
304
|
-
| `delete_session` | Delete the current mobile session and clean up resources |
|
|
319
|
+
| `appium_session_management` | Unified session management. `action=create`: start a new session for Android, iOS, or `general` capabilities (see 'general' mode above); forwards capabilities to a remote server via WebDriver `newSession` when `remoteServerUrl` is provided. `action=delete`: stop and clean up a session (defaults to active). `action=list`: show all active sessions. `action=select`: switch the active session by `sessionId`. |
|
|
305
320
|
| `appium_mobile_device_control` | Control device behavior: lock/unlock the screen, shake the device, or open the notifications panel (`action`: `lock` \| `unlock` \| `shake` \| `open_notifications`). `shake` is iOS only; `open_notifications` is Android only; `seconds` is optional for timed lock. |
|
|
306
321
|
| `appium_get_settings` | Read current Appium driver session settings (idle timeouts, animation-related flags, selector waits, etc.). Helps diagnose and tune flaky automation. |
|
|
307
322
|
| `appium_update_settings` | Merge key-value updates into driver session settings (driver-specific keys; use `appium_get_settings` to inspect). |
|
|
308
323
|
|
|
309
|
-
The remote server URL in `
|
|
324
|
+
The remote server URL in `appium_session_management` (action=create) can be set via the `remoteServerUrl` parameter.
|
|
310
325
|
If `REMOTE_SERVER_URL_ALLOW_REGEX` is set, the URL must match the provided regex pattern for security reasons.
|
|
311
326
|
This allows you to restrict which remote servers can be used with your MCP Appium instance, preventing unauthorized connections.
|
|
312
327
|
The default regex pattern allows any URL that starts with `http://` or `https://`.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session.test.d.ts","sourceRoot":"","sources":["../../../../src/tests/tools/session/session.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import { describe, test, expect, jest } from '@jest/globals';
|
|
2
|
+
// ── module mocks ──────────────────────────────────────────────────────────────
|
|
3
|
+
jest.unstable_mockModule('../../../tools/session/select-device', () => ({
|
|
4
|
+
getSelectedDevice: () => 'device-udid',
|
|
5
|
+
getSelectedDeviceType: () => 'simulator',
|
|
6
|
+
getSelectedDeviceInfo: () => ({ name: 'iPhone 12', platform: '16.0' }),
|
|
7
|
+
clearSelectedDevice: () => { },
|
|
8
|
+
}));
|
|
9
|
+
jest.unstable_mockModule('../../../devicemanager/ios-manager', () => ({
|
|
10
|
+
IOSManager: {
|
|
11
|
+
getInstance: () => ({
|
|
12
|
+
getDevicesByType: async (_t) => [{ udid: 'u1' }],
|
|
13
|
+
}),
|
|
14
|
+
},
|
|
15
|
+
}));
|
|
16
|
+
jest.unstable_mockModule('../../../logger', () => ({
|
|
17
|
+
default: { debug: () => { }, info: () => { }, warn: () => { }, error: () => { } },
|
|
18
|
+
}));
|
|
19
|
+
jest.unstable_mockModule('appium-uiautomator2-driver', () => ({
|
|
20
|
+
AndroidUiautomator2Driver: class {
|
|
21
|
+
},
|
|
22
|
+
}));
|
|
23
|
+
jest.unstable_mockModule('appium-xcuitest-driver', () => ({
|
|
24
|
+
XCUITestDriver: class {
|
|
25
|
+
},
|
|
26
|
+
}));
|
|
27
|
+
jest.unstable_mockModule('webdriver', () => ({
|
|
28
|
+
default: { newSession: async () => ({ sessionId: 'remote-session-id' }) },
|
|
29
|
+
}));
|
|
30
|
+
jest.unstable_mockModule('../../../session-store', () => ({
|
|
31
|
+
getDriver: jest.fn(),
|
|
32
|
+
getSessionId: jest.fn(),
|
|
33
|
+
listSessions: jest.fn(),
|
|
34
|
+
setActiveSession: jest.fn(),
|
|
35
|
+
safeDeleteSession: jest.fn(),
|
|
36
|
+
setSession: jest.fn(),
|
|
37
|
+
getPlatformName: jest.fn(),
|
|
38
|
+
PLATFORM: { ios: 'iOS', android: 'Android' },
|
|
39
|
+
}));
|
|
40
|
+
jest.unstable_mockModule('../../../ui/mcp-ui-utils', () => ({
|
|
41
|
+
createUIResource: jest.fn(() => ({})),
|
|
42
|
+
createSessionDashboardUI: jest.fn(() => ''),
|
|
43
|
+
addUIResourceToResponse: jest.fn((_result, _ui) => _result),
|
|
44
|
+
}));
|
|
45
|
+
// ── imports ───────────────────────────────────────────────────────────────────
|
|
46
|
+
const { getDriver, getSessionId, listSessions, setActiveSession, safeDeleteSession, } = await import('../../../session-store.js');
|
|
47
|
+
const mockGetDriver = getDriver;
|
|
48
|
+
const mockGetSessionId = getSessionId;
|
|
49
|
+
const mockListSessions = listSessions;
|
|
50
|
+
const mockSetActiveSession = setActiveSession;
|
|
51
|
+
const mockSafeDeleteSession = safeDeleteSession;
|
|
52
|
+
const { buildAndroidCapabilities, buildIOSCapabilities, getPortFromUrl, validateRemoteServerUrl, } = await import('../../../tools/session/create-session.js');
|
|
53
|
+
// ── tool helper ───────────────────────────────────────────────────────────────
|
|
54
|
+
const mockServer = { addTool: jest.fn() };
|
|
55
|
+
async function getToolExecute() {
|
|
56
|
+
const { default: session } = await import('../../../tools/session/session.js');
|
|
57
|
+
session(mockServer);
|
|
58
|
+
return mockServer.addTool.mock.calls.at(-1)?.[0];
|
|
59
|
+
}
|
|
60
|
+
// ── appium_session_management tool tests ─────────────────────────────────────────────────
|
|
61
|
+
describe('appium_session_management tool', () => {
|
|
62
|
+
describe('action: list', () => {
|
|
63
|
+
test('returns "no sessions" when none exist', async () => {
|
|
64
|
+
const tool = await getToolExecute();
|
|
65
|
+
mockListSessions.mockReturnValue([]);
|
|
66
|
+
const result = await tool.execute({ action: 'list' }, undefined);
|
|
67
|
+
expect(result.content[0].text).toBe('No active sessions found.');
|
|
68
|
+
});
|
|
69
|
+
test('returns session summary when sessions exist', async () => {
|
|
70
|
+
const tool = await getToolExecute();
|
|
71
|
+
mockListSessions.mockReturnValue([
|
|
72
|
+
{
|
|
73
|
+
sessionId: 'abc123',
|
|
74
|
+
isActive: true,
|
|
75
|
+
platform: 'Android',
|
|
76
|
+
automationName: 'UiAutomator2',
|
|
77
|
+
deviceName: 'Pixel 6',
|
|
78
|
+
currentContext: 'NATIVE_APP',
|
|
79
|
+
},
|
|
80
|
+
]);
|
|
81
|
+
mockGetSessionId.mockReturnValue('abc123');
|
|
82
|
+
mockGetDriver.mockReturnValue({
|
|
83
|
+
constructor: { name: 'AndroidDriver' },
|
|
84
|
+
});
|
|
85
|
+
const result = await tool.execute({ action: 'list' }, undefined);
|
|
86
|
+
expect(result.content[0].text).toContain('abc123');
|
|
87
|
+
expect(result.content[0].text).toContain('active');
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
describe('action: select', () => {
|
|
91
|
+
test('returns error when sessionId is missing', async () => {
|
|
92
|
+
const tool = await getToolExecute();
|
|
93
|
+
const result = await tool.execute({ action: 'select' }, undefined);
|
|
94
|
+
expect(result.content[0].text).toBe('sessionId is required for select action');
|
|
95
|
+
});
|
|
96
|
+
test('returns error when session is not found', async () => {
|
|
97
|
+
const tool = await getToolExecute();
|
|
98
|
+
mockSetActiveSession.mockReturnValue(false);
|
|
99
|
+
const result = await tool.execute({ action: 'select', sessionId: 'bad-id' }, undefined);
|
|
100
|
+
expect(result.isError).toBe(true);
|
|
101
|
+
expect(result.content[0].text).toContain('bad-id');
|
|
102
|
+
expect(result.content[0].text).toContain('not found');
|
|
103
|
+
});
|
|
104
|
+
test('returns success when session is activated', async () => {
|
|
105
|
+
const tool = await getToolExecute();
|
|
106
|
+
mockSetActiveSession.mockReturnValue(true);
|
|
107
|
+
const result = await tool.execute({ action: 'select', sessionId: 'abc123' }, undefined);
|
|
108
|
+
expect(result.content[0].text).toContain('abc123');
|
|
109
|
+
expect(result.content[0].text).toContain('now active');
|
|
110
|
+
});
|
|
111
|
+
});
|
|
112
|
+
describe('action: delete', () => {
|
|
113
|
+
test('deletes active session when no sessionId given', async () => {
|
|
114
|
+
const tool = await getToolExecute();
|
|
115
|
+
mockSafeDeleteSession.mockResolvedValue(true);
|
|
116
|
+
const result = await tool.execute({ action: 'delete' }, undefined);
|
|
117
|
+
expect(result.content[0].text).toContain('deleted successfully');
|
|
118
|
+
});
|
|
119
|
+
test('reports not found when session does not exist', async () => {
|
|
120
|
+
const tool = await getToolExecute();
|
|
121
|
+
mockSafeDeleteSession.mockResolvedValue(false);
|
|
122
|
+
const result = await tool.execute({ action: 'delete', sessionId: 'ghost' }, undefined);
|
|
123
|
+
expect(result.content[0].text).toContain('ghost');
|
|
124
|
+
expect(result.content[0].text).toContain('not found');
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
describe('action: create', () => {
|
|
128
|
+
test('returns error when platform is missing', async () => {
|
|
129
|
+
const tool = await getToolExecute();
|
|
130
|
+
const result = await tool.execute({ action: 'create' }, undefined);
|
|
131
|
+
expect(result.content[0].text).toBe('platform is required for create action');
|
|
132
|
+
});
|
|
133
|
+
});
|
|
134
|
+
});
|
|
135
|
+
// ── capability builder tests ──────────────────────────────────────────────────
|
|
136
|
+
describe('buildAndroidCapabilities', () => {
|
|
137
|
+
test('includes udid for local server and removes empty values', () => {
|
|
138
|
+
const caps = buildAndroidCapabilities({ 'appium:app': '/path/app.apk' }, { 'appium:deviceName': '' }, false);
|
|
139
|
+
expect(caps.platformName).toBe('Android');
|
|
140
|
+
expect(caps['appium:app']).toBe('/path/app.apk');
|
|
141
|
+
expect(caps['appium:udid']).toBe('device-udid');
|
|
142
|
+
expect(caps).not.toHaveProperty('appium:deviceName');
|
|
143
|
+
expect(caps['appium:settings[actionAcknowledgmentTimeout]']).toBe(0);
|
|
144
|
+
expect(caps['appium:settings[waitForIdleTimeout]']).toBe(0);
|
|
145
|
+
expect(caps['appium:settings[waitForSelectorTimeout]']).toBe(0);
|
|
146
|
+
});
|
|
147
|
+
test('does not include udid for remote server', () => {
|
|
148
|
+
const caps = buildAndroidCapabilities({}, undefined, true);
|
|
149
|
+
expect(caps.platformName).toBe('Android');
|
|
150
|
+
expect(caps).not.toHaveProperty('appium:udid');
|
|
151
|
+
});
|
|
152
|
+
});
|
|
153
|
+
describe('buildIOSCapabilities', () => {
|
|
154
|
+
test('uses selected device info for local simulator', async () => {
|
|
155
|
+
const caps = await buildIOSCapabilities({ 'custom:cap': 'value' }, { 'appium:bundleId': 'com.example.app' }, false);
|
|
156
|
+
expect(caps.platformName).toBe('iOS');
|
|
157
|
+
expect(caps['appium:deviceName']).toBe('iPhone 12');
|
|
158
|
+
expect(caps['appium:platformVersion']).toBe('16.0');
|
|
159
|
+
expect(caps['appium:usePrebuiltWDA']).toBe(true);
|
|
160
|
+
expect(caps['appium:wdaStartupRetries']).toBe(4);
|
|
161
|
+
expect(caps['custom:cap']).toBe('value');
|
|
162
|
+
expect(caps['appium:bundleId']).toBe('com.example.app');
|
|
163
|
+
});
|
|
164
|
+
test('falls back to defaults for remote server', async () => {
|
|
165
|
+
const caps = await buildIOSCapabilities({}, undefined, true);
|
|
166
|
+
expect(caps.platformName).toBe('iOS');
|
|
167
|
+
expect(caps['appium:deviceName']).toBe('iPhone Simulator');
|
|
168
|
+
expect(caps).not.toHaveProperty('appium:udid');
|
|
169
|
+
});
|
|
170
|
+
});
|
|
171
|
+
// ── URL helpers ───────────────────────────────────────────────────────────────
|
|
172
|
+
describe('getPortFromUrl', () => {
|
|
173
|
+
test.each([
|
|
174
|
+
['https://hub.browserstack.com/wd/hub', 443],
|
|
175
|
+
['http://localhost/wd/hub', 80],
|
|
176
|
+
['http://localhost:4723/wd/hub', 4723],
|
|
177
|
+
['https://example.com:8443/path', 8443],
|
|
178
|
+
])('%s → %i', (url, expected) => {
|
|
179
|
+
expect(getPortFromUrl(new URL(url))).toBe(expected);
|
|
180
|
+
});
|
|
181
|
+
});
|
|
182
|
+
describe('validateRemoteServerUrl', () => {
|
|
183
|
+
test.each(['http://localhost:4723', 'https://example.com'])('accepts valid URL: %s', (url) => expect(() => validateRemoteServerUrl(url)).not.toThrow());
|
|
184
|
+
test.each(['invalid-url', 'ftp://example.com'])('rejects invalid URL: %s', (url) => expect(() => validateRemoteServerUrl(url)).toThrow(`Invalid remoteServerUrl: ${url}.`));
|
|
185
|
+
test('accepts URL matching custom regex', () => {
|
|
186
|
+
expect(() => validateRemoteServerUrl('ftp://localhost:4723', '^.+//localhost:4723(/.*)?$')).not.toThrow();
|
|
187
|
+
});
|
|
188
|
+
test('rejects URL not matching custom regex', () => {
|
|
189
|
+
expect(() => validateRemoteServerUrl('http://localhost:5000', '^https?://localhost:4723(/.*)?$')).toThrow('Invalid remoteServerUrl: http://localhost:5000.');
|
|
190
|
+
});
|
|
191
|
+
});
|
|
192
|
+
//# sourceMappingURL=session.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session.test.js","sourceRoot":"","sources":["../../../../src/tests/tools/session/session.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAE7D,iFAAiF;AAEjF,IAAI,CAAC,mBAAmB,CAAC,sCAAsC,EAAE,GAAG,EAAE,CAAC,CAAC;IACtE,iBAAiB,EAAE,GAAG,EAAE,CAAC,aAAa;IACtC,qBAAqB,EAAE,GAAG,EAAE,CAAC,WAAW;IACxC,qBAAqB,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;IACtE,mBAAmB,EAAE,GAAG,EAAE,GAAE,CAAC;CAC9B,CAAC,CAAC,CAAC;AAEJ,IAAI,CAAC,mBAAmB,CAAC,oCAAoC,EAAE,GAAG,EAAE,CAAC,CAAC;IACpE,UAAU,EAAE;QACV,WAAW,EAAE,GAAG,EAAE,CAAC,CAAC;YAClB,gBAAgB,EAAE,KAAK,EAAE,EAAO,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;SACtD,CAAC;KACH;CACF,CAAC,CAAC,CAAC;AAEJ,IAAI,CAAC,mBAAmB,CAAC,iBAAiB,EAAE,GAAG,EAAE,CAAC,CAAC;IACjD,OAAO,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,GAAE,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,GAAE,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,GAAE,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,G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G,CAAC,CAAC,CAAC,OAAO,CAChD,4BAA4B,GAAG,GAAG,CACnC,CACJ,CAAC;IAEF,IAAI,CAAC,mCAAmC,EAAE,GAAG,EAAE;QAC7C,MAAM,CAAC,GAAG,EAAE,CACV,uBAAuB,CACrB,sBAAsB,EACtB,4BAA4B,CAC7B,CACF,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;IAClB,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,uCAAuC,EAAE,GAAG,EAAE;QACjD,MAAM,CAAC,GAAG,EAAE,CACV,uBAAuB,CACrB,uBAAuB,EACvB,iCAAiC,CAClC,CACF,CAAC,OAAO,CAAC,iDAAiD,CAAC,CAAC;IAC/D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAqCvC,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CA2H3D"}
|
package/dist/tools/index.js
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import log from '../logger.js';
|
|
2
2
|
import answerAppium from './documentation/answer-appium.js';
|
|
3
3
|
import appiumSkills from './documentation/appium-skills.js';
|
|
4
|
-
import
|
|
5
|
-
import deleteSession from './session/delete-session.js';
|
|
6
|
-
import listSessions from './session/list-sessions.js';
|
|
7
|
-
import selectSession from './session/select-session.js';
|
|
4
|
+
import session from './session/session.js';
|
|
8
5
|
import generateLocators from './test-generation/locators.js';
|
|
9
6
|
import selectDevice from './session/select-device.js';
|
|
10
7
|
import mobileDeviceControl from './session/device-control.js';
|
|
@@ -101,10 +98,7 @@ export default function registerTools(server) {
|
|
|
101
98
|
};
|
|
102
99
|
// Session Management
|
|
103
100
|
selectDevice(server);
|
|
104
|
-
|
|
105
|
-
listSessions(server);
|
|
106
|
-
selectSession(server);
|
|
107
|
-
deleteSession(server);
|
|
101
|
+
session(server);
|
|
108
102
|
mobileDeviceControl(server);
|
|
109
103
|
geolocation(server);
|
|
110
104
|
deviceInfo(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,
|
|
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,OAAO,MAAM,sBAAsB,CAAC;AAC3C,OAAO,gBAAgB,MAAM,+BAA+B,CAAC;AAC7D,OAAO,YAAY,MAAM,4BAA4B,CAAC;AACtD,OAAO,mBAAmB,MAAM,6BAA6B,CAAC;AAC9D,OAAO,WAAW,MAAM,0BAA0B,CAAC;AACnD,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD,OAAO,YAAY,MAAM,4BAA4B,CAAC;AACtD,OAAO,cAAc,MAAM,8BAA8B,CAAC;AAC1D,OAAO,mBAAmB,MAAM,gCAAgC,CAAC;AACjE,OAAO,YAAY,MAAM,qCAAqC,CAAC;AAC/D,OAAO,OAAO,MAAM,uBAAuB,CAAC;AAC5C,OAAO,kBAAkB,MAAM,+B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,MAAM,CAAC,CAAC;IACpB,QAAQ,CAAC,MAAM,CAAC,CAAC;IACjB,QAAQ,CAAC,MAAM,CAAC,CAAC;IACjB,QAAQ,CAAC,MAAM,CAAC,CAAC;IACjB,OAAO,CAAC,MAAM,CAAC,CAAC;IAChB,mBAAmB,CAAC,MAAM,CAAC,CAAC;IAC5B,SAAS,CAAC,MAAM,CAAC,CAAC;IAClB,gBAAgB,CAAC,MAAM,CAAC,CAAC;IACzB,aAAa,CAAC,MAAM,CAAC,CAAC;IACtB,WAAW,CAAC,MAAM,CAAC,CAAC;IACpB,KAAK,CAAC,MAAM,CAAC,CAAC;IACd,UAAU,CAAC,MAAM,CAAC,CAAC;IACnB,aAAa,CAAC,MAAM,CAAC,CAAC;IACtB,eAAe,CAAC,MAAM,CAAC,CAAC;IAExB,iBAAiB;IACjB,GAAG,CAAC,MAAM,CAAC,CAAC;IACZ,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAE1B,qBAAqB;IACrB,OAAO,CAAC,MAAM,CAAC,CAAC;IAEhB,kBAAkB;IAClB,gBAAgB,CAAC,MAAM,CAAC,CAAC;IACzB,YAAY,CAAC,MAAM,CAAC,CAAC;IAErB,gBAAgB;IAChB,YAAY,CAAC,MAAM,CAAC,CAAC;IACrB,YAAY,CAAC,MAAM,CAAC,CAAC;IACrB,GAAG,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;AACnC,CAAC"}
|
|
@@ -64,6 +64,10 @@ export declare function validateRemoteServerUrl(remoteServerUrl: string, regexRu
|
|
|
64
64
|
* // Register the tool
|
|
65
65
|
* createSession(server);
|
|
66
66
|
*/
|
|
67
|
-
export
|
|
67
|
+
export declare function createSessionAction(args: {
|
|
68
|
+
platform: 'ios' | 'android' | 'general';
|
|
69
|
+
capabilities?: Record<string, any>;
|
|
70
|
+
remoteServerUrl?: string;
|
|
71
|
+
}): Promise<any>;
|
|
68
72
|
export {};
|
|
69
73
|
//# sourceMappingURL=create-session.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-session.d.ts","sourceRoot":"","sources":["../../../src/tools/session/create-session.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"create-session.d.ts","sourceRoot":"","sources":["../../../src/tools/session/create-session.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAqB/B,UAAU,YAAY;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,uBAAuB,EAAE,MAAM,CAAC;IAChC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AA4BD;;GAEG;AACH,wBAAgB,uBAAuB,CACrC,YAAY,EAAE,YAAY,GACzB,YAAY,CAQd;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC/B,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,SAAS,EAC3C,cAAc,EAAE,OAAO,GACtB,YAAY,CA8Bd;AAED;;GAEG;AACH,wBAAsB,0BAA0B,CAC9C,UAAU,EAAE,WAAW,GAAG,MAAM,GAAG,IAAI,GACtC,OAAO,CAAC,IAAI,CAAC,CAgBf;AAED;;GAEG;AACH,wBAAsB,oBAAoB,CACxC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC/B,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,SAAS,EAC3C,cAAc,EAAE,OAAO,GACtB,OAAO,CAAC,YAAY,CAAC,CAsDvB;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,CAE/C;AAED;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CACrC,eAAe,EAAE,MAAM,EACvB,SAAS,CAAC,EAAE,MAAM,GACjB,IAAI,CAKN;AAqCD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAsB,mBAAmB,CAAC,IAAI,EAAE;IAC9C,QAAQ,EAAE,KAAK,GAAG,SAAS,GAAG,SAAS,CAAC;IACxC,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACnC,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,GAAG,OAAO,CAAC,GAAG,CAAC,CA0Gf"}
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tool to create a new mobile session (Android or iOS)
|
|
3
|
-
*/
|
|
4
|
-
import { z } from 'zod';
|
|
5
1
|
import { access, readFile } from 'node:fs/promises';
|
|
6
2
|
import { constants } from 'node:fs';
|
|
7
3
|
import { URL } from 'node:url';
|
|
@@ -214,112 +210,76 @@ async function createDriverSession(driver, capabilities) {
|
|
|
214
210
|
* // Register the tool
|
|
215
211
|
* createSession(server);
|
|
216
212
|
*/
|
|
217
|
-
export
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
.
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
}
|
|
263
|
-
else {
|
|
264
|
-
finalCapabilities = {
|
|
265
|
-
...configCapabilities.general,
|
|
266
|
-
...customCapabilities,
|
|
267
|
-
};
|
|
268
|
-
}
|
|
269
|
-
log.info(`Creating new ${platform.toUpperCase()} session with capabilities:`, JSON.stringify(finalCapabilities, null, 2));
|
|
270
|
-
let sessionId;
|
|
271
|
-
if (remoteServerUrl) {
|
|
272
|
-
validateRemoteServerUrl(remoteServerUrl, process.env.REMOTE_SERVER_URL_ALLOW_REGEX);
|
|
273
|
-
const remoteUrl = new URL(remoteServerUrl);
|
|
274
|
-
const protocol = remoteUrl.protocol.replace(':', '');
|
|
275
|
-
const port = getPortFromUrl(remoteUrl);
|
|
276
|
-
const user = remoteUrl.username
|
|
277
|
-
? decodeURIComponent(remoteUrl.username)
|
|
278
|
-
: undefined;
|
|
279
|
-
const key = remoteUrl.password
|
|
280
|
-
? decodeURIComponent(remoteUrl.password)
|
|
281
|
-
: undefined;
|
|
282
|
-
log.info(`Sending capabilities to remote server: ${protocol}://${remoteUrl.hostname}:${port}${remoteUrl.pathname}`);
|
|
283
|
-
const client = await WebDriver.newSession({
|
|
284
|
-
protocol,
|
|
285
|
-
hostname: remoteUrl.hostname,
|
|
286
|
-
port,
|
|
287
|
-
path: remoteUrl.pathname,
|
|
288
|
-
...(user && key ? { user, key } : {}),
|
|
289
|
-
capabilities: finalCapabilities,
|
|
290
|
-
});
|
|
291
|
-
sessionId = client.sessionId;
|
|
292
|
-
setSession(client, client.sessionId, finalCapabilities);
|
|
293
|
-
}
|
|
294
|
-
else {
|
|
295
|
-
const driver = createDriverForPlatform(platform);
|
|
296
|
-
log.info(`Sending session with ${driver.constructor.name}`);
|
|
297
|
-
sessionId = await createDriverSession(driver, finalCapabilities);
|
|
298
|
-
setSession(driver, sessionId, finalCapabilities);
|
|
299
|
-
}
|
|
300
|
-
// Safely convert sessionId to string for display
|
|
301
|
-
const sessionIdStr = typeof sessionId === 'string'
|
|
302
|
-
? sessionId
|
|
303
|
-
: String(sessionId || 'Unknown');
|
|
304
|
-
log.info(`${platform.toUpperCase()} session created successfully with ID: ${sessionIdStr}`);
|
|
305
|
-
const totalSessions = listSessions().length;
|
|
306
|
-
const textResponse = textResult(`${platform.toUpperCase()} session created successfully with ID: ${sessionIdStr}\nPlatform: ${finalCapabilities.platformName}\nAutomation: ${finalCapabilities['appium:automationName']}\nDevice: ${finalCapabilities['appium:deviceName']}\nActive sessions: ${totalSessions}`);
|
|
307
|
-
// Add interactive session dashboard UI
|
|
308
|
-
const uiResource = createUIResource(`ui://appium-mcp/session-dashboard/${sessionIdStr}`, createSessionDashboardUI({
|
|
309
|
-
sessionId: sessionIdStr,
|
|
310
|
-
platform: finalCapabilities.platformName,
|
|
311
|
-
automationName: finalCapabilities['appium:automationName'],
|
|
312
|
-
deviceName: finalCapabilities['appium:deviceName'],
|
|
313
|
-
platformVersion: finalCapabilities['appium:platformVersion'],
|
|
314
|
-
udid: finalCapabilities['appium:udid'],
|
|
315
|
-
}));
|
|
316
|
-
return addUIResourceToResponse(textResponse, uiResource);
|
|
317
|
-
}
|
|
318
|
-
catch (error) {
|
|
319
|
-
log.error('Error creating session:', error);
|
|
320
|
-
throw new Error(`Failed to create session: ${error.message}`);
|
|
213
|
+
export async function createSessionAction(args) {
|
|
214
|
+
try {
|
|
215
|
+
const { platform, capabilities: customCapabilities, remoteServerUrl, } = args;
|
|
216
|
+
const configCapabilities = await loadCapabilitiesConfig();
|
|
217
|
+
let finalCapabilities;
|
|
218
|
+
if (platform === 'android') {
|
|
219
|
+
finalCapabilities = buildAndroidCapabilities(configCapabilities.android, customCapabilities, !!remoteServerUrl);
|
|
220
|
+
}
|
|
221
|
+
else if (platform === 'ios') {
|
|
222
|
+
finalCapabilities = await buildIOSCapabilities(configCapabilities.ios, customCapabilities, !!remoteServerUrl);
|
|
223
|
+
}
|
|
224
|
+
else {
|
|
225
|
+
finalCapabilities = {
|
|
226
|
+
...configCapabilities.general,
|
|
227
|
+
...customCapabilities,
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
log.info(`Creating new ${platform.toUpperCase()} session with capabilities:`, JSON.stringify(finalCapabilities, null, 2));
|
|
231
|
+
let sessionId;
|
|
232
|
+
if (remoteServerUrl) {
|
|
233
|
+
validateRemoteServerUrl(remoteServerUrl, process.env.REMOTE_SERVER_URL_ALLOW_REGEX);
|
|
234
|
+
const remoteUrl = new URL(remoteServerUrl);
|
|
235
|
+
const protocol = remoteUrl.protocol.replace(':', '');
|
|
236
|
+
const port = getPortFromUrl(remoteUrl);
|
|
237
|
+
const user = remoteUrl.username
|
|
238
|
+
? decodeURIComponent(remoteUrl.username)
|
|
239
|
+
: undefined;
|
|
240
|
+
const key = remoteUrl.password
|
|
241
|
+
? decodeURIComponent(remoteUrl.password)
|
|
242
|
+
: undefined;
|
|
243
|
+
log.info(`Sending capabilities to remote server: ${protocol}://${remoteUrl.hostname}:${port}${remoteUrl.pathname}`);
|
|
244
|
+
const client = await WebDriver.newSession({
|
|
245
|
+
protocol,
|
|
246
|
+
hostname: remoteUrl.hostname,
|
|
247
|
+
port,
|
|
248
|
+
path: remoteUrl.pathname,
|
|
249
|
+
...(user && key ? { user, key } : {}),
|
|
250
|
+
capabilities: finalCapabilities,
|
|
251
|
+
});
|
|
252
|
+
sessionId = client.sessionId;
|
|
253
|
+
setSession(client, client.sessionId, finalCapabilities);
|
|
254
|
+
}
|
|
255
|
+
else {
|
|
256
|
+
if (platform === 'general') {
|
|
257
|
+
throw new Error('platform="general" requires a remoteServerUrl — local drivers are not supported for general sessions.');
|
|
321
258
|
}
|
|
322
|
-
|
|
323
|
-
|
|
259
|
+
const driver = createDriverForPlatform(platform);
|
|
260
|
+
log.info(`Sending session with ${driver.constructor.name}`);
|
|
261
|
+
sessionId = await createDriverSession(driver, finalCapabilities);
|
|
262
|
+
setSession(driver, sessionId, finalCapabilities);
|
|
263
|
+
}
|
|
264
|
+
const sessionIdStr = typeof sessionId === 'string'
|
|
265
|
+
? sessionId
|
|
266
|
+
: String(sessionId || 'Unknown');
|
|
267
|
+
log.info(`${platform.toUpperCase()} session created successfully with ID: ${sessionIdStr}`);
|
|
268
|
+
const totalSessions = listSessions().length;
|
|
269
|
+
const textResponse = textResult(`${platform.toUpperCase()} session created successfully with ID: ${sessionIdStr}\nPlatform: ${finalCapabilities.platformName}\nAutomation: ${finalCapabilities['appium:automationName']}\nDevice: ${finalCapabilities['appium:deviceName']}\nActive sessions: ${totalSessions}`);
|
|
270
|
+
const uiResource = createUIResource(`ui://appium-mcp/session-dashboard/${sessionIdStr}`, createSessionDashboardUI({
|
|
271
|
+
sessionId: sessionIdStr,
|
|
272
|
+
platform: finalCapabilities.platformName,
|
|
273
|
+
automationName: finalCapabilities['appium:automationName'],
|
|
274
|
+
deviceName: finalCapabilities['appium:deviceName'],
|
|
275
|
+
platformVersion: finalCapabilities['appium:platformVersion'],
|
|
276
|
+
udid: finalCapabilities['appium:udid'],
|
|
277
|
+
}));
|
|
278
|
+
return addUIResourceToResponse(textResponse, uiResource);
|
|
279
|
+
}
|
|
280
|
+
catch (error) {
|
|
281
|
+
log.error('Error creating session:', error);
|
|
282
|
+
throw new Error(`Failed to create session: ${error.message}`);
|
|
283
|
+
}
|
|
324
284
|
}
|
|
325
285
|
//# sourceMappingURL=create-session.js.map
|