MCP-Android
项目简介
MCP-Android 是一个基于 MCP 框架开发的 Android 控制服务,支持以下功能:
- 设备管理:列出设备,选择设备。
- 应用管理:列出应用、启动应用、停止应用。
- 屏幕操作:点击屏幕、滑动屏幕、获取屏幕大小。
- 系统设置:关闭自动旋转、返回主屏幕。
如何运行
-
激活虚拟环境: D:\McpTool\mcp-android.venv\Scripts\activate
-
安装依赖: pip install -r pyproject.toml
-
启动 MCP 服务: python src/mcp_android/server.py
-
使用 Postman 或其他客户端访问服务端口(默认
8000)。
工具功能
举例: 列出可用设备
- 请求方法:
GET /mobile_list_available_devices - 返回值示例:
{
"status": "success",
"devices": ["device_serial_1", "device_serial_2"],
"message": "已连接设备列表:[device_serial_1, device_serial_2]"
}
---
### 方法 7: 测试 MCP 服务
你可以编写测试代码来验证服务是否集成成功。
#### 调试和测试:
在 `server.py` 中增加启动时调试日志:
```python
if __name__ == "__main__":
logger.info("MCP 服务正在启动...")
mcp.run()
Metadata
Release files for mcp-android 0.1.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| mcp_android-0.1.7.tar.gz | 45.8 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mcp_android-0.1.7-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 72.9 kB
Release files / mcp_android-0.1.7.tar.gz
| Download URL | mcp_android-0.1.7.tar.gz |
|---|---|
| Size | 45.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
32a212a8877a4d2b427653bbd8c06849e4241076279365fb2856b95036d69ae5
|
|
BLAKE2b-256 checksum How to use checksums |
290adecc1d66d26cd5e85b8843c405693ac9472eae5a18e4ccfcd838b139dc28
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.8.7
|
Release files / mcp_android-0.1.7-py3-none-any.whl
| Download URL | mcp_android-0.1.7-py3-none-any.whl |
|---|---|
| Size | 27.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
634f878954b9179533b234c0bd792a7ee3ca11d4511d3c275f0aa1c1a29f42d4
|
|
BLAKE2b-256 checksum How to use checksums |
98c9838cbead436d5521f5f16e054f760941cadac5b351d0bc64ead0698741e0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.8.7
|
Security for mcp-android 0.1.7
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.