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.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.