@ebowwa/mcp-ios-devices 1.0.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.
@@ -0,0 +1,27 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * @ebowwa/mcp-ios-devices
4
+ * MCP server for iOS device control
5
+ *
6
+ * Provides 80+ tools for:
7
+ * - Physical device management (devicectl, libimobiledevice)
8
+ * - Simulator control (simctl)
9
+ * - App installation and management
10
+ * - Process management
11
+ * - Logging and diagnostics
12
+ * - File system access
13
+ * - Screenshots and location spoofing
14
+ * - Backup and restore
15
+ */
16
+ import './tools/device.js';
17
+ import './tools/process.js';
18
+ import './tools/app.js';
19
+ import './tools/log.js';
20
+ import './tools/file.js';
21
+ import './tools/simulator.js';
22
+ import './tools/backup.js';
23
+ import './tools/location.js';
24
+ import './tools/screenshot.js';
25
+ import './tools/diagnostics.js';
26
+ import './tools/profile.js';
27
+ //# sourceMappingURL=index.d.ts.map
package/dist/index.js ADDED
@@ -0,0 +1,153 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * @ebowwa/mcp-ios-devices
4
+ * MCP server for iOS device control
5
+ *
6
+ * Provides 80+ tools for:
7
+ * - Physical device management (devicectl, libimobiledevice)
8
+ * - Simulator control (simctl)
9
+ * - App installation and management
10
+ * - Process management
11
+ * - Logging and diagnostics
12
+ * - File system access
13
+ * - Screenshots and location spoofing
14
+ * - Backup and restore
15
+ */
16
+ import { Server } from '@modelcontextprotocol/sdk/server/index.js';
17
+ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
18
+ import { CallToolRequestSchema, ListToolsRequestSchema, ErrorCode, McpError, } from '@modelcontextprotocol/sdk/types.js';
19
+ import { z } from 'zod';
20
+ // Import registry
21
+ import { tools } from './registry.js';
22
+ // Import all tool modules (side effects - they register themselves)
23
+ import './tools/device.js';
24
+ import './tools/process.js';
25
+ import './tools/app.js';
26
+ import './tools/log.js';
27
+ import './tools/file.js';
28
+ import './tools/simulator.js';
29
+ import './tools/backup.js';
30
+ import './tools/location.js';
31
+ import './tools/screenshot.js';
32
+ import './tools/diagnostics.js';
33
+ import './tools/profile.js';
34
+ // Create MCP server
35
+ const server = new Server({
36
+ name: '@ebowwa/mcp-ios-devices',
37
+ version: '1.0.0',
38
+ }, {
39
+ capabilities: {
40
+ tools: {},
41
+ },
42
+ });
43
+ // Handle list tools request
44
+ server.setRequestHandler(ListToolsRequestSchema, async () => {
45
+ return {
46
+ tools: tools.map((tool) => ({
47
+ name: tool.name,
48
+ description: tool.description,
49
+ inputSchema: tool.inputSchema
50
+ ? zodToJsonSchema(tool.inputSchema)
51
+ : { type: 'object', properties: {} },
52
+ })),
53
+ };
54
+ });
55
+ // Handle tool execution
56
+ server.setRequestHandler(CallToolRequestSchema, async (request) => {
57
+ const { name, arguments: args } = request.params;
58
+ const tool = tools.find((t) => t.name === name);
59
+ if (!tool) {
60
+ throw new McpError(ErrorCode.MethodNotFound, `Unknown tool: ${name}`);
61
+ }
62
+ try {
63
+ // Validate input
64
+ const validatedArgs = tool.inputSchema?.parse(args) ?? args;
65
+ // Execute tool
66
+ const result = await tool.handler(validatedArgs);
67
+ return {
68
+ content: [
69
+ {
70
+ type: 'text',
71
+ text: typeof result === 'string' ? result : JSON.stringify(result, null, 2),
72
+ },
73
+ ],
74
+ };
75
+ }
76
+ catch (error) {
77
+ if (error instanceof z.ZodError) {
78
+ const messages = error.errors.map((e) => e.message).join(', ');
79
+ throw new McpError(ErrorCode.InvalidParams, `Invalid parameters: ${messages}`);
80
+ }
81
+ const errorMessage = error instanceof Error ? error.message : String(error);
82
+ throw new McpError(ErrorCode.InternalError, `Tool execution failed: ${errorMessage}`);
83
+ }
84
+ });
85
+ /**
86
+ * Convert Zod schema to JSON Schema for MCP
87
+ */
88
+ function zodToJsonSchema(schema) {
89
+ if (schema instanceof z.ZodObject) {
90
+ const properties = {};
91
+ const required = [];
92
+ for (const [key, value] of Object.entries(schema.shape)) {
93
+ properties[key] = zodToJsonSchema(value);
94
+ if (!(value instanceof z.ZodOptional)) {
95
+ required.push(key);
96
+ }
97
+ }
98
+ return {
99
+ type: 'object',
100
+ properties,
101
+ required: required.length > 0 ? required : undefined,
102
+ };
103
+ }
104
+ if (schema instanceof z.ZodString) {
105
+ return { type: 'string', description: schema.description };
106
+ }
107
+ if (schema instanceof z.ZodNumber) {
108
+ return { type: 'number', description: schema.description };
109
+ }
110
+ if (schema instanceof z.ZodBoolean) {
111
+ return { type: 'boolean', description: schema.description };
112
+ }
113
+ if (schema instanceof z.ZodArray) {
114
+ return {
115
+ type: 'array',
116
+ items: zodToJsonSchema(schema.element),
117
+ description: schema.description,
118
+ };
119
+ }
120
+ if (schema instanceof z.ZodEnum) {
121
+ return {
122
+ type: 'string',
123
+ enum: schema.options,
124
+ description: schema.description,
125
+ };
126
+ }
127
+ if (schema instanceof z.ZodOptional) {
128
+ return zodToJsonSchema(schema.unwrap());
129
+ }
130
+ if (schema instanceof z.ZodDefault) {
131
+ return zodToJsonSchema(schema._def.innerType);
132
+ }
133
+ if (schema instanceof z.ZodLiteral) {
134
+ return { type: 'string', enum: [schema.value] };
135
+ }
136
+ if (schema instanceof z.ZodUnion) {
137
+ return {
138
+ oneOf: schema.options.map(zodToJsonSchema),
139
+ };
140
+ }
141
+ return { type: 'object' };
142
+ }
143
+ // Start server
144
+ async function main() {
145
+ const transport = new StdioServerTransport();
146
+ await server.connect(transport);
147
+ console.error('iOS Devices MCP server running');
148
+ }
149
+ main().catch((error) => {
150
+ console.error('Server error:', error);
151
+ process.exit(1);
152
+ });
153
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Tool registry for MCP server
3
+ * Separated to avoid circular dependencies
4
+ */
5
+ import { z } from 'zod';
6
+ export interface ToolDefinition {
7
+ name: string;
8
+ description: string;
9
+ inputSchema: z.ZodType<any>;
10
+ handler: (params: any) => Promise<any>;
11
+ }
12
+ export declare const tools: ToolDefinition[];
13
+ /**
14
+ * Register a tool
15
+ */
16
+ export declare function registerTool(options: ToolDefinition): void;
17
+ //# sourceMappingURL=registry.d.ts.map
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Tool registry for MCP server
3
+ * Separated to avoid circular dependencies
4
+ */
5
+ // Tool registry
6
+ export const tools = [];
7
+ /**
8
+ * Register a tool
9
+ */
10
+ export function registerTool(options) {
11
+ tools.push(options);
12
+ }
13
+ //# sourceMappingURL=registry.js.map
@@ -0,0 +1,6 @@
1
+ /**
2
+ * App Management Tools
3
+ * Install, uninstall, and manage apps on iOS devices
4
+ */
5
+ export {};
6
+ //# sourceMappingURL=app.d.ts.map
@@ -0,0 +1,53 @@
1
+ /**
2
+ * App Management Tools
3
+ * Install, uninstall, and manage apps on iOS devices
4
+ */
5
+ import { z } from 'zod';
6
+ import { registerTool } from '../registry.js';
7
+ import { DeviceCtl } from '@ebowwa/ios-devices';
8
+ const deviceCtl = new DeviceCtl();
9
+ registerTool({
10
+ name: 'ios_list_apps',
11
+ description: 'List all installed apps on a device',
12
+ inputSchema: z.object({
13
+ deviceId: z.string().describe('Device UDID'),
14
+ }),
15
+ handler: async ({ deviceId }) => {
16
+ return deviceCtl.listApps(deviceId);
17
+ },
18
+ });
19
+ registerTool({
20
+ name: 'ios_install_app',
21
+ description: 'Install an app (.app or .ipa) on the device',
22
+ inputSchema: z.object({
23
+ deviceId: z.string().describe('Device UDID'),
24
+ appPath: z.string().describe('Path to .app or .ipa file'),
25
+ }),
26
+ handler: async ({ deviceId, appPath }) => {
27
+ return deviceCtl.installApp(deviceId, appPath);
28
+ },
29
+ });
30
+ registerTool({
31
+ name: 'ios_uninstall_app',
32
+ description: 'Uninstall an app from the device',
33
+ inputSchema: z.object({
34
+ deviceId: z.string().describe('Device UDID'),
35
+ bundleId: z.string().describe('App bundle identifier'),
36
+ }),
37
+ handler: async ({ deviceId, bundleId }) => {
38
+ return deviceCtl.uninstallApp(deviceId, bundleId);
39
+ },
40
+ });
41
+ registerTool({
42
+ name: 'ios_get_app_icon',
43
+ description: 'Get the icon for an app',
44
+ inputSchema: z.object({
45
+ deviceId: z.string().describe('Device UDID'),
46
+ bundleId: z.string().describe('App bundle identifier'),
47
+ outputPath: z.string().optional().describe('Path to save icon'),
48
+ }),
49
+ handler: async ({ deviceId, bundleId, outputPath }) => {
50
+ return deviceCtl.getAppIcon(deviceId, bundleId, outputPath);
51
+ },
52
+ });
53
+ //# sourceMappingURL=app.js.map
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Backup & Restore Tools
3
+ * Create and restore device backups
4
+ */
5
+ export {};
6
+ //# sourceMappingURL=backup.d.ts.map
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Backup & Restore Tools
3
+ * Create and restore device backups
4
+ */
5
+ import { z } from 'zod';
6
+ import { registerTool } from '../registry.js';
7
+ import { LibIMobileDevice } from '@ebowwa/ios-devices';
8
+ registerTool({
9
+ name: 'ios_create_backup',
10
+ description: 'Create a backup of the device',
11
+ inputSchema: z.object({
12
+ deviceId: z.string().describe('Device UDID'),
13
+ directory: z.string().describe('Directory for backup'),
14
+ encrypt: z.boolean().optional().describe('Encrypt backup'),
15
+ password: z.string().optional().describe('Password for encrypted backup'),
16
+ }),
17
+ handler: async ({ deviceId, directory, encrypt, password }) => {
18
+ const lib = new LibIMobileDevice({ udid: deviceId });
19
+ return lib.createBackup(directory, encrypt, password);
20
+ },
21
+ });
22
+ registerTool({
23
+ name: 'ios_restore_backup',
24
+ description: 'Restore a backup to the device',
25
+ inputSchema: z.object({
26
+ deviceId: z.string().describe('Device UDID'),
27
+ directory: z.string().describe('Backup directory'),
28
+ password: z.string().optional().describe('Password for encrypted backup'),
29
+ }),
30
+ handler: async ({ deviceId, directory, password }) => {
31
+ const lib = new LibIMobileDevice({ udid: deviceId });
32
+ return lib.restoreBackup(directory, password);
33
+ },
34
+ });
35
+ registerTool({
36
+ name: 'ios_list_backups',
37
+ description: 'List available backups',
38
+ inputSchema: z.object({}),
39
+ handler: async () => {
40
+ const lib = new LibIMobileDevice();
41
+ return lib.listBackups();
42
+ },
43
+ });
44
+ registerTool({
45
+ name: 'ios_get_backup_info',
46
+ description: 'Get information about a backup',
47
+ inputSchema: z.object({
48
+ directory: z.string().describe('Backup directory'),
49
+ }),
50
+ handler: async ({ directory }) => {
51
+ const lib = new LibIMobileDevice();
52
+ return lib.getBackupInfo(directory);
53
+ },
54
+ });
55
+ registerTool({
56
+ name: 'ios_unpack_backup',
57
+ description: 'Unpack a backup to a directory',
58
+ inputSchema: z.object({
59
+ directory: z.string().describe('Backup directory'),
60
+ }),
61
+ handler: async ({ directory }) => {
62
+ const lib = new LibIMobileDevice();
63
+ return lib.unpackBackup(directory);
64
+ },
65
+ });
66
+ //# sourceMappingURL=backup.js.map
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Device Management Tools
3
+ * Physical iOS device control via devicectl and libimobiledevice
4
+ */
5
+ export {};
6
+ //# sourceMappingURL=device.d.ts.map
@@ -0,0 +1,180 @@
1
+ /**
2
+ * Device Management Tools
3
+ * Physical iOS device control via devicectl and libimobiledevice
4
+ */
5
+ import { z } from 'zod';
6
+ import { registerTool } from '../registry.js';
7
+ import { DeviceCtl, LibIMobileDevice } from '@ebowwa/ios-devices';
8
+ const deviceCtl = new DeviceCtl();
9
+ // ============================================================================
10
+ // Device Listing & Info
11
+ // ============================================================================
12
+ registerTool({
13
+ name: 'ios_list_devices',
14
+ description: 'List all connected iOS devices',
15
+ inputSchema: z.object({}),
16
+ handler: async () => {
17
+ return deviceCtl.listDevices();
18
+ },
19
+ });
20
+ registerTool({
21
+ name: 'ios_device_info',
22
+ description: 'Get detailed information about a specific device',
23
+ inputSchema: z.object({
24
+ deviceId: z.string().describe('Device UDID, name, or ECID'),
25
+ }),
26
+ handler: async ({ deviceId }) => {
27
+ return deviceCtl.getDeviceInfo(deviceId);
28
+ },
29
+ });
30
+ registerTool({
31
+ name: 'ios_device_lock_state',
32
+ description: 'Get the lock state of a device (locked/unlocked)',
33
+ inputSchema: z.object({
34
+ deviceId: z.string().describe('Device UDID'),
35
+ }),
36
+ handler: async ({ deviceId }) => {
37
+ return deviceCtl.getLockState(deviceId);
38
+ },
39
+ });
40
+ registerTool({
41
+ name: 'ios_device_displays',
42
+ description: 'Get display information for a device',
43
+ inputSchema: z.object({
44
+ deviceId: z.string().describe('Device UDID'),
45
+ }),
46
+ handler: async ({ deviceId }) => {
47
+ return deviceCtl.getDisplays(deviceId);
48
+ },
49
+ });
50
+ // ============================================================================
51
+ // Pairing
52
+ // ============================================================================
53
+ registerTool({
54
+ name: 'ios_pair_device',
55
+ description: 'Pair with an iOS device',
56
+ inputSchema: z.object({
57
+ deviceId: z.string().describe('Device UDID'),
58
+ }),
59
+ handler: async ({ deviceId }) => {
60
+ return deviceCtl.pair(deviceId);
61
+ },
62
+ });
63
+ registerTool({
64
+ name: 'ios_unpair_device',
65
+ description: 'Unpair from an iOS device',
66
+ inputSchema: z.object({
67
+ deviceId: z.string().describe('Device UDID'),
68
+ }),
69
+ handler: async ({ deviceId }) => {
70
+ return deviceCtl.unpair(deviceId);
71
+ },
72
+ });
73
+ // ============================================================================
74
+ // Device Control
75
+ // ============================================================================
76
+ registerTool({
77
+ name: 'ios_reboot_device',
78
+ description: 'Reboot an iOS device',
79
+ inputSchema: z.object({
80
+ deviceId: z.string().describe('Device UDID'),
81
+ }),
82
+ handler: async ({ deviceId }) => {
83
+ return deviceCtl.reboot(deviceId);
84
+ },
85
+ });
86
+ registerTool({
87
+ name: 'ios_set_orientation',
88
+ description: 'Set device orientation',
89
+ inputSchema: z.object({
90
+ deviceId: z.string().describe('Device UDID'),
91
+ orientation: z.enum(['portrait', 'landscape', 'portrait-upside-down', 'landscape-left', 'landscape-right']),
92
+ }),
93
+ handler: async ({ deviceId, orientation }) => {
94
+ return deviceCtl.setOrientation(deviceId, orientation);
95
+ },
96
+ });
97
+ registerTool({
98
+ name: 'ios_respring',
99
+ description: 'Respring the device (restart SpringBoard UI)',
100
+ inputSchema: z.object({
101
+ deviceId: z.string().describe('Device UDID'),
102
+ }),
103
+ handler: async ({ deviceId }) => {
104
+ return deviceCtl.respring(deviceId);
105
+ },
106
+ });
107
+ // ============================================================================
108
+ // LibIMobileDevice Tools (Additional)
109
+ // ============================================================================
110
+ registerTool({
111
+ name: 'ios_get_device_name',
112
+ description: 'Get or set the device name',
113
+ inputSchema: z.object({
114
+ deviceId: z.string().describe('Device UDID'),
115
+ newName: z.string().optional().describe('New name (omit to get current name)'),
116
+ }),
117
+ handler: async ({ deviceId, newName }) => {
118
+ const lib = new LibIMobileDevice({ udid: deviceId });
119
+ if (newName) {
120
+ return lib.setDeviceName(newName);
121
+ }
122
+ return lib.getDeviceName();
123
+ },
124
+ });
125
+ registerTool({
126
+ name: 'ios_get_device_date',
127
+ description: 'Get the current date/time from the device',
128
+ inputSchema: z.object({
129
+ deviceId: z.string().describe('Device UDID'),
130
+ }),
131
+ handler: async ({ deviceId }) => {
132
+ const lib = new LibIMobileDevice({ udid: deviceId });
133
+ return lib.getDeviceDate();
134
+ },
135
+ });
136
+ registerTool({
137
+ name: 'ios_shutdown_device',
138
+ description: 'Shutdown the device',
139
+ inputSchema: z.object({
140
+ deviceId: z.string().describe('Device UDID'),
141
+ }),
142
+ handler: async ({ deviceId }) => {
143
+ const lib = new LibIMobileDevice({ udid: deviceId });
144
+ return lib.shutdown();
145
+ },
146
+ });
147
+ registerTool({
148
+ name: 'ios_restart_device',
149
+ description: 'Restart the device',
150
+ inputSchema: z.object({
151
+ deviceId: z.string().describe('Device UDID'),
152
+ }),
153
+ handler: async ({ deviceId }) => {
154
+ const lib = new LibIMobileDevice({ udid: deviceId });
155
+ return lib.restart();
156
+ },
157
+ });
158
+ registerTool({
159
+ name: 'ios_sleep_device',
160
+ description: 'Put the device to sleep',
161
+ inputSchema: z.object({
162
+ deviceId: z.string().describe('Device UDID'),
163
+ }),
164
+ handler: async ({ deviceId }) => {
165
+ const lib = new LibIMobileDevice({ udid: deviceId });
166
+ return lib.sleep();
167
+ },
168
+ });
169
+ registerTool({
170
+ name: 'ios_enter_recovery',
171
+ description: 'Put device into recovery mode',
172
+ inputSchema: z.object({
173
+ deviceId: z.string().describe('Device UDID'),
174
+ }),
175
+ handler: async ({ deviceId }) => {
176
+ const lib = new LibIMobileDevice({ udid: deviceId });
177
+ return lib.enterRecovery();
178
+ },
179
+ });
180
+ //# sourceMappingURL=device.js.map
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Diagnostics Tools
3
+ * Device diagnostics and information
4
+ */
5
+ export {};
6
+ //# sourceMappingURL=diagnostics.d.ts.map
@@ -0,0 +1,81 @@
1
+ /**
2
+ * Diagnostics Tools
3
+ * Device diagnostics and information
4
+ */
5
+ import { z } from 'zod';
6
+ import { registerTool } from '../registry.js';
7
+ import { LibIMobileDevice } from '@ebowwa/ios-devices';
8
+ registerTool({
9
+ name: 'ios_get_diagnostics',
10
+ description: 'Get device diagnostics (WiFi, Battery, NAND, etc.)',
11
+ inputSchema: z.object({
12
+ deviceId: z.string().describe('Device UDID'),
13
+ type: z.enum(['All', 'WiFi', 'GasGauge', 'NAND', 'Battery', 'HDMI']).default('All'),
14
+ }),
15
+ handler: async ({ deviceId, type }) => {
16
+ const lib = new LibIMobileDevice({ udid: deviceId });
17
+ return lib.getDiagnostics(type);
18
+ },
19
+ });
20
+ registerTool({
21
+ name: 'ios_get_ioreg',
22
+ description: 'Get IO Registry information',
23
+ inputSchema: z.object({
24
+ deviceId: z.string().describe('Device UDID'),
25
+ plane: z.enum(['IODeviceTree', 'IOPower', 'IOService']).optional(),
26
+ }),
27
+ handler: async ({ deviceId, plane }) => {
28
+ const lib = new LibIMobileDevice({ udid: deviceId });
29
+ return lib.getIORegistry(plane);
30
+ },
31
+ });
32
+ registerTool({
33
+ name: 'ios_get_mobilegestalt',
34
+ description: 'Get MobileGestalt values from device',
35
+ inputSchema: z.object({
36
+ deviceId: z.string().describe('Device UDID'),
37
+ keys: z.array(z.string()).describe('Keys to query'),
38
+ }),
39
+ handler: async ({ deviceId, keys }) => {
40
+ const lib = new LibIMobileDevice({ udid: deviceId });
41
+ return lib.getMobileGestalt(...keys);
42
+ },
43
+ });
44
+ registerTool({
45
+ name: 'ios_mount_image',
46
+ description: 'Mount developer disk image on device',
47
+ inputSchema: z.object({
48
+ deviceId: z.string().describe('Device UDID'),
49
+ imagePath: z.string().describe('Path to developer disk image'),
50
+ signaturePath: z.string().optional().describe('Path to signature file'),
51
+ }),
52
+ handler: async ({ deviceId, imagePath, signaturePath }) => {
53
+ const lib = new LibIMobileDevice({ udid: deviceId });
54
+ return lib.mountImage(imagePath, signaturePath);
55
+ },
56
+ });
57
+ registerTool({
58
+ name: 'ios_start_debug_server',
59
+ description: 'Start debug server proxy for remote debugging',
60
+ inputSchema: z.object({
61
+ deviceId: z.string().describe('Device UDID'),
62
+ port: z.number().default(6666).describe('Port for debug server'),
63
+ }),
64
+ handler: async ({ deviceId, port }) => {
65
+ const lib = new LibIMobileDevice({ udid: deviceId });
66
+ return lib.startDebugServerProxy(port);
67
+ },
68
+ });
69
+ registerTool({
70
+ name: 'ios_start_bluetooth_logger',
71
+ description: 'Start Bluetooth packet logging',
72
+ inputSchema: z.object({
73
+ deviceId: z.string().describe('Device UDID'),
74
+ outputPath: z.string().optional().describe('Output file path'),
75
+ }),
76
+ handler: async ({ deviceId, outputPath }) => {
77
+ const lib = new LibIMobileDevice({ udid: deviceId });
78
+ return lib.startBluetoothLogging(outputPath);
79
+ },
80
+ });
81
+ //# sourceMappingURL=diagnostics.js.map
@@ -0,0 +1,6 @@
1
+ /**
2
+ * File System Tools
3
+ * Access files on iOS devices via AFC
4
+ */
5
+ export {};
6
+ //# sourceMappingURL=file.d.ts.map
@@ -0,0 +1,55 @@
1
+ /**
2
+ * File System Tools
3
+ * Access files on iOS devices via AFC
4
+ */
5
+ import { z } from 'zod';
6
+ import { registerTool } from '../registry.js';
7
+ import { DeviceCtl, LibIMobileDevice } from '@ebowwa/ios-devices';
8
+ const deviceCtl = new DeviceCtl();
9
+ registerTool({
10
+ name: 'ios_list_files',
11
+ description: 'List files in a directory on the device',
12
+ inputSchema: z.object({
13
+ deviceId: z.string().describe('Device UDID'),
14
+ path: z.string().describe('Directory path to list'),
15
+ }),
16
+ handler: async ({ deviceId, path }) => {
17
+ return deviceCtl.listFiles(deviceId, path);
18
+ },
19
+ });
20
+ registerTool({
21
+ name: 'ios_copy_to_device',
22
+ description: 'Copy a file to the device',
23
+ inputSchema: z.object({
24
+ deviceId: z.string().describe('Device UDID'),
25
+ source: z.string().describe('Local source path'),
26
+ destination: z.string().describe('Device destination path'),
27
+ }),
28
+ handler: async ({ deviceId, source, destination }) => {
29
+ return deviceCtl.copyToDevice(deviceId, source, destination);
30
+ },
31
+ });
32
+ registerTool({
33
+ name: 'ios_copy_from_device',
34
+ description: 'Copy a file from the device',
35
+ inputSchema: z.object({
36
+ deviceId: z.string().describe('Device UDID'),
37
+ source: z.string().describe('Device source path'),
38
+ destination: z.string().describe('Local destination path'),
39
+ }),
40
+ handler: async ({ deviceId, source, destination }) => {
41
+ return deviceCtl.copyFromDevice(deviceId, source, destination);
42
+ },
43
+ });
44
+ registerTool({
45
+ name: 'ios_start_afc_shell',
46
+ description: 'Start an AFC shell for file system access',
47
+ inputSchema: z.object({
48
+ deviceId: z.string().describe('Device UDID'),
49
+ }),
50
+ handler: async ({ deviceId }) => {
51
+ const lib = new LibIMobileDevice({ udid: deviceId });
52
+ return lib.startAFCShell();
53
+ },
54
+ });
55
+ //# sourceMappingURL=file.js.map