appium_session_management
Manage Appium sessions: create, attach, detach, delete, list, or select active sessions for mobile testing.
Instructions
Manage Appium sessions. Use action=create to start a session, attach to connect to an existing one, detach to forget an attached session, delete to stop one, list to see all active sessions, or select to switch the active session.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | create: Create a new Appium session. DEFAULT MODE (no remoteServerUrl): use unless the user explicitly provides a server URL. - Drivers run embedded inside this MCP server; no separate Appium process is needed. - Use select_device tool FIRST to discover devices. Ask for platform/device if unknown; do not assume a platform. - For iOS simulators, run prepare_ios_simulator before creating the session. - Call appium_session_management action=create with the selected platform and any returned capabilitiesHint serialized as capabilities. - Do NOT pass remoteServerUrl for local/embedded mode. NEVER invent a localhost URL. REMOTE SERVER MODE (only when user explicitly provides a URL): - Skip local device selection and preparation; do not call select_device. - Infer platform and device type from the request when possible; ask if unclear. - Use platform=general for non-Android/iOS drivers (Windows, macOS, custom); capabilities pass through without platform defaults. - Call appium_session_management action=create with platform, remoteServerUrl, and the requested capabilities. - Example: "create an iOS session at http://localhost:4723" means platform=ios and remoteServerUrl=http://localhost:4723; do not discover local devices. attach: connect to an existing remote Appium session without taking ownership of its lifecycle. Requires remoteServerUrl and sessionId; capabilities are fetched from the remote server. detach: remove an attached session from MCP without deleting the real remote session. Defaults to the active session. delete: delete a session and clean up resources. Defaults to the active session. list: list managed sessions with active flag, ownership, and current context. select: set sessionId as the active session for subsequent calls; requires sessionId. | |
| platform | No | Required for create. For local sessions, match the platform selected via select_device. For remote sessions, infer from the request; general supports non-Android/iOS drivers (Windows, macOS, custom) and requires remoteServerUrl. | |
| sessionId | No | Required for attach and select: the existing session to connect to or activate. For delete: session to delete. For detach: attached session to forget without stopping it. Delete/detach default to the active session when omitted. | |
| capabilities | No | Optional W3C capabilities as a JSON string, e.g. '{"appium:app":"/path/to/app","appium:platformVersion":"17.0"}'. Create: overrides defaults for ios/android; passed through as-is for general. Common keys: appium:app, appium:deviceName, appium:udid, appium:platformVersion, appium:bundleId. When using capabilitiesHint from a preparation tool, serialize the full object to JSON; preserve boolean and numeric values. Attach: optional fallback values (e.g. '{"platformName":"iOS"}'); capabilities fetched from the server take precedence. | |
| remoteServerUrl | No | Remote Appium server URL for create or attach (e.g. http://localhost:4723). Omit to use local server for create. |