Skip to main content

A custom MCP tool for Android

Project description

MCP-Android

项目简介

MCP-Android 是一个基于 MCP 框架开发的 Android 控制服务,支持以下功能:

  • 设备管理:列出设备,选择设备。
  • 应用管理:列出应用、启动应用、停止应用。
  • 屏幕操作:点击屏幕、滑动屏幕、获取屏幕大小。
  • 系统设置:关闭自动旋转、返回主屏幕。

如何运行

  1. 激活虚拟环境: D:\McpTool\mcp-android.venv\Scripts\activate

  2. 安装依赖: pip install -r pyproject.toml

  3. 启动 MCP 服务: python src/mcp_android/server.py

  4. 使用 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.5.tar.gz (43.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_android-0.1.5-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

Details for the file mcp_android-0.1.5.tar.gz.

File metadata

  • Download URL: mcp_android-0.1.5.tar.gz
  • Upload date:
  • Size: 43.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for mcp_android-0.1.5.tar.gz
Algorithm Hash digest
SHA256 bec4f718de591388a41b05474ef267d94ba29ea2751200b33de156bbd2bea668
MD5 021615ad9614b3b17de2c828dd4172fe
BLAKE2b-256 a802da1efd8f240b3f5d48a2eaa814bd86268de7c2df38afd88374a6f42aea9e

See more details on using hashes here.

File details

Details for the file mcp_android-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: mcp_android-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 11.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for mcp_android-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 461198eddd5056c66d36b7302689ce35cde7a3cddabbdec978f03f3246a8fffd
MD5 e99c41d875c0f58d06641851832f89b2
BLAKE2b-256 8b3bf2c0c52a9ee211911f191b13c851e53ec0acc62504d7955f92a7bba3db81

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page