minitap-mcp 0.9.0__py3-none-any.whl

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.
Files changed (35) hide show
  1. minitap/mcp/__init__.py +0 -0
  2. minitap/mcp/core/agents/compare_screenshots/agent.py +75 -0
  3. minitap/mcp/core/agents/compare_screenshots/eval/prompts/prompt_1.md +62 -0
  4. minitap/mcp/core/agents/compare_screenshots/eval/scenario_1_add_cartoon_img_and_move_button/actual.png +0 -0
  5. minitap/mcp/core/agents/compare_screenshots/eval/scenario_1_add_cartoon_img_and_move_button/figma.png +0 -0
  6. minitap/mcp/core/agents/compare_screenshots/eval/scenario_1_add_cartoon_img_and_move_button/human_feedback.txt +18 -0
  7. minitap/mcp/core/agents/compare_screenshots/eval/scenario_1_add_cartoon_img_and_move_button/prompt_1/model_params.json +3 -0
  8. minitap/mcp/core/agents/compare_screenshots/eval/scenario_1_add_cartoon_img_and_move_button/prompt_1/output.md +46 -0
  9. minitap/mcp/core/agents/compare_screenshots/prompt.md +62 -0
  10. minitap/mcp/core/cloud_apk.py +117 -0
  11. minitap/mcp/core/config.py +111 -0
  12. minitap/mcp/core/decorators.py +107 -0
  13. minitap/mcp/core/device.py +249 -0
  14. minitap/mcp/core/llm.py +39 -0
  15. minitap/mcp/core/logging_config.py +59 -0
  16. minitap/mcp/core/models.py +59 -0
  17. minitap/mcp/core/sdk_agent.py +35 -0
  18. minitap/mcp/core/storage.py +407 -0
  19. minitap/mcp/core/task_runs.py +100 -0
  20. minitap/mcp/core/utils/figma.py +69 -0
  21. minitap/mcp/core/utils/images.py +55 -0
  22. minitap/mcp/main.py +328 -0
  23. minitap/mcp/server/cloud_mobile.py +492 -0
  24. minitap/mcp/server/middleware.py +21 -0
  25. minitap/mcp/server/poller.py +78 -0
  26. minitap/mcp/server/remote_proxy.py +96 -0
  27. minitap/mcp/tools/execute_mobile_command.py +182 -0
  28. minitap/mcp/tools/read_swift_logs.py +297 -0
  29. minitap/mcp/tools/screen_analyzer.md +17 -0
  30. minitap/mcp/tools/take_screenshot.py +53 -0
  31. minitap/mcp/tools/upload_screenshot.py +80 -0
  32. minitap_mcp-0.9.0.dist-info/METADATA +352 -0
  33. minitap_mcp-0.9.0.dist-info/RECORD +35 -0
  34. minitap_mcp-0.9.0.dist-info/WHEEL +4 -0
  35. minitap_mcp-0.9.0.dist-info/entry_points.txt +3 -0
@@ -0,0 +1,352 @@
1
+ Metadata-Version: 2.3
2
+ Name: minitap-mcp
3
+ Version: 0.9.0
4
+ Summary: Model Context Protocol server for controlling Android & iOS devices with natural language
5
+ Author: Pierre-Louis Favreau, Jean-Pierre Lo, Clément Guiguet
6
+ Requires-Dist: fastmcp>=2.12.4
7
+ Requires-Dist: python-dotenv>=1.1.1
8
+ Requires-Dist: pydantic>=2.12.0
9
+ Requires-Dist: pydantic-settings>=2.10.1
10
+ Requires-Dist: minitap-mobile-use>=3.4.0
11
+ Requires-Dist: jinja2>=3.1.6
12
+ Requires-Dist: langchain-core>=0.3.75
13
+ Requires-Dist: pillow>=11.1.0
14
+ Requires-Dist: structlog>=24.4.0
15
+ Requires-Dist: aiohttp>=3.9.0
16
+ Requires-Dist: httpx>=0.28.1
17
+ Requires-Dist: ruff==0.5.3 ; extra == 'dev'
18
+ Requires-Dist: pytest==8.4.1 ; extra == 'dev'
19
+ Requires-Dist: pytest-cov==5.0.0 ; extra == 'dev'
20
+ Requires-Python: >=3.12
21
+ Project-URL: Homepage, https://minitap.ai/
22
+ Project-URL: Source, https://github.com/minitap-ai/mobile-use
23
+ Provides-Extra: dev
24
+ Description-Content-Type: text/markdown
25
+
26
+ # Minitap MCP Server
27
+
28
+ A Model Context Protocol (MCP) server that enables AI assistants to control and interact with real mobile devices (Android & iOS) through natural language commands.
29
+
30
+ ## Quick Start
31
+
32
+ ### Installation
33
+
34
+ ```bash
35
+ pip install minitap-mcp
36
+ ```
37
+
38
+ ### Prerequisites
39
+
40
+ Before running the MCP server, ensure you have the required mobile automation tools installed:
41
+
42
+ - **For Android devices:**
43
+
44
+ - [ADB (Android Debug Bridge)](https://developer.android.com/tools/adb) - For device communication
45
+
46
+ - **For iOS devices (macOS only):**
47
+ - Xcode Command Line Tools with `xcrun`
48
+ - **[fb-idb](https://fbidb.io/docs/installation/)**: Facebook's iOS Development Bridge for device automation.
49
+
50
+ ```bash
51
+ # Install via Homebrew (macOS)
52
+ brew tap facebook/fb
53
+ brew install idb-companion
54
+ ```
55
+
56
+ > [!NOTE]
57
+ > `idb_companion` is required to communicate with iOS simulators. Make sure it's in your PATH after installation.
58
+
59
+ For detailed setup instructions, see the [mobile-use repository](https://github.com/minitap-ai/mobile-use).
60
+
61
+ ### Running the Server
62
+
63
+ The simplest way to start:
64
+
65
+ ```bash
66
+ minitap-mcp --server --api-key your_minitap_api_key
67
+ ```
68
+
69
+ This starts the server on `localhost:8000` with your API key. Get your free API key at [platform.minitap.ai/api-keys](https://platform.minitap.ai/api-keys).
70
+
71
+ **Available CLI options:**
72
+
73
+ ```bash
74
+ minitap-mcp --server --api-key YOUR_KEY --llm-profile PROFILE_NAME
75
+ ```
76
+
77
+ - `--api-key`: Your Minitap API key (overrides `MINITAP_API_KEY` env var). Get yours at [platform.minitap.ai/api-keys](https://platform.minitap.ai/api-keys).
78
+ - `--llm-profile`: LLM profile name to use (overrides `MINITAP_LLM_PROFILE_NAME` env var). If unset, uses the default profile. Configure profiles at [platform.minitap.ai/llm-profiles](https://platform.minitap.ai/llm-profiles).
79
+
80
+ ### Configuration (Optional)
81
+
82
+ Alternatively, you can set environment variables instead of using CLI flags:
83
+
84
+ ```bash
85
+ export MINITAP_API_KEY="your_minitap_api_key"
86
+ export MINITAP_API_BASE_URL="https://platform.minitap.ai/api/v1"
87
+ export MINITAP_LLM_PROFILE_NAME="default"
88
+ ```
89
+
90
+ You can set these in your `.bashrc` or equivalent, then simply run:
91
+
92
+ ```bash
93
+ minitap-mcp --server
94
+ ```
95
+
96
+ CLI flags always override environment variables when both are present.
97
+
98
+ By default, the server will bind to `0.0.0.0:8000`. You can customize the port:
99
+
100
+ ```bash
101
+ # Using CLI argument
102
+ minitap-mcp --server --port 9000
103
+
104
+ # Or using environment variable
105
+ export MCP_SERVER_PORT="9000"
106
+ minitap-mcp --server
107
+
108
+ # You can also customize the host
109
+ export MCP_SERVER_HOST="0.0.0.0"
110
+ ```
111
+
112
+ ## IDE Integration
113
+
114
+ 1. Start the server: `minitap-mcp --server --api-key your_minitap_api_key`
115
+ 2. Add to your IDE MCP settings file:
116
+
117
+ ```jsonc
118
+ # For Windsurf
119
+ {
120
+ "mcpServers": {
121
+ "minitap-mcp": {
122
+ "serverUrl": "http://localhost:8000/mcp"
123
+ }
124
+ }
125
+ }
126
+ ```
127
+
128
+ ```jsonc
129
+ # For Cursor
130
+ {
131
+ "mcpServers": {
132
+ "minitap-mcp": {
133
+ "transport": "http",
134
+ "url": "http://localhost:8000/mcp"
135
+ }
136
+ }
137
+ }
138
+ ```
139
+
140
+ ## Available Resources & Tools
141
+
142
+ Once connected, your AI assistant can use these resources and tools:
143
+
144
+ ### Resource: `data://devices`
145
+
146
+ Lists all connected mobile devices (Android and iOS).
147
+
148
+ **Returns:** Array of device information objects with:
149
+
150
+ - `device_id`: Device serial (Android) or UDID (iOS)
151
+ - `platform`: `"android"` or `"ios"`
152
+ - `name`: Device name
153
+ - `state`: Device state (`"connected"` or `"Booted"`)
154
+
155
+ ### Tool: `analyze_screen`
156
+
157
+ Captures a screenshot from a mobile device and analyzes it using a vision language model.
158
+
159
+ **Parameters:**
160
+
161
+ - `prompt` (required): Analysis prompt describing what information to extract
162
+ - `device_id` (optional): Specific device ID to target. If not provided, uses the first available device.
163
+
164
+ **Returns:** AI-generated analysis of the screenshot based on the prompt.
165
+
166
+ **Example:**
167
+
168
+ ```
169
+ Prompt: "What app is currently open? List all visible UI elements."
170
+ ```
171
+
172
+ The tool will:
173
+
174
+ 1. Find the specified device (or first available)
175
+ 2. Capture a screenshot
176
+ 3. Analyze it with the vision model
177
+ 4. Return the analysis
178
+
179
+ ### Tool: `execute_mobile_command`
180
+
181
+ Execute natural language commands on your mobile device using the mobile-use SDK. This tool allows you to control your Android or iOS device with simple instructions.
182
+
183
+ **Parameters:**
184
+
185
+ - `goal` (required): Natural language command to execute on the device
186
+ - `output_description` (optional): Description of the expected output format (e.g., "A JSON list of objects with sender and subject keys")
187
+ - `profile` (optional): Name of the profile to use for this task. Defaults to 'default'
188
+ - `locked_app_package` (optional): Package name of the app to lock the device to. Will launch the app if not already running, and keep it in foreground until the task is completed.
189
+
190
+ **Returns:** Execution result with status, output, and any extracted data.
191
+
192
+ **Examples:**
193
+
194
+ ```python
195
+ # Simple command
196
+ goal: "Go to settings and tell me my current battery level"
197
+
198
+ # Data extraction with structured output
199
+ goal: "Open Gmail, find first 3 unread emails, and list their sender and subject line"
200
+ output_description: "A JSON list of objects, each with 'sender' and 'subject' keys"
201
+
202
+ # App navigation
203
+ goal: "Open Twitter and scroll to the latest tweet"
204
+ ```
205
+
206
+ The tool will:
207
+
208
+ 1. Find the specified device (or first available)
209
+ 2. Execute the command using the mobile-use AI agent
210
+ 3. Return the result or extracted data
211
+
212
+ ### Tool: `save_figma_assets`
213
+
214
+ Fetch Figma design assets and React implementation code, then save them locally in the workspace.
215
+
216
+ **Parameters:**
217
+
218
+ - `node_id` (required): The node ID of the Figma design in format "1:2" (colon-separated). Extract from URLs like `https://figma.com/design/:fileKey/:fileName?node-id=1-2`
219
+ - `file_key` (required): The file key from the Figma URL (e.g., "abc123" from `https://figma.com/design/abc123/MyFile`)
220
+ - `workspace_path` (optional): The workspace path where assets should be saved. Defaults to current directory.
221
+
222
+ **Returns:** Download summary with list of successfully downloaded assets and any failures.
223
+
224
+ **Example:**
225
+
226
+ ```python
227
+ node_id: "1:2"
228
+ file_key: "abc123xyz"
229
+ workspace_path: "."
230
+ ```
231
+
232
+ The tool will:
233
+
234
+ 1. Call `get_design_context` from Figma MCP to get React/TypeScript code
235
+ 2. Extract all asset URLs from the code implementation
236
+ 3. Download each asset to `.mobile-use/figma_assets/<node-id>/` folder
237
+ 4. Save the code implementation to `.mobile-use/figma_assets/<node-id>/code_implementation.ts`
238
+ 5. Return a list of downloaded files with success/failure status
239
+
240
+ ### Tool: `compare_screenshot_with_figma`
241
+
242
+ Compare a screenshot of the current mobile device state with a Figma design to identify visual differences.
243
+
244
+ **Parameters:**
245
+
246
+ - `node_id` (required): The node ID of the Figma design in format "1:2" (colon-separated). Extract from URLs like `https://figma.com/design/:fileKey/:fileName?node-id=1-2`
247
+
248
+ **Returns:** Detailed comparison report with both the Figma design and current device screenshots for visual context.
249
+
250
+ The tool will:
251
+
252
+ 1. Capture a screenshot of the current device state
253
+ 2. Fetch the Figma design screenshot
254
+ 3. Compare both screenshots using vision AI
255
+ 4. Return a detailed analysis highlighting differences
256
+
257
+ ## Cloud Mobile Mode
258
+
259
+ Run the MCP server with cloud-hosted mobile devices instead of requiring a local device. This enables:
260
+
261
+ - **Zero local setup**: No ADB or physical device required
262
+ - **Remote development**: Control cloud mobiles from anywhere
263
+ - **Scalable automation**: Access multiple cloud devices
264
+
265
+ ### Setting Up Cloud Mobile Mode
266
+
267
+ 1. **Create a Cloud Mobile** on [Minitap Platform](https://platform.minitap.ai/cloud-mobiles):
268
+ - Click **Create New Device**
269
+ - Choose platform (currently Android v11 / API level 30)
270
+ - Set a **Reference Name** (e.g., `my-dev-device`)
271
+
272
+ 2. **Configure the environment variable**:
273
+
274
+ ```bash
275
+ # Using reference name (recommended)
276
+ export CLOUD_MOBILE_NAME="my-dev-device"
277
+ ```
278
+
279
+ 3. **Start the server** (no local device needed):
280
+
281
+ ```bash
282
+ minitap-mcp --server --api-key your_minitap_api_key
283
+ ```
284
+
285
+ The server will:
286
+ - Connect to your cloud mobile on startup
287
+ - Maintain a keep-alive connection while running
288
+ - Automatically disconnect when the server stops
289
+
290
+ > ⚠️ **Important**: Cloud mobiles are billed while connected. The MCP server automatically stops the connection when you close your IDE or stop the server. Make sure to properly shut down the server to avoid unexpected charges.
291
+
292
+ ### Cloud vs Local Mode
293
+
294
+ | Feature | Local Mode | Cloud Mode |
295
+ |---------|------------|------------|
296
+ | Device requirement | Physical/emulator | None |
297
+ | Setup complexity | ADB setup required | Low (env var only) |
298
+ | `CLOUD_MOBILE_NAME` | Not set | Set to device name/UUID |
299
+ | Billing | None | Per-minute usage |
300
+
301
+ ## Advanced Configuration
302
+
303
+ ### Custom ADB Server
304
+
305
+ If using a remote or custom ADB server (like on WSL):
306
+
307
+ ```bash
308
+ export ADB_SERVER_SOCKET="tcp:192.168.1.100:5037"
309
+ ```
310
+
311
+ ### Vision Model
312
+
313
+ Customize the vision model used for screen analysis:
314
+
315
+ ```bash
316
+ export VISION_MODEL="google/gemini-3-flash-preview"
317
+ ```
318
+
319
+ ## Device Setup
320
+
321
+ ### Android
322
+
323
+ 1. Enable USB debugging on your device
324
+ 2. Connect via USB or network ADB
325
+ 3. Verify connection: `adb devices`
326
+
327
+ ### iOS (macOS only)
328
+
329
+ 1. Install Xcode Command Line Tools
330
+ 2. Start a simulator or connect a physical device
331
+ 3. Verify: `xcrun simctl list devices booted`
332
+
333
+ ## Troubleshooting
334
+
335
+ **No devices found:**
336
+
337
+ - Verify ADB/xcrun connection
338
+ - Check USB debugging is enabled (Android)
339
+ - Ensure device is unlocked
340
+
341
+ **Connection refused errors:**
342
+
343
+ - Check ADB/xcrun connection
344
+
345
+ **API authentication errors:**
346
+
347
+ - Verify `MINITAP_API_KEY` is set correctly
348
+
349
+ ## Links
350
+
351
+ - **Mobile-Use SDK:** [github.com/minitap-ai/mobile-use](https://github.com/minitap-ai/mobile-use)
352
+ - **Mobile-Use Documentation:** [docs.minitap.ai](https://docs.minitap.ai)
@@ -0,0 +1,35 @@
1
+ minitap/mcp/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ minitap/mcp/core/agents/compare_screenshots/agent.py,sha256=XRYyrv9QA4eb1b44hPjAqz6MKYM6y3THosxP21xzBY4,2458
3
+ minitap/mcp/core/agents/compare_screenshots/eval/prompts/prompt_1.md,sha256=qAyqOroSJROgrvlbsLCtiwFyBKuIMCQ-720A5cwgwPY,3563
4
+ minitap/mcp/core/agents/compare_screenshots/eval/scenario_1_add_cartoon_img_and_move_button/actual.png,sha256=woKE-aTTdb-9ArqfnV-xKKyit1Fu_hklavVwAaMQ14E,99455
5
+ minitap/mcp/core/agents/compare_screenshots/eval/scenario_1_add_cartoon_img_and_move_button/figma.png,sha256=ghxi1P-ofnmMv5_ASm0Rzo5ll_C8-E6ojQUCHRR33TA,102098
6
+ minitap/mcp/core/agents/compare_screenshots/eval/scenario_1_add_cartoon_img_and_move_button/human_feedback.txt,sha256=0gVEqIFpmCX1cx1tlGBdfqDGbTeedyVfwTJZqePURkA,700
7
+ minitap/mcp/core/agents/compare_screenshots/eval/scenario_1_add_cartoon_img_and_move_button/prompt_1/model_params.json,sha256=p93kbUGxLYwc4NAEzPTBDA2XZ1ucsa7yevXZRe6V4Mc,37
8
+ minitap/mcp/core/agents/compare_screenshots/eval/scenario_1_add_cartoon_img_and_move_button/prompt_1/output.md,sha256=Q0_5w9x5WAMqx6-I7KgjlS-tt7HnWKIunP43J7F0W_o,3703
9
+ minitap/mcp/core/agents/compare_screenshots/prompt.md,sha256=qAyqOroSJROgrvlbsLCtiwFyBKuIMCQ-720A5cwgwPY,3563
10
+ minitap/mcp/core/cloud_apk.py,sha256=K0PmmkvkCzYo-eRfwGmfPcBbMy8KD32pHvrehm_L_YM,4308
11
+ minitap/mcp/core/config.py,sha256=dCQMuT-jvGHBxIsvTQoUDOvZ98MTO5iwgCc3_bngX5M,4407
12
+ minitap/mcp/core/decorators.py,sha256=ipzR7kbMXacG91f6CliN-nl9unRTtjmANrfueaOXJ2s,3591
13
+ minitap/mcp/core/device.py,sha256=0AU8qGi26axC6toqHrPIzNeDbNDtll0YRwkspHouPmM,8198
14
+ minitap/mcp/core/llm.py,sha256=tI5m5rFDLeMkXE5WExnzYSzHU3nTIEiSC9nAsPzVMaU,1144
15
+ minitap/mcp/core/logging_config.py,sha256=OJlArPJxflbhckerFsRHVTzy3jwsLsNSPN0LVpkmpNM,1861
16
+ minitap/mcp/core/models.py,sha256=egLScxPAMo4u5cqY33UKba7z7DsdgqfPW409UAqW1Jg,1942
17
+ minitap/mcp/core/sdk_agent.py,sha256=5YEr7aDjoiwbRQkZBK3jDa08c5QhPwLxahzlYrEB_KE,1132
18
+ minitap/mcp/core/storage.py,sha256=t9BAEqXH7Nu8p8hgGIk3mO6rxLwviBP0FqvQD4Lz8CQ,13184
19
+ minitap/mcp/core/task_runs.py,sha256=vGv8G-oZcfe_lpMOGiM649u10WNzoU3uWDgYWm1owdQ,3115
20
+ minitap/mcp/core/utils/figma.py,sha256=L5aAHm59mrRYaqrwMJSM24SSdZPu2yVg-wsHTF3L8vk,2310
21
+ minitap/mcp/core/utils/images.py,sha256=3uExpRoh7affIieZx3TLlZTmZCcoxWfx1YpPbwhjiJY,1791
22
+ minitap/mcp/main.py,sha256=p5E_dBIBiS_sp_v9u8gNxjRGwl25T4De-ivZQbSqJa8,11269
23
+ minitap/mcp/server/cloud_mobile.py,sha256=4cKnUzOJE5tBzgXgJXmyH0ESf6OyCTlNllputEQwFvE,18261
24
+ minitap/mcp/server/middleware.py,sha256=SjPc4pcfPuG0TnaDH7a19DS_HRFPl3bkbovdOLzy_IU,768
25
+ minitap/mcp/server/poller.py,sha256=JsdW6nvj4r3tsn8AaTwXD4H9dVAAau4BhJXHXHit9nA,2528
26
+ minitap/mcp/server/remote_proxy.py,sha256=IM7UfjbJlQRpFD_tdpdck1mFT1QOnlxj5OA1nS4tRhQ,3073
27
+ minitap/mcp/tools/execute_mobile_command.py,sha256=K5KhSAqLdcmc6WH_u2TKAybECPw53TuSLEoSVrGCPOE,6776
28
+ minitap/mcp/tools/read_swift_logs.py,sha256=Wc1XqQWWuNuPEIBioYD2geVd1p9Yq2USik6SX47Fq9A,9285
29
+ minitap/mcp/tools/screen_analyzer.md,sha256=TTO80JQWusbA9cKAZn-9cqhgVHm6F_qJh5w152hG3YM,734
30
+ minitap/mcp/tools/take_screenshot.py,sha256=gGySPSeVnx8lHiseGF_Wat82JLF-D8GuQIJ_hCaLZlQ,1730
31
+ minitap/mcp/tools/upload_screenshot.py,sha256=kwh8Q46LWF3nyKbKlvnlf-CtGrPkctXSnLyeebQGNFI,2959
32
+ minitap_mcp-0.9.0.dist-info/WHEEL,sha256=fAguSjoiATBe7TNBkJwOjyL1Tt4wwiaQGtNtjRPNMQA,80
33
+ minitap_mcp-0.9.0.dist-info/entry_points.txt,sha256=rYVoXm7tSQCqQTtHx4Lovgn1YsjwtEEHfddKrfEVHuY,55
34
+ minitap_mcp-0.9.0.dist-info/METADATA,sha256=-b-kTZM_KwIY3478ZBqCebSM2UbffTA0Kkfro-svxic,10619
35
+ minitap_mcp-0.9.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: uv 0.9.28
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,3 @@
1
+ [console_scripts]
2
+ minitap-mcp = minitap.mcp.main:main
3
+