appium-mcp 1.76.0 → 1.77.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 (50) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +146 -70
  3. package/dist/command.js +1 -1
  4. package/dist/command.js.map +1 -1
  5. package/dist/core.d.ts +12 -0
  6. package/dist/core.d.ts.map +1 -0
  7. package/dist/core.js +10 -0
  8. package/dist/core.js.map +1 -0
  9. package/dist/create-server.d.ts +50 -0
  10. package/dist/create-server.d.ts.map +1 -0
  11. package/dist/create-server.js +180 -0
  12. package/dist/create-server.js.map +1 -0
  13. package/dist/plugin.d.ts +176 -0
  14. package/dist/plugin.d.ts.map +1 -0
  15. package/dist/plugin.js +239 -0
  16. package/dist/plugin.js.map +1 -0
  17. package/dist/server.d.ts +1 -2
  18. package/dist/server.d.ts.map +1 -1
  19. package/dist/server.js +2 -67
  20. package/dist/server.js.map +1 -1
  21. package/dist/session-store.d.ts +8 -8
  22. package/dist/session-store.d.ts.map +1 -1
  23. package/dist/session-store.js +3 -2
  24. package/dist/session-store.js.map +1 -1
  25. package/dist/tests/__mocks__/@appium/support.d.ts +54 -61
  26. package/dist/tests/__mocks__/@appium/support.d.ts.map +1 -1
  27. package/dist/tests/__mocks__/@appium/support.js +42 -70
  28. package/dist/tests/__mocks__/@appium/support.js.map +1 -1
  29. package/dist/tests/create-server.test.d.ts +2 -0
  30. package/dist/tests/create-server.test.d.ts.map +1 -0
  31. package/dist/tests/create-server.test.js +253 -0
  32. package/dist/tests/create-server.test.js.map +1 -0
  33. package/dist/tests/plugin.test.d.ts +2 -0
  34. package/dist/tests/plugin.test.d.ts.map +1 -0
  35. package/dist/tests/plugin.test.js +337 -0
  36. package/dist/tests/plugin.test.js.map +1 -0
  37. package/dist/tests/tools/llm-wording.test.js +4 -1
  38. package/dist/tests/tools/llm-wording.test.js.map +1 -1
  39. package/dist/tests/vision-finder.test.d.ts +1 -1
  40. package/dist/tests/vision-finder.test.js +24 -6
  41. package/dist/tests/vision-finder.test.js.map +1 -1
  42. package/package.json +12 -1
  43. package/server.json +2 -2
  44. package/src/command.ts +1 -1
  45. package/src/core.ts +17 -0
  46. package/src/create-server.ts +252 -0
  47. package/src/plugin.ts +368 -0
  48. package/src/resources/submodules.zip +0 -0
  49. package/src/server.ts +2 -87
  50. package/src/session-store.ts +12 -11
package/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## [1.77.0](https://github.com/appium/appium-mcp/compare/v1.76.0...v1.77.0) (2026-05-26)
2
+
3
+ ### Features
4
+
5
+ * add initial plugin support ([#352](https://github.com/appium/appium-mcp/issues/352)) ([5551ca4](https://github.com/appium/appium-mcp/commit/5551ca46012900968a129eb44bfe92d348db60eb))
6
+
1
7
  ## [1.76.0](https://github.com/appium/appium-mcp/compare/v1.75.7...v1.76.0) (2026-05-25)
2
8
 
3
9
  ### Features
package/README.md CHANGED
@@ -11,6 +11,7 @@ MCP Appium is an intelligent MCP (Model Context Protocol) server designed to emp
11
11
  - [Installation](#️-installation)
12
12
  - [Configuration](#️-configuration)
13
13
  - [Available Tools](#-available-tools)
14
+ - [Plugin API](#-plugin-api)
14
15
  - [Client Support](#-client-support)
15
16
  - [Usage Examples](#-usage-examples)
16
17
  - [Contributing](#-contributing)
@@ -69,9 +70,7 @@ Standard config works in most of the tools::
69
70
  "timeout": 100,
70
71
  "type": "stdio",
71
72
  "command": "npx",
72
- "args": [
73
- "appium-mcp@latest"
74
- ],
73
+ "args": ["appium-mcp@latest"],
75
74
  "env": {
76
75
  "ANDROID_HOME": "/path/to/android/sdk",
77
76
  "CAPABILITIES_CONFIG": "/path/to/your/capabilities.json"
@@ -138,22 +137,23 @@ This will automatically configure the MCP server for use with Claude Code. Make
138
137
 
139
138
  > **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
139
 
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_ON_CLIENT_DISCONNECT` | Optional | Session cleanup when the MCP client disconnects: `delete_all` (default) deletes **MCP-owned** Appium sessions (`safeDeleteAllSessions`); `skip` keeps those sessions across disconnects (e.g. HTTP/stream clients that reconnect). Attached/remote sessions are not removed by this path. See [MCP disconnect behavior](#mcp-disconnect-behavior). |
147
- | `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 |
148
- | `REMOTE_SERVER_URL_ALLOW_REGEX` | Optional | Regex pattern that remote Appium server URLs must match. Defaults to `^https?://` |
149
- | `AI_VISION_ENABLED` | Optional | Set to `true` to register the `appium_ai` tool (vision-based element finding). When unset or `false`, the AI tool is **not registered** and the LLM has no way to invoke vision-based finding. Requires `AI_VISION_API_BASE_URL` and `AI_VISION_API_KEY` to also be set, otherwise the server fails to start. |
150
- | `AI_VISION_API_BASE_URL` | Required when `AI_VISION_ENABLED=true` | Base URL of the OpenAI-compatible vision model API |
151
- | `AI_VISION_API_KEY` | Required when `AI_VISION_ENABLED=true` | API key for the vision model provider |
152
- | `AI_VISION_MODEL` | Optional | Vision model name (default: `Qwen3-VL-235B-A22B-Instruct`) |
153
- | `AI_VISION_COORD_TYPE` | Optional | Coordinate type: `normalized` (default) or `absolute` |
154
- | `AI_VISION_IMAGE_MAX_WIDTH` | Optional | Max image width in pixels before compression (default: `1080`) |
155
- | `AI_VISION_IMAGE_QUALITY` | Optional | JPEG quality 1–100 for compressed screenshots sent to the vision API (default: `80`) |
156
- | `SENTENCE_TRANSFORMERS_MODEL` | Optional | Hugging Face model used for semantic search in Appium documentation queries (default: `Xenova/all-MiniLM-L6-v2`) |
140
+ | Variable | Required | Description |
141
+ | --------------------------------- | -------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
142
+ | `CAPABILITIES_CONFIG` | Optional | Absolute path to a `capabilities.json` file with per-platform capability presets |
143
+ | `SCREENSHOTS_DIR` | Optional | Directory where screenshots and screen recordings are saved. Defaults to the current working directory |
144
+ | `NO_UI` | Optional | Set to `true` or `1` to disable HTML UI components — faster responses, fewer tokens. See [NO_UI Mode](#no_ui-mode) |
145
+ | `APPIUM_MCP_ON_CLIENT_DISCONNECT` | Optional | Session cleanup when the MCP client disconnects: `delete_all` (default) deletes **MCP-owned** Appium sessions (`safeDeleteAllSessions`); `skip` keeps those sessions across disconnects (e.g. HTTP/stream clients that reconnect). Attached/remote sessions are not removed by this path. See [MCP disconnect behavior](#mcp-disconnect-behavior). |
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_ENABLED` | Optional | Set to `true` to register the `appium_ai` tool (vision-based element finding). When unset or `false`, the AI tool is **not registered** and the LLM has no way to invoke vision-based finding. Requires `AI_VISION_API_BASE_URL` and `AI_VISION_API_KEY` to also be set, otherwise the server fails to start. |
149
+ | `AI_VISION_API_BASE_URL` | Required when `AI_VISION_ENABLED=true` | Base URL of the OpenAI-compatible vision model API |
150
+ | `AI_VISION_API_KEY` | Required when `AI_VISION_ENABLED=true` | API key for the vision model provider |
151
+ | `AI_VISION_MODEL` | Optional | Vision model name (default: `Qwen3-VL-235B-A22B-Instruct`) |
152
+ | `AI_VISION_COORD_TYPE` | Optional | Coordinate type: `normalized` (default) or `absolute` |
153
+ | `AI_VISION_IMAGE_MAX_WIDTH` | Optional | Max image width in pixels before compression (default: `1080`) |
154
+ | `AI_VISION_IMAGE_QUALITY` | Optional | JPEG quality 1–100 for compressed screenshots sent to the vision API (default: `80`) |
155
+ | `SENTENCE_TRANSFORMERS_MODEL` | Optional | Hugging Face model used for semantic search in Appium documentation queries (default: `Xenova/all-MiniLM-L6-v2`) |
156
+ | `APPIUM_MCP_PERSIST_REMOTE_SESSIONS_PATH` | Optional | Absolute file path to persist attached remote session info across server restarts (JSON format) |
157
157
 
158
158
  ### Capabilities
159
159
 
@@ -311,6 +311,7 @@ Set the `NO_UI` environment variable to `true` or `1` to disable UI components a
311
311
  **Affected Tools:**
312
312
 
313
313
  The following tools return lightweight text-only responses when NO_UI is enabled:
314
+
314
315
  - `appium_screenshot` - Screenshot files are still saved to disk, but base64 data is not embedded in responses
315
316
  - `appium_get_page_source` - Returns XML as text without interactive inspector UI
316
317
  - `generate_locators` - Returns locator data as JSON without interactive UI
@@ -336,25 +337,97 @@ HTTP and streamable MCP clients may **disconnect briefly** (reconnect, reload, p
336
337
 
337
338
  **Tradeoff:** `skip` can leave **orphaned sessions** on your Appium server if nothing cleans up — use it when disconnect is not the same as “automation finished.”
338
339
 
340
+ ## 🔌 Plugin API
341
+
342
+ Use `appium-mcp/core` to compose the default Appium MCP server with custom business logic without maintaining a fork. Plugins can register MCP tools, prompts, resources, and resource templates, and can wrap tool execution with lifecycle hooks.
343
+
344
+ ```ts
345
+ import { createAppiumMcpServer } from 'appium-mcp/core';
346
+ import type {
347
+ AppiumMcpPlugin,
348
+ McpRegistry,
349
+ ToolCallContext,
350
+ } from 'appium-mcp/core';
351
+ import { z } from 'zod';
352
+
353
+ class CheckoutPlugin implements AppiumMcpPlugin {
354
+ readonly name = 'checkout-plugin';
355
+ readonly version = '1.0.0';
356
+
357
+ register(registry: McpRegistry): void {
358
+ registry.addTool(
359
+ 'assert_checkout_summary',
360
+ 'Assert that the checkout summary screen shows an expected order ID.',
361
+ z.object({ orderId: z.string() }),
362
+ async ({ orderId }) => ({
363
+ content: [{ type: 'text', text: `Assert checkout order ${orderId}` }],
364
+ })
365
+ );
366
+ }
367
+
368
+ async beforeCall(ctx: ToolCallContext): Promise<void> {
369
+ if (ctx.toolName === 'appium_gesture') {
370
+ console.error(`[checkout-plugin] about to call ${ctx.toolName}`);
371
+ }
372
+ }
373
+ }
374
+
375
+ const server = createAppiumMcpServer({
376
+ plugins: [new CheckoutPlugin()],
377
+ additionalInstructions: 'Custom checkout policies are active.',
378
+ });
379
+
380
+ await server.start({ transportType: 'stdio' });
381
+ ```
382
+
383
+ Plugin lifecycle:
384
+
385
+ - `register(registry, core)`: called during server construction. Register custom tools, prompts, resources, and resource templates here.
386
+ - `initialize(ctx)`: called lazily on the first MCP client connection. Use it for async setup such as artifact storage or internal service clients.
387
+ - `beforeCall(ctx)`: called before a registered MCP tool executes. Return a `ToolCallResult` to short-circuit the tool.
388
+ - `afterCall(ctx, result)`: called after a registered MCP tool executes. Return a modified `ToolCallResult` to decorate or replace the response.
389
+ - `destroy()`: called after the last MCP client disconnects.
390
+
391
+ ### Safe plugin surface
392
+
393
+ The supported plugin API is intentionally small:
394
+
395
+ | Surface | Safe methods |
396
+ | ------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
397
+ | `McpRegistry` | [`addTool`](https://github.com/punkpeye/fastmcp#tools), [`addTools`](https://github.com/punkpeye/fastmcp#tools), [`addPrompt`](https://github.com/punkpeye/fastmcp#prompts), [`addPrompts`](https://github.com/punkpeye/fastmcp#prompts), [`addResource`](https://github.com/punkpeye/fastmcp#resources), [`addResources`](https://github.com/punkpeye/fastmcp#resources), [`addResourceTemplate`](https://github.com/punkpeye/fastmcp#resource-templates), [`addResourceTemplates`](https://github.com/punkpeye/fastmcp#resource-templates) |
398
+ | `AppiumMcpCore` | `getSessionId()`, `getSessionInfo(sessionId?)`, `getDriver(sessionId?)`, `listSessions()` |
399
+ | `ToolCallContext.session` | `getSessionId()`, `getSessionInfo(sessionId?)`, `getDriver(sessionId?)`, `listSessions()` |
400
+ | `PluginContext` | `core`, `plugins` |
401
+
402
+ `McpRegistry` methods delegate to the matching FastMCP registration APIs, so their object shapes follow FastMCP's documented tool, prompt, resource, and resource-template definitions. Appium MCP wraps registered tools with plugin call hooks, but prompts and resources are registered directly with FastMCP.
403
+
404
+ Each plugin name should be unique within the server. If two plugins use the same `name`, Appium MCP keeps the first plugin registered for that name and skips later duplicates with a warning. Use a stable, package-style or organization-prefixed name, such as `acme-checkout-plugin`, to avoid collisions when composing plugins from multiple teams.
405
+
406
+ Each tool name should also be unique across all plugins and the core server. FastMCP registers the latest tool definition for a name, so a duplicate name can replace an earlier tool definition. Appium MCP registers plugin tools before built-in tools, which means a plugin tool that uses the same name as a built-in tool can be replaced by the built-in tool. Appium MCP tools usually have an `appium_` prefix, so plugin tool names should avoid that pattern to reduce the chance of collisions with future core tools.
407
+
408
+ Treat anything outside `appium-mcp/core` as internal. In particular, plugins should not rely on private server internals, internal session-store modules, tool implementation files, or the raw FastMCP server instance. If a plugin needs another stable primitive, open an issue so it can be added to `AppiumMcpCore` or `McpRegistry` deliberately.
409
+
410
+ See [examples/plugin-example.ts](examples/plugin-example.ts) for a fuller cookbook with tools, prompts, resources, resource templates, call hooks, and lifecycle setup.
411
+
339
412
  ## 🎯 Available Tools
340
413
 
341
414
  MCP Appium provides a comprehensive set of tools organized into the following categories:
342
415
 
343
416
  ### Platform & Device Setup
344
417
 
345
- | Tool | Description |
346
- | ----------------- | ------------------------------------------------------------------------ |
347
- | `select_device` | **REQUIRED FIRST**: Discover available devices and select one. Auto-selects if only one device found |
348
- | `prepare_ios_simulator` | Boot an iOS/tvOS simulator, download WDA (if not cached), and install/launch WDA in a single call. Each step is skipped if already satisfied (iOS/tvOS only). Set `APPIUM_MCP_WDA_APP_PATH` to skip all downloads and use a local `.app` bundle instead. |
418
+ | Tool | Description |
419
+ | -------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
420
+ | `select_device` | **REQUIRED FIRST**: Discover available devices and select one. Auto-selects if only one device found |
421
+ | `prepare_ios_simulator` | Boot an iOS/tvOS simulator, download WDA (if not cached), and install/launch WDA in a single call. Each step is skipped if already satisfied (iOS/tvOS only). Set `APPIUM_MCP_WDA_APP_PATH` to skip all downloads and use a local `.app` bundle instead. |
349
422
  | `appium_prepare_ios_real_device` | Prepare a real iOS device for Appium testing. **Two-step flow**: (1) call without `provisioningProfileUuid` to list available `.mobileprovision` profiles; (2) call again with the chosen UUID and `isFreeAccount` to download the matching WDA release, package it as an IPA, and resign with the profile. Results are cached per WDA version and profile, so repeat runs are fast. Pass the returned `capabilitiesHint` to `create_session` so Appium installs and launches WDA. macOS + Xcode 16+ required. |
350
423
 
351
424
  ### Session Management
352
425
 
353
- | Tool | Description |
354
- | ---------------- | ----------------------------------------------------------------------------------------------------------- |
355
- | `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=attach`: connect MCP Appium to an already-running remote Appium session without taking ownership. `action=detach`: forget an attached session without deleting the real remote session. `action=delete`: stop and clean up an owned session (defaults to active). `action=list`: show all active sessions, including ownership. `action=select`: switch the active session by `sessionId`. |
356
- | `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. |
357
- | `appium_driver_settings` | Read or update Appium driver session settings in one tool. `action=get` returns current settings as JSON; `action=update` merges a `settings` map (driver-specific keys; use `action=get` first to inspect). |
426
+ | Tool | Description |
427
+ | ------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
428
+ | `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=attach`: connect MCP Appium to an already-running remote Appium session without taking ownership. `action=detach`: forget an attached session without deleting the real remote session. `action=delete`: stop and clean up an owned session (defaults to active). `action=list`: show all active sessions, including ownership. `action=select`: switch the active session by `sessionId`. |
429
+ | `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. |
430
+ | `appium_driver_settings` | Read or update Appium driver session settings in one tool. `action=get` returns current settings as JSON; `action=update` merges a `settings` map (driver-specific keys; use `action=get` first to inspect). |
358
431
 
359
432
  The remote server URL in `appium_session_management` (action=create or action=attach) can be set via the `remoteServerUrl` parameter.
360
433
  If `REMOTE_SERVER_URL_ALLOW_REGEX` is set, the URL must match the provided regex pattern for security reasons.
@@ -363,61 +436,61 @@ The default regex pattern allows any URL that starts with `http://` or `https://
363
436
 
364
437
  ### Context Management
365
438
 
366
- | Tool | Description |
367
- | -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
368
- | `appium_context` | Manage contexts in one tool. `action=list` gets all available contexts including NATIVE_APP and WEBVIEW_* entries. `action=switch` switches to a target context (`context` required). |
439
+ | Tool | Description |
440
+ | ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
441
+ | `appium_context` | Manage contexts in one tool. `action=list` gets all available contexts including NATIVE*APP and WEBVIEW*\* entries. `action=switch` switches to a target context (`context` required). |
369
442
 
370
443
  ### Element Discovery & Interaction
371
444
 
372
- | Tool | Description |
373
- | --------------------- | -------------------------------------------------------------------------------------------- |
374
- | `appium_find_element` | Find a specific element using traditional locator strategies. **Strategy priority**: `accessibility id` > `id` > platform-native (`-ios predicate string` / `-ios class chain` on iOS, `-android uiautomator` on Android) > `xpath` (last resort — slow & brittle). To scroll until an element appears, use **`appium_gesture`** with **`action=scroll_to_element`** (same `strategy` / `selector` as find). |
375
- | `appium_ai` | **Opt-in (gated by `AI_VISION_ENABLED=true`).** Vision-based element finding — fallback for when traditional locators don't work. `action=find_element` takes a natural-language `instruction` (e.g., "yellow search button at bottom") and returns a coordinate UUID consumable by **`appium_gesture`** (`tap` / `double_tap` / `long_press`). See [AI Vision Element Finding](#ai-vision-element-finding) for setup. |
376
- | `appium_gesture` | Perform a touch gesture. `action` = `back`, `tap`, `double_tap`, `long_press`, `scroll`, `swipe`, `pinch_zoom`, or **`scroll_to_element`**. **`scroll_to_element`** scrolls vertically (`direction` = `up` \| `down`) until the locator matches, **page source stops changing** after a scroll (end of list), or **`maxScrollAttempts`** (default 10, max 80). Optional **`scrollDistance`** (0.05–1) or **`scrollDistancePreset`** = `small` \| `medium` \| `large`. Supports element UUIDs and raw coordinates for other actions. For swipe, use `speed` = `slow` \| `normal` \| `fast` (fast for pull-to-refresh). |
377
- | `appium_drag_and_drop` | Perform a drag and drop gesture from a source location to a target location (supports element-to-element, element-to-coordinates, coordinates-to-element, and coordinates-to-coordinates) |
378
- | `appium_perform_actions` | Execute raw W3C Actions API sequences for custom multi-touch gestures (rotate, three-finger swipe, edge swipes, precise timing). Prefer `appium_gesture` for standard gestures. |
379
- | `appium_set_value` | Enter text into an input field |
380
- | `appium_mobile_keyboard` | Hide the on-screen keyboard or query visibility. `action=hide` \| `is_shown` (`keys` optional for hide). |
381
- | `appium_get_text` | Get text content from an element |
382
- | `appium_mobile_clipboard` | Read or set device clipboard plain text. `action=get` \| `set` (`content` required for set). |
383
- | `appium_alert` | Handle alerts with `action` = `accept`, `dismiss`, or `get_text` (optional `buttonLabel`) |
445
+ | Tool | Description |
446
+ | ------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
447
+ | `appium_find_element` | Find a specific element using traditional locator strategies. **Strategy priority**: `accessibility id` > `id` > platform-native (`-ios predicate string` / `-ios class chain` on iOS, `-android uiautomator` on Android) > `xpath` (last resort — slow & brittle). To scroll until an element appears, use **`appium_gesture`** with **`action=scroll_to_element`** (same `strategy` / `selector` as find). |
448
+ | `appium_ai` | **Opt-in (gated by `AI_VISION_ENABLED=true`).** Vision-based element finding — fallback for when traditional locators don't work. `action=find_element` takes a natural-language `instruction` (e.g., "yellow search button at bottom") and returns a coordinate UUID consumable by **`appium_gesture`** (`tap` / `double_tap` / `long_press`). See [AI Vision Element Finding](#ai-vision-element-finding) for setup. |
449
+ | `appium_gesture` | Perform a touch gesture. `action` = `back`, `tap`, `double_tap`, `long_press`, `scroll`, `swipe`, `pinch_zoom`, or **`scroll_to_element`**. **`scroll_to_element`** scrolls vertically (`direction` = `up` \| `down`) until the locator matches, **page source stops changing** after a scroll (end of list), or **`maxScrollAttempts`** (default 10, max 80). Optional **`scrollDistance`** (0.05–1) or **`scrollDistancePreset`** = `small` \| `medium` \| `large`. Supports element UUIDs and raw coordinates for other actions. For swipe, use `speed` = `slow` \| `normal` \| `fast` (fast for pull-to-refresh). |
450
+ | `appium_drag_and_drop` | Perform a drag and drop gesture from a source location to a target location (supports element-to-element, element-to-coordinates, coordinates-to-element, and coordinates-to-coordinates) |
451
+ | `appium_perform_actions` | Execute raw W3C Actions API sequences for custom multi-touch gestures (rotate, three-finger swipe, edge swipes, precise timing). Prefer `appium_gesture` for standard gestures. |
452
+ | `appium_set_value` | Enter text into an input field |
453
+ | `appium_mobile_keyboard` | Hide the on-screen keyboard or query visibility. `action=hide` \| `is_shown` (`keys` optional for hide). |
454
+ | `appium_get_text` | Get text content from an element |
455
+ | `appium_mobile_clipboard` | Read or set device clipboard plain text. `action=get` \| `set` (`content` required for set). |
456
+ | `appium_alert` | Handle alerts with `action` = `accept`, `dismiss`, or `get_text` (optional `buttonLabel`) |
384
457
 
385
458
  ### Screen & Navigation
386
459
 
387
- | Tool | Description |
388
- | -------------------------- | ------------------------------------------------------- |
389
- | `appium_screenshot` | Take a screenshot and save as PNG. Optionally provide `elementUUID` to capture a specific element. |
390
- | `appium_get_window_size` | Get the width and height of the device screen in pixels |
391
- | `appium_get_page_source` | Get the page source (XML) from the current screen |
392
- | `appium_orientation` | Get or set device/screen orientation with `action` = `get` or `set` (requires `orientation` for set). |
393
- | `appium_geolocation` | Get, set, or reset the device GPS coordinates with `action` = `get`, `set`, or `reset`. For `set`, provide `latitude` and `longitude` (and optional `altitude` on Android). Not supported on Android emulators for `reset`. |
394
- | `appium_screen_recording` | Start or stop screen recording with `action` = `start` or `stop`. On stop, returns the saved MP4 path. |
460
+ | Tool | Description |
461
+ | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
462
+ | `appium_screenshot` | Take a screenshot and save as PNG. Optionally provide `elementUUID` to capture a specific element. |
463
+ | `appium_get_window_size` | Get the width and height of the device screen in pixels |
464
+ | `appium_get_page_source` | Get the page source (XML) from the current screen |
465
+ | `appium_orientation` | Get or set device/screen orientation with `action` = `get` or `set` (requires `orientation` for set). |
466
+ | `appium_geolocation` | Get, set, or reset the device GPS coordinates with `action` = `get`, `set`, or `reset`. For `set`, provide `latitude` and `longitude` (and optional `altitude` on Android). Not supported on Android emulators for `reset`. |
467
+ | `appium_screen_recording` | Start or stop screen recording with `action` = `start` or `stop`. On stop, returns the saved MP4 path. |
395
468
  | `appium_mobile_device_info` | Get device information, battery status, or current device time. Use `action` = `info` (model, OS version, locale, timezone, screen density, etc.), `battery` (level as percentage and charging state), or `time` (current device time; accepts an optional `format` moment.js string, defaults to ISO 8601). Works on both iOS and Android. |
396
469
 
397
470
  ### App Management
398
471
 
399
- | Tool | Action | Description |
400
- |---------------|------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
401
- | `appium_app_lifecycle` | `activate` | Activate (launch/bring to foreground) a specified app by bundle ID or name |
402
- | `appium_app_lifecycle` | `terminate` | Terminate (close) a specified app |
403
- | `appium_app_lifecycle` | `install` | Install an app on the device from a file path |
404
- | `appium_app_lifecycle` | `uninstall` | Uninstall an app from the device by bundle ID or name |
405
- | `appium_app_lifecycle` | `list` | List all installed apps on the device (Android and iOS) |
406
- | `appium_app_lifecycle` | `is_installed` | Check whether an app is installed. Package name for Android, bundle ID for iOS. |
407
- | `appium_app_lifecycle` | `query_state` | Query the current state of an app: 0=not installed, 1=not running, 2=background suspended, 3=background, 4=foreground |
408
- | `appium_app_lifecycle` | `background` | Background the current app for a duration (optional; defaults to 5 seconds) |
409
- | `appium_app_lifecycle` | `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. |
410
- | `appium_app_lifecycle` | `deep_link` | Open a deep link URL with the default or a specified app |
411
- | `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. |
472
+ | Tool | Action | Description |
473
+ | --------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
474
+ | `appium_app_lifecycle` | `activate` | Activate (launch/bring to foreground) a specified app by bundle ID or name |
475
+ | `appium_app_lifecycle` | `terminate` | Terminate (close) a specified app |
476
+ | `appium_app_lifecycle` | `install` | Install an app on the device from a file path |
477
+ | `appium_app_lifecycle` | `uninstall` | Uninstall an app from the device by bundle ID or name |
478
+ | `appium_app_lifecycle` | `list` | List all installed apps on the device (Android and iOS) |
479
+ | `appium_app_lifecycle` | `is_installed` | Check whether an app is installed. Package name for Android, bundle ID for iOS. |
480
+ | `appium_app_lifecycle` | `query_state` | Query the current state of an app: 0=not installed, 1=not running, 2=background suspended, 3=background, 4=foreground |
481
+ | `appium_app_lifecycle` | `background` | Background the current app for a duration (optional; defaults to 5 seconds) |
482
+ | `appium_app_lifecycle` | `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. |
483
+ | `appium_app_lifecycle` | `deep_link` | Open a deep link URL with the default or a specified app |
484
+ | `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. |
412
485
 
413
486
  ### Test Generation & Documentation
414
487
 
415
- | Tool | Description |
416
- | ---------------------------- | -------------------------------------------------------------------------------- |
417
- | `generate_locators` | Generate intelligent locators for all interactive elements on the current screen |
418
- | `appium_generate_tests` | Generate automated test code from natural language scenarios |
419
- | `appium_documentation_query` | Query Appium documentation using RAG for help and guidance |
420
- | `appium_skills` | Return ordered setup or troubleshooting skills from `appium/skills` for local Appium environments |
488
+ | Tool | Description |
489
+ | ---------------------------- | ------------------------------------------------------------------------------------------------- |
490
+ | `generate_locators` | Generate intelligent locators for all interactive elements on the current screen |
491
+ | `appium_generate_tests` | Generate automated test code from natural language scenarios |
492
+ | `appium_documentation_query` | Query Appium documentation using RAG for help and guidance |
493
+ | `appium_skills` | Return ordered setup or troubleshooting skills from `appium/skills` for local Appium environments |
421
494
 
422
495
  ## 🤖 Client Support
423
496
 
@@ -464,6 +537,7 @@ Try strategies in priority order: `accessibility id` first, then `id`, then plat
464
537
  ```
465
538
 
466
539
  **Scroll until element is on screen (`appium_gesture` / `scroll_to_element`):**
540
+
467
541
  ```json
468
542
  {
469
543
  "tool": "appium_gesture",
@@ -507,6 +581,7 @@ The returned UUID (`ai-element:x,y:bbox`) flows directly into `appium_gesture`:
507
581
  ```
508
582
 
509
583
  **More instruction examples:**
584
+
510
585
  - `"username input field at top"`
511
586
  - `"settings icon in top-right corner"`
512
587
  - `"red delete button next to the item"`
@@ -514,6 +589,7 @@ The returned UUID (`ai-element:x,y:bbox`) flows directly into `appium_gesture`:
514
589
  - `"profile picture in navigation bar"`
515
590
 
516
591
  **When to reach for `appium_ai` vs `appium_find_element`:**
592
+
517
593
  - **Prefer `appium_find_element`** whenever a stable accessibility id, resource-id, or unique text exists — faster, free, deterministic.
518
594
  - **Use `appium_ai`** only when the element has no stable identifier, the page source is unavailable, or you must locate by visual cues (color, position, icon).
519
595
  - See [AI Vision Element Finding](#ai-vision-element-finding) for setup and configuration.
package/dist/command.js CHANGED
@@ -200,7 +200,7 @@ export async function setValue(driver, elementUUID, text, w3cActions = false) {
200
200
  export async function elementClick(driver, elementUUID) {
201
201
  if (getPlatformName(driver) === PLATFORM.ios &&
202
202
  getStorecCurrentContext(driver.sessionId)?.startsWith('WEBVIEW_')) {
203
- const caps = getSessionInfo(driver.sessionId);
203
+ const caps = getSessionInfo(driver.sessionId || undefined);
204
204
  const settings = await getSessionDriverSettings(driver);
205
205
  // nativeWebTap === true means we should use the native tap (elementClick) even in webview context
206
206
  if (caps?.metadata?.capabilities?.['appium:nativeWebTap'] !== true ||
@@ -1 +1 @@
1
- {"version":3,"file":"command.js","sourceRoot":"","sources":["../src/command.ts"],"names":[],"mappings":"AACA,OAAO,EACL,eAAe,EACf,kCAAkC,EAClC,qBAAqB,EACrB,uBAAuB,EACvB,QAAQ,EACR,iBAAiB,IAAI,uBAAuB,EAC5C,cAAc,GACf,MAAM,oBAAoB,CAAC;AAQ5B,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAKvC,OAAO,GAAG,MAAM,aAAa,CAAC;AAE9B;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,OAAO,CAC3B,MAAsB,EACtB,GAAW,EACX,MAAW;IAEX,IAAI,kCAAk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AAM,OAAO,CAAC,MAAM,EAAE,sBAAsB,EAAE,EAAE,CAAC,CAAC;IACjE,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;AACjE,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,MAAsB,EACtB,OAAe;IAEf,MAAM,aAAa,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IACvE,MAAM,OAAO,CAAC,MAAM,EAAE,sBAAsB,EAAE;QAC5C,OAAO,EAAE,aAAa;QACtB,WAAW,EAAE,WAAW;KACzB,CAAC,CAAC;AACL,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,IAAI,CAAC,MAAsB;IAC/C,IAAI,kCAAkC,CAAC,MAAM,CAAC,EAAE,CAAC;QAC/C,OAAO,MAAM,MAAM,CAAC,IAAI,EAAE,CAAC;IAC7B,CAAC;SAAM,IAAI,uBAAuB,CAAC,MAAM,CAAC,EAAE,CAAC;QAC3C,OAAO,MAAM,MAAM,CAAC,IAAI,EAAE,CAAC;IAC7B,CAAC;IACD,OAAO,MAAO,MAAiB,CAAC,IAAI,EAAE,CAAC;AACzC,CAAC"}
package/dist/core.d.ts ADDED
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Public extension API for building custom Appium MCP servers.
3
+ *
4
+ * Import from `appium-mcp/core` when composing the default Appium MCP server
5
+ * with organization-specific plugins, tools, prompts, resources, and lifecycle
6
+ * hooks.
7
+ */
8
+ export { createAppiumMcpServer } from './create-server.js';
9
+ export type { CreateAppiumMcpServerOptions } from './create-server.js';
10
+ export { AppiumMcpCore, McpRegistry, PluginManager } from './plugin.js';
11
+ export type { AppiumMcpPlugin, PluginContext, PluginSessionContext, ToolCallContext, ToolCallResult, } from './plugin.js';
12
+ //# sourceMappingURL=core.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,YAAY,EAAE,4BAA4B,EAAE,MAAM,oBAAoB,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACxE,YAAY,EACV,eAAe,EACf,aAAa,EACb,oBAAoB,EACpB,eAAe,EACf,cAAc,GACf,MAAM,aAAa,CAAC"}
package/dist/core.js ADDED
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Public extension API for building custom Appium MCP servers.
3
+ *
4
+ * Import from `appium-mcp/core` when composing the default Appium MCP server
5
+ * with organization-specific plugins, tools, prompts, resources, and lifecycle
6
+ * hooks.
7
+ */
8
+ export { createAppiumMcpServer } from './create-server.js';
9
+ export { AppiumMcpCore, McpRegistry, PluginManager } from './plugin.js';
10
+ //# sourceMappingURL=core.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"core.js","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * createAppiumMcpServer — public factory for custom Appium MCP servers.
3
+ *
4
+ * Usage:
5
+ * ```ts
6
+ * import { createAppiumMcpServer } from 'appium-mcp/core';
7
+ *
8
+ * const server = createAppiumMcpServer({
9
+ * plugins: [new CheckoutPlugin(), new LoginGuardPlugin()],
10
+ * });
11
+ *
12
+ * await server.start({ transportType: 'stdio' });
13
+ * ```
14
+ */
15
+ import { FastMCP } from 'fastmcp';
16
+ import type { AppiumMcpPlugin } from './plugin.js';
17
+ export interface CreateAppiumMcpServerOptions {
18
+ /**
19
+ * List of plugins to register with the server.
20
+ * Plugin names should be unique; duplicate names are skipped with a warning.
21
+ * Plugins are initialized in registration order.
22
+ */
23
+ plugins?: AppiumMcpPlugin[];
24
+ /**
25
+ * Override the server name shown to MCP clients.
26
+ * @default 'MCP Appium'
27
+ */
28
+ serverName?: string;
29
+ /**
30
+ * Override the server version shown to MCP clients.
31
+ * @default package.json version
32
+ */
33
+ serverVersion?: `${number}.${number}.${number}`;
34
+ /**
35
+ * Additional instructions appended to the default SERVER_INSTRUCTIONS.
36
+ */
37
+ additionalInstructions?: string;
38
+ }
39
+ /**
40
+ * Factory function that creates and wires a fully-configured Appium MCP server,
41
+ * with optional plugin support.
42
+ *
43
+ * This is the main public entry point for building a custom Appium-based MCP
44
+ * server. It replicates the setup that the default `server.ts` performs, while
45
+ * also registering plugin tools and lifecycle hooks.
46
+ *
47
+ * @returns A configured `FastMCP` instance ready to be `start()`-ed.
48
+ */
49
+ export declare function createAppiumMcpServer(options?: CreateAppiumMcpServerOptions): FastMCP;
50
+ //# sourceMappingURL=create-server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-server.d.ts","sourceRoot":"","sources":["../src/create-server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAOlC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAanD,MAAM,WAAW,4BAA4B;IAC3C;;;;OAIG;IACH,OAAO,CAAC,EAAE,eAAe,EAAE,CAAC;IAE5B;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,aAAa,CAAC,EAAE,GAAG,MAAM,IAAI,MAAM,IAAI,MAAM,EAAE,CAAC;IAEhD;;OAEG;IACH,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACjC;AAQD;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,GAAE,4BAAiC,GACzC,OAAO,CA+JT"}