android_stop_scrcpy_stream
Stop screen mirroring from Android devices to computers using scrcpy. This tool terminates active streaming sessions for device management.
Instructions
Stop scrcpy streaming
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/handlers.ts:585-600 (handler)Main handler function for the 'android_stop_scrcpy_stream' tool. It calls the ADBWrapper's stopScrcpyStream method and returns a success message or throws an error.export async function handleStopScrcpyStream(adb: ADBWrapper, args: StopScrcpyStreamArgs): Promise<{ content: Array<{ type: string; text: string }> }> { try { await adb.stopScrcpyStream(); return { content: [ { type: 'text', text: 'Scrcpy stream stopped successfully.', }, ], }; } catch (error) { throw new Error(`Failed to stop scrcpy stream: ${error instanceof Error ? error.message : String(error)}`); } }
- src/adb-wrapper.ts:923-929 (helper)Core implementation that terminates the scrcpy subprocess and cleans up the latest frame buffer and process reference.async stopScrcpyStream(): Promise<void> { if (this.scrcpyProcess) { this.scrcpyProcess.kill('SIGTERM'); this.scrcpyProcess = null; this.latestFrame = null; } }
- src/index.ts:366-372 (schema)Tool schema definition including name, description, and empty input schema in the ListTools response.name: 'android_stop_scrcpy_stream', description: 'Stop scrcpy streaming', inputSchema: { type: 'object', properties: {}, }, },
- src/index.ts:496-497 (registration)Registration in the CallToolRequestSchema switch statement that dispatches to the handler function.case 'android_stop_scrcpy_stream': return await handleStopScrcpyStream(this.adb, args as any);