A custom MCP tool for Android
Project description
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()
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
mcp_android-0.1.6.tar.gz
(45.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcp_android-0.1.6.tar.gz.
File metadata
- Download URL: mcp_android-0.1.6.tar.gz
- Upload date:
- Size: 45.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
65b154516adc542e6bf54389d89cdb68952af46c36fbae2af99166203738c074
|
|
| MD5 |
4b298a837da78c23695048af0af8da0e
|
|
| BLAKE2b-256 |
107f7bac942a4ad9ac2bf131162df736736da9b9e51609b60a14a847a9978d0f
|
File details
Details for the file mcp_android-0.1.6-py3-none-any.whl.
File metadata
- Download URL: mcp_android-0.1.6-py3-none-any.whl
- Upload date:
- Size: 26.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b795088b538aefcbbdb1cd6e2f1abebf0fcf113f50c734851f352bda048b6ea4
|
|
| MD5 |
b23a359e78f2ad12de3fd3484e8b1cd2
|
|
| BLAKE2b-256 |
0ee56420eda004ee4d4f2e881bf6b88500edbd44e90cd324034e18b53adc2a9a
|