A comprehensive Model Context Protocol (MCP) server for Android device automation that enables AI assistants to interact with, debug, and automate Android devices through a standardized interface.
π€ AI-Native Automation - Designed for AI assistants to seamlessly control Android devices π± Complete Android Coverage - 64 comprehensive tools across all major automation categories π§ Native ADB Integration - Direct Android Debug Bridge integration with minimal dependencies π 100% MCP Compliant - Fully compliant with MCP specification 2025-03-26 ποΈ Pure Tool Provider - No embedded LLM dependencies, works with any AI system π Advanced UI Analysis - XML hierarchy parsing with intelligent element discovery β‘ High Performance - Native Go implementation with concurrent device management π‘οΈ Enterprise Ready - Production-ready with comprehensive error handling and security
Total: 64 Production-Ready Android Automation Tools
| Category | Tools | Description |
|---|---|---|
| π§ File Operations | 8 tools | Complete file system management |
| π± Enhanced App Management | 8 tools | Application lifecycle and permissions |
| βοΈ System Control | 7 tools | Device settings and configuration |
| π Performance Monitoring | 6 tools | System analysis and diagnostics |
| π Advanced Features | 7 tools | Expert automation and debugging |
| π Core Device Management | 8 tools | Essential device interaction |
| π― UI Analysis & Automation | 12 tools | Smart element discovery and interaction |
| π System Monitoring | 8 tools | Comprehensive system analysis |
- π± Complete Feature Guide - Comprehensive overview of all 64 tools with examples, architecture, and implementation details
- π MCP Tool Schema Specification - Official MCP schema validation and compliance guide
- π οΈ MCP Implementation Guide - Complete MCP tool implementation reference with best practices
- β MCP Enhancement Summary - Development progress and compliance verification
-
Android Debug Bridge (ADB) - Must be installed and in PATH
# Verify ADB installation adb version -
Go 1.21+ - For building from source
# Verify Go installation go version -
Android Device - Physical device or emulator with USB debugging enabled
# Clone the repository
git clone https://github.com/moonbeam-mcp/moonbeam.git
cd moonbeam/mcp-server
# Build the server
go build -o moonbeam ./cmd/moonbeam
# Run with stdio transport (default)
./moonbeamgo install github.com/moonbeam-mcp/moonbeam/cmd/moonbeam@latest
moonbeam# Start server with stdio transport
./moonbeam
# Or with debug logging
./moonbeam -debug# Use custom config file
./moonbeam -config /path/to/config.jsonEssential file system management for Android devices.
| Tool | Description | Key Parameters |
|---|---|---|
push_file |
Upload files from local to device | local_path, device_path |
pull_file |
Download files from device to local | device_path, local_path |
list_files |
List files and directories | path, detailed |
create_directory |
Create directories | path, recursive |
delete_file |
Delete files/directories | path, recursive, force |
copy_file |
Copy files within device | source_path, dest_path |
move_file |
Move/rename files | source_path, dest_path |
Complete application lifecycle and permission control.
| Tool | Description | Key Parameters |
|---|---|---|
install_app |
Install APK files | apk_path, replace |
uninstall_app |
Remove applications | package_name, keep_data |
force_stop_app |
Force stop running apps | package_name |
clear_app_data |
Clear app data/cache | package_name |
grant_permission |
Grant runtime permissions | package_name, permission |
revoke_permission |
Revoke permissions | package_name, permission |
enable_app |
Enable disabled apps | package_name |
disable_app |
Disable apps without removal | package_name |
Device settings and system configuration management.
| Tool | Description | Key Parameters |
|---|---|---|
set_brightness |
Control screen brightness | brightness (0-255) |
get_brightness |
Get current brightness | - |
set_volume |
Control audio volume | stream, volume |
set_orientation |
Control screen orientation | orientation |
wifi_control |
Manage WiFi connectivity | action |
mobile_data_control |
Control mobile data | action |
developer_settings |
Manage developer options | setting, value |
System performance analysis and resource monitoring.
| Tool | Description | Key Parameters |
|---|---|---|
get_memory_info |
System memory statistics | - |
get_app_memory |
App memory usage | package_name |
get_cpu_info |
CPU information | - |
get_top_processes |
Top CPU processes | limit |
get_battery_stats |
Battery information | reset |
get_thermal_info |
Thermal zone temperatures | - |
Expert automation and debugging capabilities.
| Tool | Description | Key Parameters |
|---|---|---|
screen_record |
Record device screen | duration, bit_rate, size |
reboot_device |
Reboot with mode selection | mode |
port_forward |
Manage ADB port forwarding | local_port, remote_port, action |
execute_shell |
Execute shell commands | command, timeout |
advanced_logcat |
Advanced log filtering | filter, priority, buffer |
device_property |
Manage system properties | property, value, action |
adb_connection |
Network ADB connections | host, port, action |
Essential device discovery and interaction.
| Tool | Description | Key Parameters |
|---|---|---|
list_devices |
Discover connected devices | - |
get_device_info |
Comprehensive device info | device_id |
refresh_devices |
Refresh device list | - |
screenshot |
Capture screenshots | device_id |
tap |
Touch gestures | x, y |
swipe |
Swipe gestures | x1, y1, x2, y2, duration |
long_press |
Long press gestures | x, y, duration |
input_text |
Text input | text, clear |
Smart element discovery and interaction.
| Tool | Description | Key Parameters |
|---|---|---|
get_ui_hierarchy |
Complete UI element tree | device_id |
find_elements_by_text |
Find by text content | text |
find_elements_by_id |
Find by resource ID | id |
tap_element_by_text |
Smart tap by text | text |
tap_element_by_id |
Smart tap by ID | id |
wait_for_element |
Wait for elements | text, timeout |
scroll_to_find |
Scroll and search | text, max_scrolls |
clear_text |
Clear text fields | device_id |
press_key |
Hardware keys | key or keycode |
press_back |
Back button | device_id |
press_home |
Home button | device_id |
launch_app |
Launch applications | package_name |
Comprehensive system analysis and debugging.
| Tool | Description | Key Parameters |
|---|---|---|
get_current_activity |
Current running activity | device_id |
list_packages |
List installed packages | system_apps, third_party |
get_package_info |
Package information | package_name |
get_logcat |
Basic device logs | device_id |
get_running_processes |
Running processes | device_id |
// List all connected devices
{
"name": "list_devices",
"arguments": {}
}
// Capture screenshot
{
"name": "screenshot",
"arguments": {
"device_id": "emulator-5554"
}
}
// Smart element interaction
{
"name": "tap_element_by_text",
"arguments": {
"device_id": "emulator-5554",
"text": "Sign In"
}
}// Screen recording
{
"name": "screen_record",
"arguments": {
"device_id": "emulator-5554",
"duration": 30,
"bit_rate": 8
}
}
// Execute shell commands
{
"name": "execute_shell",
"arguments": {
"device_id": "emulator-5554",
"command": "pm list packages -3",
"timeout": 30
}
}
// Advanced logging
{
"name": "advanced_logcat",
"arguments": {
"device_id": "emulator-5554",
"priority": "E",
"lines": 500,
"buffer": "main"
}
}Create moonbeam-config.json:
{
"server": {
"name": "moonbeam",
"version": "1.0.0",
"timeout": "30s",
"max_devices": 10
},
"device": {
"discovery_interval": "30s",
"health_check_interval": "10s",
"default_timeout": "30s",
"max_retries": 3
},
"logging": {
"level": "info",
"format": "text",
"enable_adb_logs": false
}
}MOONBEAM_LOG_LEVEL- Log level (debug, info, warn, error)MOONBEAM_LOG_FORMAT- Log format (text, json)MOONBEAM_CONFIG_PATH- Path to configuration file
Add to your claude_desktop_config.json:
{
"mcpServers": {
"moonbeam": {
"command": "/path/to/moonbeam",
"args": ["-config", "/path/to/moonbeam-config.json"]
}
}
}Connect using stdio transport:
import subprocess
import json
# Start moonbeam server
process = subprocess.Popen(
["/path/to/moonbeam"],
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
text=True
)
# Send MCP requests to process.stdin
# Read MCP responses from process.stdout# Build for current platform
go build -o moonbeam ./cmd/moonbeam
# Build for all platforms
GOOS=windows GOARCH=amd64 go build -o moonbeam-windows-amd64.exe ./cmd/moonbeam
GOOS=linux GOARCH=amd64 go build -o moonbeam-linux-amd64 ./cmd/moonbeam
GOOS=darwin GOARCH=amd64 go build -o moonbeam-darwin-amd64 ./cmd/moonbeam# Run compilation tests
go build -v ./...
# Test ADB connectivity
adb devices
# Test tool functionality
./moonbeam -debug# Restart ADB server
adb kill-server && adb start-server
# Check device authorization
adb devices
# Enable USB debugging on device:
# Settings > Developer Options > USB Debugging- Verify USB debugging is enabled
- Accept debugging authorization on device
- Check USB cable and connection
- Try
adb devicesto verify device visibility
# On Linux, add user to plugdev group
sudo usermod -a -G plugdev $USER
# Or run with appropriate permissions
sudo ./moonbeammoonbeam/
βββ cmd/moonbeam/ # Main application entry point
βββ internal/
β βββ config/ # Configuration management
β βββ device/ # Device abstraction and automation
β βββ mcp/ # MCP server implementation with all tools
βββ docs/ # Comprehensive documentation
β βββ moonbeam-android-automation-features.md
β βββ mcp-tool-schema-specification.md
β βββ mcp-comprehensive-tool-guide.md
β βββ mcp-tool-enhancement-summary.md
βββ README.md # This file
- ADB Authentication: Requires authorized ADB debugging
- Input Validation: Comprehensive parameter validation for all tools
- Timeout Controls: Configurable timeouts prevent hanging operations
- Permission Management: Proper Android permission handling
- Secure Transport: MCP-compliant transport security
- Concurrent Operations: Multi-device support with connection pooling
- Error Resilience: Comprehensive error handling and recovery
- Resource Management: Efficient memory usage with proper cleanup
- Type Safety: Strong typing with Go structs and JSON schemas
- Production Ready: Zero compilation errors, tested implementation
- Fork the repository
- Create feature branch:
git checkout -b feature/amazing-feature - Commit changes:
git commit -m 'Add amazing feature' - Push to branch:
git push origin feature/amazing-feature - Open Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Model Context Protocol for the standardized AI integration framework
- Android Debug Bridge for device communication
- Go MCP SDK for MCP implementation
π Ready for production deployment and MCP client integration!
For complete documentation and implementation details, see the π± Complete Feature Guide.