Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { validateOutputPath, validateFileExtension } from "./utils";

const ALLOWED_SCREENSHOT_EXTENSIONS = [".png", ".jpg", ".jpeg"];
const ALLOWED_RECORDING_EXTENSIONS = [".mp4"];
const ALLOWED_INSTALL_EXTENSIONS = [".apk", ".ipa", ".zip", ".app"];

interface MobilecliDevice {
id: string;
Expand Down Expand Up @@ -368,6 +369,8 @@ export const createMcpServer = (): McpServer => {
},
{ destructiveHint: true },
async ({ device, path }) => {
validateFileExtension(path, ALLOWED_INSTALL_EXTENSIONS, "mobile_install_app");
validateOutputPath(path);
const robot = getRobotFromDevice(device);
await robot.installApp(path);
return `Installed app from ${path}`;
Expand Down