You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sessionId ? `Session ${sessionId} not found.` : 'No active session found.'
9
12
);
10
13
}
11
-
if(ownership==='attached'){
14
+
if(ownership==='attached'&&!force){
12
15
returnerrorResult(
13
16
sessionId
14
-
? `Session ${sessionId} is attached from a remote server. Use action=detach to remove it from MCP without deleting the remote session.`
15
-
: 'Active session is attached from a remote server. Use action=detach to remove it from MCP without deleting the remote session.'
17
+
? `Session ${sessionId} is attached from a remote server. Use action=detach to remove it from MCP without deleting the remote session, or pass force=true to delete the remote session.`
18
+
: 'Active session is attached from a remote server. Use action=detach to remove it from MCP without deleting the remote session, or pass force=true to delete the remote session.'
Copy file name to clipboardExpand all lines: src/tools/session/session.ts
+8-2Lines changed: 8 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -44,7 +44,7 @@ const schema = z.object({
44
44
`create: ${CREATE_SESSION_DESCRIPTION}`+
45
45
'attach: Attach MCP Appium to an existing remote Appium session without taking ownership of its lifecycle. Requires remoteServerUrl and sessionId. Always pass capabilities with at least platformName (e.g. \'{"platformName":"iOS"}\' or \'{"platformName":"Android"}\') so the client is configured with the correct protocol commands.'+
46
46
'detach: Remove an attached Appium session from MCP Appium without deleting the real remote session. Defaults to the active session.'+
47
-
'delete: Delete an MCP-owned mobile session and clean up resources. Does not delete attached remote sessions; use detach for those. If sessionId is omitted, deletes the active session.'+
47
+
'delete: Delete an MCP-owned mobile session and clean up resources. Attached remote sessions are rejected unless force=true; use detach to drop attached sessions from MCP without terminating the remote session. If sessionId is omitted, deletes the active session.'+
48
48
'list: List all active Appium sessions managed by this MCP server, including active flag, ownership, and current context.'+
49
49
'select: Set an existing Appium session as the active session for subsequent tool calls (requires sessionId).'
50
50
),
@@ -77,6 +77,12 @@ const schema = z.object({
77
77
.describe(
78
78
'For attach: existing session to connect to. For delete: session to remove (defaults to active). For detach: attached session to remove from MCP (defaults to active). For select: session to activate. Required for attach and select.'
79
79
),
80
+
force: z
81
+
.boolean()
82
+
.optional()
83
+
.describe(
84
+
'For delete only: when true, also terminate an attached remote Appium session. Defaults to false.'
0 commit comments