mobile-mcp-ai 2.0.0__tar.gz → 2.5.4__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 (94) hide show
  1. mobile_mcp_ai-2.5.4/LICENSE +201 -0
  2. {mobile_mcp_ai-2.0.0 → mobile_mcp_ai-2.5.4}/MANIFEST.in +2 -0
  3. mobile_mcp_ai-2.5.4/PKG-INFO +456 -0
  4. mobile_mcp_ai-2.5.4/README.md +385 -0
  5. mobile_mcp_ai-2.5.4/__init__.py +34 -0
  6. mobile_mcp_ai-2.5.4/config.py +142 -0
  7. mobile_mcp_ai-2.5.4/core/basic_tools_lite.py +3193 -0
  8. mobile_mcp_ai-2.5.4/core/dynamic_config.py +272 -0
  9. mobile_mcp_ai-2.5.4/core/ios_client_wda.py +569 -0
  10. mobile_mcp_ai-2.5.4/core/ios_device_manager_wda.py +306 -0
  11. {mobile_mcp_ai-2.0.0 → mobile_mcp_ai-2.5.4}/core/mobile_client.py +587 -57
  12. mobile_mcp_ai-2.5.4/core/template_matcher.py +429 -0
  13. mobile_mcp_ai-2.5.4/core/templates/close_buttons/auto_x_0112_151217.png +0 -0
  14. mobile_mcp_ai-2.5.4/core/templates/close_buttons/auto_x_0112_152037.png +0 -0
  15. mobile_mcp_ai-2.5.4/core/templates/close_buttons/auto_x_0112_152840.png +0 -0
  16. mobile_mcp_ai-2.5.4/core/templates/close_buttons/auto_x_0112_153256.png +0 -0
  17. mobile_mcp_ai-2.5.4/core/templates/close_buttons/auto_x_0112_154847.png +0 -0
  18. mobile_mcp_ai-2.5.4/core/templates/close_buttons/gray_x_stock_ad.png +0 -0
  19. mobile_mcp_ai-2.5.4/docs/iOS_SETUP_GUIDE.md +350 -0
  20. mobile_mcp_ai-2.5.4/mcp_tools/__init__.py +10 -0
  21. mobile_mcp_ai-2.5.4/mcp_tools/mcp_server.py +1027 -0
  22. mobile_mcp_ai-2.5.4/mobile_mcp_ai.egg-info/PKG-INFO +456 -0
  23. mobile_mcp_ai-2.5.4/mobile_mcp_ai.egg-info/SOURCES.txt +81 -0
  24. mobile_mcp_ai-2.5.4/mobile_mcp_ai.egg-info/entry_points.txt +2 -0
  25. {mobile_mcp_ai-2.0.0 → mobile_mcp_ai-2.5.4}/mobile_mcp_ai.egg-info/requires.txt +2 -1
  26. mobile_mcp_ai-2.5.4/mobile_mcp_ai.egg-info/top_level.txt +1 -0
  27. {mobile_mcp_ai-2.0.0 → mobile_mcp_ai-2.5.4}/requirements.txt +7 -2
  28. {mobile_mcp_ai-2.0.0 → mobile_mcp_ai-2.5.4}/setup.py +18 -5
  29. mobile_mcp_ai-2.5.4/templates/close_buttons/auto_x_0112_151217.png +0 -0
  30. mobile_mcp_ai-2.5.4/templates/close_buttons/auto_x_0112_152037.png +0 -0
  31. mobile_mcp_ai-2.5.4/templates/close_buttons/auto_x_0112_152840.png +0 -0
  32. mobile_mcp_ai-2.5.4/templates/close_buttons/auto_x_0112_153256.png +0 -0
  33. mobile_mcp_ai-2.5.4/templates/close_buttons/auto_x_0112_154847.png +0 -0
  34. mobile_mcp_ai-2.5.4/templates/close_buttons/gray_x_stock_ad.png +0 -0
  35. mobile_mcp_ai-2.5.4/tests/test_mind_cloud_my_space.py +80 -0
  36. mobile_mcp_ai-2.5.4/tests/test_mind_correct.py +73 -0
  37. mobile_mcp_ai-2.5.4/tests/test_mind_improved.py +83 -0
  38. mobile_mcp_ai-2.5.4/tests/test_mind_optimized.py +77 -0
  39. mobile_mcp_ai-2.5.4/tests/test_open_mind.py +37 -0
  40. mobile_mcp_ai-2.5.4/tests/test_priority_demo.py +81 -0
  41. mobile_mcp_ai-2.5.4/tests/test_simple.py +76 -0
  42. mobile_mcp_ai-2.5.4/tests/test_/346/265/213/350/257/225.py +114 -0
  43. mobile_mcp_ai-2.0.0/PKG-INFO +0 -230
  44. mobile_mcp_ai-2.0.0/README.md +0 -162
  45. mobile_mcp_ai-2.0.0/core/ai/__init__.py +0 -11
  46. mobile_mcp_ai-2.0.0/core/ai/ai_analyzer.py +0 -197
  47. mobile_mcp_ai-2.0.0/core/ai/ai_config.py +0 -116
  48. mobile_mcp_ai-2.0.0/core/ai/ai_platform_adapter.py +0 -380
  49. mobile_mcp_ai-2.0.0/core/ai/smart_test_executor.py +0 -520
  50. mobile_mcp_ai-2.0.0/core/ai/test_generator.py +0 -365
  51. mobile_mcp_ai-2.0.0/core/ai/test_generator_from_history.py +0 -391
  52. mobile_mcp_ai-2.0.0/core/assertion/__init__.py +0 -9
  53. mobile_mcp_ai-2.0.0/core/assertion/smart_assertion.py +0 -341
  54. mobile_mcp_ai-2.0.0/core/basic_tools.py +0 -377
  55. mobile_mcp_ai-2.0.0/core/h5/__init__.py +0 -10
  56. mobile_mcp_ai-2.0.0/core/h5/h5_handler.py +0 -548
  57. mobile_mcp_ai-2.0.0/core/ios_client.py +0 -219
  58. mobile_mcp_ai-2.0.0/core/ios_device_manager.py +0 -252
  59. mobile_mcp_ai-2.0.0/core/locator/__init__.py +0 -10
  60. mobile_mcp_ai-2.0.0/core/locator/cursor_ai_auto_analyzer.py +0 -119
  61. mobile_mcp_ai-2.0.0/core/locator/cursor_vision_helper.py +0 -413
  62. mobile_mcp_ai-2.0.0/core/locator/mobile_smart_locator.py +0 -1629
  63. mobile_mcp_ai-2.0.0/core/locator/position_analyzer.py +0 -813
  64. mobile_mcp_ai-2.0.0/core/locator/script_updater.py +0 -157
  65. mobile_mcp_ai-2.0.0/core/nl_test_runner.py +0 -585
  66. mobile_mcp_ai-2.0.0/core/smart_app_launcher.py +0 -288
  67. mobile_mcp_ai-2.0.0/core/smart_tools.py +0 -311
  68. mobile_mcp_ai-2.0.0/docs/START_GUIDE.md +0 -356
  69. mobile_mcp_ai-2.0.0/docs/USER_CONFIGURATION_GUIDE.md +0 -321
  70. mobile_mcp_ai-2.0.0/docs//345/246/202/344/275/225/347/224/237/346/210/220/346/265/213/350/257/225/350/204/232/346/234/254.md +0 -1
  71. mobile_mcp_ai-2.0.0/mcp/__init__.py +0 -8
  72. mobile_mcp_ai-2.0.0/mcp/mcp_server.py +0 -1797
  73. mobile_mcp_ai-2.0.0/mcp/mcp_server_simple.py +0 -476
  74. mobile_mcp_ai-2.0.0/mobile_mcp_ai.egg-info/PKG-INFO +0 -230
  75. mobile_mcp_ai-2.0.0/mobile_mcp_ai.egg-info/SOURCES.txt +0 -55
  76. mobile_mcp_ai-2.0.0/mobile_mcp_ai.egg-info/entry_points.txt +0 -2
  77. mobile_mcp_ai-2.0.0/mobile_mcp_ai.egg-info/top_level.txt +0 -4
  78. mobile_mcp_ai-2.0.0/vision/__init__.py +0 -10
  79. mobile_mcp_ai-2.0.0/vision/vision_locator.py +0 -404
  80. {mobile_mcp_ai-2.0.0 → mobile_mcp_ai-2.5.4}/core/__init__.py +0 -0
  81. {mobile_mcp_ai-2.0.0 → mobile_mcp_ai-2.5.4}/core/device_manager.py +0 -0
  82. {mobile_mcp_ai-2.0.0 → mobile_mcp_ai-2.5.4}/core/utils/__init__.py +0 -0
  83. {mobile_mcp_ai-2.0.0 → mobile_mcp_ai-2.5.4}/core/utils/logger.py +0 -0
  84. {mobile_mcp_ai-2.0.0 → mobile_mcp_ai-2.5.4}/core/utils/operation_history_manager.py +0 -0
  85. {mobile_mcp_ai-2.0.0 → mobile_mcp_ai-2.5.4}/core/utils/smart_wait.py +0 -0
  86. {mobile_mcp_ai-2.0.0 → mobile_mcp_ai-2.5.4}/mobile_mcp_ai.egg-info/dependency_links.txt +0 -0
  87. {mobile_mcp_ai-2.0.0 → mobile_mcp_ai-2.5.4}/mobile_mcp_ai.egg-info/not-zip-safe +0 -0
  88. {mobile_mcp_ai-2.0.0 → mobile_mcp_ai-2.5.4}/setup.cfg +0 -0
  89. {mobile_mcp_ai-2.0.0 → mobile_mcp_ai-2.5.4}/tests/test_/344/270/276/346/212/245.py" +0 -0
  90. {mobile_mcp_ai-2.0.0 → mobile_mcp_ai-2.5.4}/tests/test_/345/210/207/346/215/242/350/257/255/350/250/200/345/210/260English.py" +0 -0
  91. {mobile_mcp_ai-2.0.0 → mobile_mcp_ai-2.5.4}/utils/__init__.py +0 -0
  92. {mobile_mcp_ai-2.0.0 → mobile_mcp_ai-2.5.4}/utils/logger.py +0 -0
  93. {mobile_mcp_ai-2.0.0 → mobile_mcp_ai-2.5.4}/utils/xml_formatter.py +0 -0
  94. {mobile_mcp_ai-2.0.0 → mobile_mcp_ai-2.5.4}/utils/xml_parser.py +0 -0
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -4,6 +4,8 @@ include LICENSE
4
4
  include requirements.txt
5
5
  recursive-include docs *.md
6
6
  recursive-include docs *.txt
7
+ recursive-include templates *.png
8
+ recursive-include core/templates *.png
7
9
  recursive-exclude * __pycache__
8
10
  recursive-exclude * *.pyc
9
11
  recursive-exclude * .DS_Store
@@ -0,0 +1,456 @@
1
+ Metadata-Version: 2.4
2
+ Name: mobile-mcp-ai
3
+ Version: 2.5.4
4
+ Summary: 移动端自动化 MCP Server - 支持 Android/iOS,AI 功能可选(基础工具不需要 AI)
5
+ Home-page: https://github.com/test111ddff-hash/mobile-mcp-ai
6
+ Author: douzi
7
+ Author-email: 1492994674@qq.com
8
+ Project-URL: Documentation, https://github.com/test111ddff-hash/mobile-mcp-ai
9
+ Project-URL: Source, https://github.com/test111ddff-hash/mobile-mcp-ai
10
+ Project-URL: Tracker, https://github.com/test111ddff-hash/mobile-mcp-ai/issues
11
+ Keywords: mobile,automation,testing,android,ios,mcp,ai,pytest,cursor
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: Apache Software License
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.8
17
+ Classifier: Programming Language :: Python :: 3.9
18
+ Classifier: Programming Language :: Python :: 3.10
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Topic :: Software Development :: Testing
21
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
22
+ Requires-Python: >=3.8
23
+ Description-Content-Type: text/markdown
24
+ License-File: LICENSE
25
+ Requires-Dist: uiautomator2>=2.16.0
26
+ Requires-Dist: adbutils>=1.2.0
27
+ Requires-Dist: Pillow>=10.0.0
28
+ Requires-Dist: mcp>=0.9.0
29
+ Requires-Dist: python-dotenv>=1.0.0
30
+ Provides-Extra: ai
31
+ Requires-Dist: dashscope>=1.10.0; extra == "ai"
32
+ Requires-Dist: openai>=1.0.0; extra == "ai"
33
+ Requires-Dist: anthropic>=0.3.0; extra == "ai"
34
+ Provides-Extra: test
35
+ Requires-Dist: pytest>=8.0.0; extra == "test"
36
+ Requires-Dist: pytest-asyncio>=0.21.0; extra == "test"
37
+ Requires-Dist: allure-pytest>=2.13.0; extra == "test"
38
+ Provides-Extra: dev
39
+ Requires-Dist: pytest>=8.0.0; extra == "dev"
40
+ Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
41
+ Requires-Dist: twine>=4.0.0; extra == "dev"
42
+ Requires-Dist: build>=0.10.0; extra == "dev"
43
+ Provides-Extra: ios
44
+ Requires-Dist: tidevice>=0.11.0; extra == "ios"
45
+ Requires-Dist: facebook-wda>=1.4.0; extra == "ios"
46
+ Provides-Extra: h5
47
+ Requires-Dist: Appium-Python-Client>=3.0.0; extra == "h5"
48
+ Requires-Dist: selenium>=4.0.0; extra == "h5"
49
+ Provides-Extra: all
50
+ Requires-Dist: dashscope>=1.10.0; extra == "all"
51
+ Requires-Dist: openai>=1.0.0; extra == "all"
52
+ Requires-Dist: anthropic>=0.3.0; extra == "all"
53
+ Requires-Dist: Appium-Python-Client>=3.0.0; extra == "all"
54
+ Requires-Dist: selenium>=4.0.0; extra == "all"
55
+ Requires-Dist: pytest>=8.0.0; extra == "all"
56
+ Requires-Dist: pytest-asyncio>=0.21.0; extra == "all"
57
+ Requires-Dist: allure-pytest>=2.13.0; extra == "all"
58
+ Dynamic: author
59
+ Dynamic: author-email
60
+ Dynamic: classifier
61
+ Dynamic: description
62
+ Dynamic: description-content-type
63
+ Dynamic: home-page
64
+ Dynamic: keywords
65
+ Dynamic: license-file
66
+ Dynamic: project-url
67
+ Dynamic: provides-extra
68
+ Dynamic: requires-dist
69
+ Dynamic: requires-python
70
+ Dynamic: summary
71
+
72
+ # 📱 Mobile MCP AI
73
+
74
+ > 让 Cursor 直接控制手机的 MCP 工具
75
+
76
+ <div align="center">
77
+
78
+ [![PyPI](https://img.shields.io/pypi/v/mobile-mcp-ai.svg?style=flat-square&color=blue)](https://pypi.org/project/mobile-mcp-ai/)
79
+ [![Python](https://img.shields.io/badge/python-3.8+-green.svg?style=flat-square)](https://www.python.org/)
80
+ [![License](https://img.shields.io/badge/license-Apache%202.0-orange.svg?style=flat-square)](LICENSE)
81
+ [![Android](https://img.shields.io/badge/Android-支持-brightgreen.svg?style=flat-square&logo=android)](https://developer.android.com/)
82
+ [![iOS](https://img.shields.io/badge/iOS-支持-black.svg?style=flat-square&logo=apple)](docs/iOS_SETUP_GUIDE.md)
83
+
84
+ **⭐ 觉得有用?给个 Star 支持一下!**
85
+
86
+ **📱 支持 Android 和 iOS 双平台**
87
+
88
+ </div>
89
+
90
+ ---
91
+
92
+ ## 🎬 演示
93
+
94
+ <div align="center">
95
+
96
+ ![演示动图](docs/videos/demo.gif)
97
+
98
+ *[查看高清视频 →](docs/videos/demo.mp4)*
99
+
100
+ </div>
101
+
102
+ ---
103
+
104
+ ## ✨ 核心特性
105
+
106
+ <table>
107
+ <tr>
108
+ <td width="50%">
109
+
110
+ ### 🧠 AI 原生驱动
111
+
112
+ 基于 MCP 协议与 Cursor AI 深度集成,自然语言直接操控手机,告别繁琐的脚本编写
113
+
114
+ </td>
115
+ <td width="50%">
116
+
117
+ ### 👁️ 视觉智能识别
118
+
119
+ Cursor AI 自动分析截图,精准定位 UI 元素,游戏、原生应用通吃
120
+
121
+ </td>
122
+ </tr>
123
+ <tr>
124
+ <td width="50%">
125
+
126
+ ### ⚡ 零配置启动
127
+
128
+ `pip install` 一行命令,开箱即用,无需额外 AI 密钥
129
+
130
+ </td>
131
+ <td width="50%">
132
+
133
+ ### 🔄 一键生成脚本
134
+
135
+ 操作即录制,自动生成可复用的 pytest 测试脚本
136
+
137
+ </td>
138
+ </tr>
139
+ <tr>
140
+ <td width="50%">
141
+
142
+ ### 🎯 双模式定位
143
+
144
+ 元素树 + 视觉坐标双引擎,普通 App 秒定位,游戏场景不迷路
145
+
146
+ </td>
147
+ <td width="50%">
148
+
149
+ ### 🛡️ 智能验证机制
150
+
151
+ 按键操作自动验证生效,告别"假成功"
152
+
153
+ </td>
154
+ </tr>
155
+ </table>
156
+
157
+ ---
158
+
159
+ ## 📱 平台支持
160
+
161
+ | 平台 | 支持状态 | 系统要求 | 配置指南 |
162
+ |:---:|:---:|:---:|:---:|
163
+ | **Android** | ✅ 完整支持 | Windows / macOS / Linux | 开箱即用 |
164
+ | **iOS** | ✅ 完整支持 | macOS(必须) | [iOS 配置指南 →](docs/iOS_SETUP_GUIDE.md) |
165
+
166
+ ---
167
+
168
+ ## 📦 安装
169
+
170
+ ```bash
171
+ pip install mobile-mcp-ai
172
+ ```
173
+
174
+ **升级到最新版**
175
+
176
+ ```bash
177
+ pip install --upgrade mobile-mcp-ai
178
+ ```
179
+
180
+ **查看当前版本**
181
+
182
+ ```bash
183
+ pip show mobile-mcp-ai
184
+ ```
185
+
186
+ ---
187
+
188
+ ## 📱 连接设备
189
+
190
+ ### Android 设备
191
+
192
+ 确保手机已开启 USB 调试,然后:
193
+
194
+ ```bash
195
+ adb devices
196
+ ```
197
+
198
+ 看到设备列表即表示连接成功。
199
+
200
+ ### iOS 设备(macOS)
201
+
202
+ iOS 自动化需要额外配置 WebDriverAgent,请参考:
203
+
204
+ 📖 **[iOS 配置指南 →](docs/iOS_SETUP_GUIDE.md)**
205
+
206
+ 快速检查连接:
207
+ ```bash
208
+ tidevice list
209
+ ```
210
+
211
+ ---
212
+
213
+ ## 🎯 新用户快速入门
214
+
215
+ ### 第一步:安装
216
+
217
+ ```bash
218
+ pip install mobile-mcp-ai
219
+ ```
220
+
221
+ ### 第二步:连接设备
222
+
223
+ **Android 用户:**
224
+ ```bash
225
+ # 开启手机 USB 调试,连接电脑
226
+ adb devices
227
+ ```
228
+
229
+ **iOS 用户:**
230
+ ```bash
231
+ # 安装依赖
232
+ pip install tidevice facebook-wda
233
+ brew install libimobiledevice
234
+
235
+ # 检查连接
236
+ tidevice list
237
+ ```
238
+
239
+ > 📖 iOS 需要额外配置 WebDriverAgent,详见 **[iOS 配置指南](docs/iOS_SETUP_GUIDE.md)**
240
+
241
+ ### 第三步:配置 Cursor
242
+
243
+ 编辑 `~/.cursor/mcp.json`:
244
+
245
+ ```json
246
+ {
247
+ "mcpServers": {
248
+ "mobile-automation": {
249
+ "command": "mobile-mcp"
250
+ }
251
+ }
252
+ }
253
+ ```
254
+
255
+ > 💡 提示:会自动检测 Android/iOS 设备,无需额外配置
256
+
257
+ ### 第四步:重启 Cursor
258
+
259
+ 保存配置后,**重启 Cursor** 使配置生效。
260
+
261
+ ### 第五步:开始使用
262
+
263
+ 在 Cursor 中输入:
264
+
265
+ ```
266
+ @MCP 检查设备连接
267
+ ```
268
+
269
+ ```
270
+ @MCP 截图看看当前页面
271
+ ```
272
+
273
+ ```
274
+ @MCP 点击"登录"按钮
275
+ ```
276
+
277
+ ---
278
+
279
+ ## ⚙️ 高级配置
280
+
281
+ ### 方式一:pip 安装后配置(推荐)
282
+
283
+ 先安装:`pip install mobile-mcp-ai`
284
+
285
+ ```json
286
+ {
287
+ "mcpServers": {
288
+ "mobile-automation": {
289
+ "command": "mobile-mcp"
290
+ }
291
+ }
292
+ }
293
+ ```
294
+
295
+ ### 方式二:源码方式配置
296
+
297
+ 如果你是从源码运行:
298
+
299
+ **Android 配置:**
300
+
301
+ ```json
302
+ {
303
+ "mcpServers": {
304
+ "mobile-automation": {
305
+ "command": "/path/to/your/venv/bin/python",
306
+ "args": ["-m", "mobile_mcp.mcp_tools.mcp_server"],
307
+ "cwd": "/path/to/mobile_mcp",
308
+ "env": {
309
+ "MOBILE_PLATFORM": "android"
310
+ }
311
+ }
312
+ }
313
+ }
314
+ ```
315
+
316
+ **iOS 配置:**
317
+
318
+ ```json
319
+ {
320
+ "mcpServers": {
321
+ "mobile-automation": {
322
+ "command": "/path/to/your/venv/bin/python",
323
+ "args": ["-m", "mobile_mcp.mcp_tools.mcp_server"],
324
+ "cwd": "/path/to/mobile_mcp",
325
+ "env": {
326
+ "MOBILE_PLATFORM": "ios"
327
+ }
328
+ }
329
+ }
330
+ }
331
+ ```
332
+
333
+ > ⚠️ 请将 `/path/to/` 替换为你的实际路径
334
+ >
335
+ > 📖 iOS 需要先配置 WebDriverAgent,详见 **[iOS 配置指南](docs/iOS_SETUP_GUIDE.md)**
336
+
337
+ 保存后**重启 Cursor**。
338
+
339
+ ---
340
+
341
+ ## 🚀 使用示例
342
+
343
+ 在 Cursor 中直接对话:
344
+
345
+ **基础操作**
346
+
347
+ ```
348
+ @MCP 列出当前页面所有元素
349
+ ```
350
+
351
+ ```
352
+ @MCP 点击"登录"按钮
353
+ ```
354
+
355
+ ```
356
+ @MCP 在用户名输入框输入 test123
357
+ ```
358
+
359
+ **应用控制**
360
+
361
+ ```
362
+ @MCP 启动微信
363
+ ```
364
+
365
+ ```
366
+ @MCP 打开抖音,向上滑动 3 次
367
+ ```
368
+
369
+ ```
370
+ @MCP 列出手机上所有已安装的应用
371
+ ```
372
+
373
+ **截图分析**
374
+
375
+ ```
376
+ @MCP 截图看看当前页面
377
+ ```
378
+
379
+ ```
380
+ @MCP 截图,然后点击页面上的搜索图标
381
+ ```
382
+
383
+ **测试脚本生成**
384
+
385
+ ```
386
+ @MCP 帮我测试登录流程:输入用户名密码,点击登录
387
+ ```
388
+
389
+ ```
390
+ @MCP 把刚才的操作生成 pytest 测试脚本
391
+ ```
392
+
393
+ **组合操作**
394
+
395
+ ```
396
+ @MCP 打开设置,找到 WLAN,点进去截图
397
+ ```
398
+
399
+ ```
400
+ @MCP 打开微信,点击发现,再点击朋友圈
401
+ ```
402
+
403
+ ---
404
+
405
+ ## 🛠️ 工具列表
406
+
407
+ | 类别 | 工具 | 说明 |
408
+ |:---:|------|------|
409
+ | 📋 | `mobile_list_elements` | 列出页面元素 |
410
+ | 📸 | `mobile_take_screenshot` | 截图 |
411
+ | 📐 | `mobile_get_screen_size` | 屏幕尺寸 |
412
+ | 👆 | `mobile_click_by_text` | 文本点击 |
413
+ | 👆 | `mobile_click_by_id` | ID 点击 |
414
+ | 👆 | `mobile_click_at_coords` | 坐标点击 |
415
+ | ⌨️ | `mobile_input_text_by_id` | ID 输入 |
416
+ | ⌨️ | `mobile_input_at_coords` | 坐标输入 |
417
+ | 👆 | `mobile_swipe` | 滑动 |
418
+ | ⌨️ | `mobile_press_key` | 按键 |
419
+ | ⏱️ | `mobile_wait` | 等待 |
420
+ | 📦 | `mobile_launch_app` | 启动应用 |
421
+ | 📦 | `mobile_terminate_app` | 终止应用 |
422
+ | 📦 | `mobile_list_apps` | 列出应用 |
423
+ | 📱 | `mobile_list_devices` | 列出设备 |
424
+ | 🔌 | `mobile_check_connection` | 检查连接 |
425
+ | ✅ | `mobile_assert_text` | 断言文本 |
426
+ | 📜 | `mobile_get_operation_history` | 操作历史 |
427
+ | 🗑️ | `mobile_clear_operation_history` | 清空历史 |
428
+ | 📝 | `mobile_generate_test_script` | 生成测试脚本 |
429
+
430
+ ---
431
+
432
+ ## 📞 联系作者
433
+
434
+ <div align="center">
435
+
436
+ <img src="docs/images/wechat-qr.jpg" alt="微信" width="250"/>
437
+
438
+ *添加微信交流(备注:mobile-mcp)*
439
+
440
+ </div>
441
+
442
+ ---
443
+
444
+ ## 📄 License
445
+
446
+ Apache 2.0
447
+
448
+ ---
449
+
450
+ <div align="center">
451
+
452
+ [Gitee](https://gitee.com/chang-xinping/mobile-automation-mcp-service) · [GitHub](https://github.com/test111ddff-hash/mobile-mcp-ai) · [PyPI](https://pypi.org/project/mobile-mcp-ai/)
453
+
454
+ **🚀 让移动端测试更简单**
455
+
456
+ </div>