android-device-mcp
Provides comprehensive Android device management capabilities through ADB, including device management, app management, file operations, and system monitoring.
README
<p align="center"> <img src="https://github.com/prashant1507/android-device-mcp/blob/main/resources/mcp.png" alt="Android MCP" width="200"> </p>
Android Device MCP
A Model Context Protocol (MCP) server that provides comprehensive Android device management capabilities through ADB (Android Debug Bridge). This tool allows you to interact with Android devices programmatically for device management, app management, file operations, and system monitoring.
Features
Device Management
- List Devices: Get detailed information about all connected Android devices, including OS version, hardware specs, battery status, and network details
- Device Control: Reboot and shut down devices with optional boot modes
- Screenshots: Capture device screenshots and save them locally
- Screen Recording: Record device screen activity for specified durations
- Screen Dump: Export current screen layout as XML for UI automation
- Network Information: Retrieve Wi-Fi details, IP addresses, and connection status
App Management
- List Installed Apps: Get a complete list of installed applications with package names
- App Details: Retrieve detailed information about specific apps (version, SDK, install dates)
- Install Apps: Install APK files on connected devices
- Uninstall Apps: Remove applications from devices
- Launch Apps: Start applications on devices
File System Operations
- List Files: Browse directories on Android devices
- Pull Files: Copy files from devices to the local system
- Push Files: Copy files from the local system to the devices
- Remove Files: Delete files from devices
System Monitoring
- Log Management: Clear and capture device logs (logcat)
- Shell Commands: Execute arbitrary shell commands on devices
- Real-time Logging: Collect logs for specified durations
Prerequisites
- Python 3.13 or higher
- ADB (Android Debug Bridge) installed and accessible in PATH
- Android device(s) connected via USB with USB debugging enabled
- Device(s) authorized for ADB access
- UV is installed
Installation
- Clone the repository:
git clone https://github.com/prashant1507/android-device-mcp.git
cd android-device-mcp
- Install dependencies using uv (recommended) or pip:
# Using uv
uv sync
- Configure your MCP client (LM Studio, CursorAI, Claude, etc.) to use the Android Device MCP server:
{
"mcpServers": {
"android-device-mcp": {
"command": "uv",
"args": [
"run",
"--with",
"mcp[cli]",
"mcp",
"run",
"./android-device-mcp-server.py"
],
"cwd": "/path/to/android-device-mcp"
}
}
}
Note: Replace /path/to/android-device-mcp with the actual path to your project directory.
Error Handling
All functions include comprehensive error handling and will return descriptive error messages if operations fail. Common error scenarios include:
- Device not connected or unauthorized
- ADB server not running
- Invalid file paths
- Insufficient permissions
- Timeout errors for long-running operations
Troubleshooting
Device Not Detected
- Ensure USB debugging is enabled on the device
- Check that the device is authorized for ADB access
- Verify ADB is properly installed and in PATH
- Try restarting the ADB server:
adb kill-server && adb start-server
Permission Errors
- Ensure the device is unlocked and authorized
- Check that the app has the necessary permissions
- For file operations, verify the target directories are writable
Timeout Issues
- Increase timeout values for slow devices or large file transfers
- Check device performance and available storage
- Ensure a stable USB connection
Contributing
Contributions are welcome! Please feel free to submit pull requests or open issues for bugs and feature requests.
Acknowledgments
This project leverages the Android Debug Bridge (ADB) for device communication and the Model Context Protocol (MCP) for tool integration.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。