iflow-mcp_oddlyspaced-android-mcp-py 0.1.0__tar.gz → 0.1.1__tar.gz

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 (24) hide show
  1. {iflow_mcp_oddlyspaced_android_mcp_py-0.1.0 → iflow_mcp_oddlyspaced_android_mcp_py-0.1.1}/PKG-INFO +1 -1
  2. iflow_mcp_oddlyspaced_android_mcp_py-0.1.1/config.py +5 -0
  3. {iflow_mcp_oddlyspaced_android_mcp_py-0.1.0 → iflow_mcp_oddlyspaced_android_mcp_py-0.1.1}/iflow_mcp_oddlyspaced_android_mcp_py.egg-info/PKG-INFO +1 -1
  4. {iflow_mcp_oddlyspaced_android_mcp_py-0.1.0 → iflow_mcp_oddlyspaced_android_mcp_py-0.1.1}/iflow_mcp_oddlyspaced_android_mcp_py.egg-info/SOURCES.txt +2 -0
  5. iflow_mcp_oddlyspaced_android_mcp_py-0.1.1/iflow_mcp_oddlyspaced_android_mcp_py.egg-info/entry_points.txt +2 -0
  6. iflow_mcp_oddlyspaced_android_mcp_py-0.1.1/iflow_mcp_oddlyspaced_android_mcp_py.egg-info/top_level.txt +3 -0
  7. {iflow_mcp_oddlyspaced_android_mcp_py-0.1.0 → iflow_mcp_oddlyspaced_android_mcp_py-0.1.1}/pyproject.toml +7 -8
  8. iflow_mcp_oddlyspaced_android_mcp_py-0.1.1/server.py +276 -0
  9. iflow_mcp_oddlyspaced_android_mcp_py-0.1.0/iflow_mcp_oddlyspaced_android_mcp_py.egg-info/entry_points.txt +0 -2
  10. iflow_mcp_oddlyspaced_android_mcp_py-0.1.0/iflow_mcp_oddlyspaced_android_mcp_py.egg-info/top_level.txt +0 -4
  11. {iflow_mcp_oddlyspaced_android_mcp_py-0.1.0 → iflow_mcp_oddlyspaced_android_mcp_py-0.1.1}/LICENSE +0 -0
  12. {iflow_mcp_oddlyspaced_android_mcp_py-0.1.0 → iflow_mcp_oddlyspaced_android_mcp_py-0.1.1}/iflow_mcp_oddlyspaced_android_mcp_py.egg-info/dependency_links.txt +0 -0
  13. {iflow_mcp_oddlyspaced_android_mcp_py-0.1.0 → iflow_mcp_oddlyspaced_android_mcp_py-0.1.1}/iflow_mcp_oddlyspaced_android_mcp_py.egg-info/requires.txt +0 -0
  14. {iflow_mcp_oddlyspaced_android_mcp_py-0.1.0 → iflow_mcp_oddlyspaced_android_mcp_py-0.1.1}/setup.cfg +0 -0
  15. {iflow_mcp_oddlyspaced_android_mcp_py-0.1.0 → iflow_mcp_oddlyspaced_android_mcp_py-0.1.1}/src/__init__.py +0 -0
  16. {iflow_mcp_oddlyspaced_android_mcp_py-0.1.0 → iflow_mcp_oddlyspaced_android_mcp_py-0.1.1}/src/device_manager.py +0 -0
  17. {iflow_mcp_oddlyspaced_android_mcp_py-0.1.0 → iflow_mcp_oddlyspaced_android_mcp_py-0.1.1}/src/handlers/cpu_info_handler.py +0 -0
  18. {iflow_mcp_oddlyspaced_android_mcp_py-0.1.0 → iflow_mcp_oddlyspaced_android_mcp_py-0.1.1}/src/handlers/device_info_handler.py +0 -0
  19. {iflow_mcp_oddlyspaced_android_mcp_py-0.1.0 → iflow_mcp_oddlyspaced_android_mcp_py-0.1.1}/src/handlers/file_handler.py +0 -0
  20. {iflow_mcp_oddlyspaced_android_mcp_py-0.1.0 → iflow_mcp_oddlyspaced_android_mcp_py-0.1.1}/src/handlers/input_handler.py +0 -0
  21. {iflow_mcp_oddlyspaced_android_mcp_py-0.1.0 → iflow_mcp_oddlyspaced_android_mcp_py-0.1.1}/src/handlers/package_handler.py +0 -0
  22. {iflow_mcp_oddlyspaced_android_mcp_py-0.1.0 → iflow_mcp_oddlyspaced_android_mcp_py-0.1.1}/src/handlers/process_info_handler.py +0 -0
  23. {iflow_mcp_oddlyspaced_android_mcp_py-0.1.0 → iflow_mcp_oddlyspaced_android_mcp_py-0.1.1}/src/handlers/shell_handler.py +0 -0
  24. {iflow_mcp_oddlyspaced_android_mcp_py-0.1.0 → iflow_mcp_oddlyspaced_android_mcp_py-0.1.1}/src/handlers/ui_handler.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: iflow-mcp_oddlyspaced-android-mcp-py
3
- Version: 0.1.0
3
+ Version: 0.1.1
4
4
  Summary: Ultimate Android MCP - A powerful MCP server for interacting with connected Android devices
5
5
  Requires-Python: >=3.11
6
6
  Description-Content-Type: text/markdown
@@ -0,0 +1,5 @@
1
+ class AndroidMCPConfig:
2
+ adb_client_host = "127.0.0.1" # adb server host url
3
+ adb_client_port = 5037 # adb server host port
4
+ # serial number or ip of the connected device to use, if this is not present the first available device would be used
5
+ adb_device_serial = None # Auto-detect first available device
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: iflow-mcp_oddlyspaced-android-mcp-py
3
- Version: 0.1.0
3
+ Version: 0.1.1
4
4
  Summary: Ultimate Android MCP - A powerful MCP server for interacting with connected Android devices
5
5
  Requires-Python: >=3.11
6
6
  Description-Content-Type: text/markdown
@@ -1,5 +1,7 @@
1
1
  LICENSE
2
+ config.py
2
3
  pyproject.toml
4
+ server.py
3
5
  iflow_mcp_oddlyspaced_android_mcp_py.egg-info/PKG-INFO
4
6
  iflow_mcp_oddlyspaced_android_mcp_py.egg-info/SOURCES.txt
5
7
  iflow_mcp_oddlyspaced_android_mcp_py.egg-info/dependency_links.txt
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ android-mcp = iflow_mcp_oddlyspaced_android_mcp_py.server:main
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "iflow-mcp_oddlyspaced-android-mcp-py"
3
- version = "0.1.0"
3
+ version = "0.1.1"
4
4
  description = "Ultimate Android MCP - A powerful MCP server for interacting with connected Android devices"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.11"
@@ -10,12 +10,11 @@ dependencies = [
10
10
  ]
11
11
 
12
12
  [project.scripts]
13
- android-mcp = "server:main"
13
+ android-mcp = "iflow_mcp_oddlyspaced_android_mcp_py.server:main"
14
14
 
15
- [tool.setuptools.packages.find]
16
- where = ["src", "."]
17
- include = ["*"]
18
- exclude = ["tests*", "docs*"]
15
+ [tool.setuptools]
16
+ py-modules = ["server", "config"]
19
17
 
20
- [tool.setuptools.package-data]
21
- "*" = ["*.py", "*.md", "*.txt"]
18
+ [tool.setuptools.packages.find]
19
+ where = ["."]
20
+ include = ["src*", "server.py", "config.py"]
@@ -0,0 +1,276 @@
1
+ from mcp.server.fastmcp import FastMCP
2
+ from src.device_manager import DeviceManager
3
+ from config import AndroidMCPConfig
4
+
5
+ config = AndroidMCPConfig()
6
+ handler = DeviceManager(config)
7
+
8
+ # Create an MCP server
9
+ mcp = FastMCP("Android MCP")
10
+
11
+
12
+ # Tool: Get list of all installed packages
13
+ @mcp.tool()
14
+ def all_packages() -> list[str]:
15
+ """Returns a list of all packages (both system and user-installed) currently installed on the connected Android device. No parameters are required."""
16
+ return handler.get_all_packages()
17
+
18
+
19
+ # Tool: Get list of all user installed packages
20
+ @mcp.tool()
21
+ def user_packages() -> list[str]:
22
+ """Returns a list of user-installed application package names on the connected Android device. No parameters are required."""
23
+ return handler.get_user_packages()
24
+
25
+
26
+ # Tool: Get list of all system installed packages
27
+ @mcp.tool()
28
+ def system_packages() -> list[str]:
29
+ """Returns a list of system application package names (pre-installed apps) on the connected Android device. No parameters are required."""
30
+ return handler.get_system_packages()
31
+
32
+
33
+ # Tool: Launch an app via its package name
34
+ @mcp.tool()
35
+ def launch_app(package_name: str) -> str:
36
+ """Launches the app with the specified package name on the connected Android device. Requires the `package_name` parameter, which is the package name of the app to be launched."""
37
+ try:
38
+ handler.launch_app(package_name)
39
+ return f"Successfully Launched {package_name}"
40
+ except:
41
+ return f"Error Launching {package_name}"
42
+
43
+
44
+ # Tool: Get all the visible text label nodes on the screen
45
+ @mcp.tool()
46
+ def get_current_ui_labels() -> list:
47
+ """Returns a list of UI nodes currently visible on the device screen, focusing on text labels and content descriptions. Each node contains properties like text, bounds, clickable, focusable, and others. No parameters are required."""
48
+ return handler.get_current_ui_labels()
49
+
50
+
51
+ # Tool: Get all the focused nodes
52
+ @mcp.tool()
53
+ def get_current_focused_nodes() -> list:
54
+ """Returns a list of UI nodes that are currently focused on the connected Android device screen. No parameters are required."""
55
+ return handler.get_current_focused_nodes()
56
+
57
+
58
+ # Tool: Input key event
59
+ @mcp.tool()
60
+ def input_keyevent(keycode: int):
61
+ """Simulates a key event with the specified keycode on the connected Android device. Requires the `keycode` parameter, which is the keycode of the key to simulate."""
62
+ return handler.input_keyevent(keycode)
63
+
64
+
65
+ # Tool: Back button
66
+ @mcp.tool()
67
+ def input_back():
68
+ """Simulates a back button event on the connected Android device. No parameters are required."""
69
+ return handler.input_back()
70
+
71
+
72
+ # Tool: Home button
73
+ @mcp.tool()
74
+ def input_home():
75
+ """Simulates a home button event on the connected Android device. No parameters are required."""
76
+ return handler.input_home()
77
+
78
+
79
+ # Tool: Input tap
80
+ @mcp.tool()
81
+ def input_tap(x: int, y: int):
82
+ """Simulates a tap gesture at the specified (x, y) coordinates on the connected Android device screen. Requires `x` and `y` parameters, which are the coordinates of the tap."""
83
+ return handler.input_tap(x, y)
84
+
85
+
86
+ # Tool: Input text
87
+ @mcp.tool()
88
+ def input_text(text: str):
89
+ """Simulates typing the given text input into the currently focused field on the connected Android device. Requires the `text` parameter, which is the string to be typed."""
90
+ return handler.input_text(text)
91
+
92
+
93
+ # Tool: Input press
94
+ @mcp.tool()
95
+ def input_press(keycode: int):
96
+ """Simulates a key press event with the specified keycode on the connected Android device. Requires the `keycode` parameter, which is the keycode of the key to press."""
97
+ return handler.input_press(keycode)
98
+
99
+
100
+ # Tool: Input roll
101
+ @mcp.tool()
102
+ def input_roll(dx: int, dy: int):
103
+ """Simulates a rolling gesture with the specified dx and dy values on the connected Android device. Requires `dx` and `dy` parameters, which are the rolling distances in the x and y directions respectively."""
104
+ return handler.input_roll(dx, dy)
105
+
106
+
107
+ # Tool: Input swipe
108
+ @mcp.tool()
109
+ def input_swipe(x1: int, y1: int, x2: int, y2: int, duration_ms: int = None):
110
+ """Simulates a swipe gesture from (x1, y1) to (x2, y2) with an optional duration on the connected Android device. Requires `x1`, `y1`, `x2`, `y2` parameters for the start and end coordinates, and an optional `duration_ms` parameter for the swipe duration in milliseconds."""
111
+ return handler.input_swipe(x1, y1, x2, y2, duration_ms)
112
+
113
+
114
+ # Tool: Check if keyboard is open
115
+ @mcp.tool()
116
+ def is_keyboard_open():
117
+ """Checks if the virtual keyboard is currently open on the connected Android device. No parameters are required."""
118
+ return handler.is_keyboard_open()
119
+
120
+
121
+ # Tool: Execute ADB shell command
122
+ @mcp.tool()
123
+ def execute_adb_shell(command: str):
124
+ """Executes a raw ADB shell command on the connected Android device and returns the output. Requires the `command` parameter, which is the shell command to execute."""
125
+ return handler.shell(command)
126
+
127
+
128
+ # Tool: Get CPU core count
129
+ @mcp.tool()
130
+ def cpu_count():
131
+ """Returns the number of CPU cores on the connected Android device. No parameters are required."""
132
+ return handler.cpu_count()
133
+
134
+
135
+ # Tool: Get CPU load percentage
136
+ @mcp.tool()
137
+ def cpu_percent():
138
+ """Returns the current CPU load percentage on the connected Android device. No parameters are required."""
139
+ return handler.cpu_percent()
140
+
141
+
142
+ # Tool: Get device serial number
143
+ @mcp.tool()
144
+ def get_serial_no():
145
+ """Returns the serial number of the connected Android device. No parameters are required."""
146
+ return handler.get_serial_no()
147
+
148
+
149
+ # Tool: Get device properties
150
+ @mcp.tool()
151
+ def get_properties():
152
+ """Returns the build.prop properties of the connected Android device. No parameters are required."""
153
+ return handler.get_properties()
154
+
155
+
156
+ # Tool: List device features
157
+ @mcp.tool()
158
+ def list_features():
159
+ """Returns the device overlay configuration properties of the connected Android device. No parameters are required."""
160
+ return handler.list_features()
161
+
162
+
163
+ # Tool: Get battery level
164
+ @mcp.tool()
165
+ def get_battery_level():
166
+ """Returns the battery level of the connected Android device. No parameters are required."""
167
+ return handler.get_battery_level()
168
+
169
+
170
+ # Tool: Get screen density
171
+ @mcp.tool()
172
+ def wm_density():
173
+ """Returns the screen density of the connected Android device. No parameters are required."""
174
+ return handler.wm_density()
175
+
176
+
177
+ # Tool: Get screen size
178
+ @mcp.tool()
179
+ def wm_size():
180
+ """Returns the screen size of the connected Android device. No parameters are required."""
181
+ return handler.wm_size()
182
+
183
+
184
+ # Tool: Pull file from device
185
+ @mcp.tool()
186
+ def pull_file(remote: str, local: str):
187
+ """Pulls a file from the connected Android device to the local machine. Requires `remote` and `local` parameters, which are the paths of the file on the device and the local machine respectively."""
188
+ return handler.pull(remote, local)
189
+
190
+
191
+ # Tool: Push file to device
192
+ @mcp.tool()
193
+ def push_file(local: str, remote: str):
194
+ """Pushes a file from the local machine to the connected Android device. Requires `local` and `remote` parameters, which are the paths of the file on the local machine and the device respectively."""
195
+ return handler.push(local, remote)
196
+
197
+
198
+ # Tool: Get process ID by package name
199
+ @mcp.tool()
200
+ def get_pid(package_name: str):
201
+ """Returns the process ID (PID) for the specified package name on the connected Android device. Requires the `package_name` parameter, which is the name of the package to query."""
202
+ return handler.get_pid(package_name)
203
+
204
+
205
+ # Tool: Get top activities
206
+ @mcp.tool()
207
+ def get_top_activities():
208
+ """Returns the activities currently on top on the connected Android device. No parameters are required."""
209
+ return handler.get_top_activities()
210
+
211
+
212
+ # Tool: Get top activity
213
+ @mcp.tool()
214
+ def get_top_activity():
215
+ """Returns the singular activity currently on top on the connected Android device. No parameters are required."""
216
+ return handler.get_top_activity()
217
+
218
+
219
+ # Tool: Install APK
220
+ @mcp.tool()
221
+ def install_apk(apk_path: str):
222
+ """Installs an APK on the connected Android device. Requires the `apk_path` parameter, which is the path to the APK file to be installed."""
223
+ return handler.install(apk_path)
224
+
225
+
226
+ # Tool: Uninstall package
227
+ @mcp.tool()
228
+ def uninstall_package(package_name: str):
229
+ """Uninstalls the specified package from the connected Android device. Requires the `package_name` parameter, which is the name of the package to uninstall."""
230
+ return handler.uninstall(package_name)
231
+
232
+
233
+ # Tool: Check if package is installed
234
+ @mcp.tool()
235
+ def is_installed(package_name: str):
236
+ """Checks if the specified package is installed on the connected Android device. Requires the `package_name` parameter, which is the name of the package to check."""
237
+ return handler.is_installed(package_name)
238
+
239
+
240
+ # Tool: Get all packages
241
+ @mcp.tool()
242
+ def get_all_packages(
243
+ user_installed_only: bool = False, system_installed_only: bool = False
244
+ ):
245
+ """Returns a list of all packages on the connected Android device, with optional filters for user-installed or system-installed packages. Accepts `user_installed_only` and `system_installed_only` as optional boolean parameters to filter the results."""
246
+ return handler.get_all_packages(user_installed_only, system_installed_only)
247
+
248
+
249
+ # Tool: Get system packages
250
+ @mcp.tool()
251
+ def get_system_packages():
252
+ """Returns a list of system-installed packages on the connected Android device. No parameters are required."""
253
+ return handler.get_system_packages()
254
+
255
+
256
+ # Tool: Get user packages
257
+ @mcp.tool()
258
+ def get_user_packages():
259
+ """Returns a list of user-installed packages on the connected Android device. No parameters are required."""
260
+ return handler.get_user_packages()
261
+
262
+
263
+ # Tool: Launch app
264
+ @mcp.tool()
265
+ def launch_app(package_name: str):
266
+ """Launches the specified app on the connected Android device. Requires the `package_name` parameter, which is the name of the app to launch."""
267
+ return handler.launch_app(package_name)
268
+
269
+
270
+ if __name__ == "__main__":
271
+ mcp.run(transport="stdio")
272
+
273
+
274
+ def main():
275
+ """Entry point for uvx and pip install."""
276
+ mcp.run(transport="stdio")
@@ -1,2 +0,0 @@
1
- [console_scripts]
2
- android-mcp = server:main