Repository: https://github.com/tintupratap/Android-MCP-go
Author: Ranapratap (tintupratap@gmail.com)
Android-MCP-go acts as a high-privilege bridge between AI agents (via standard stdio JSON-RPC 2.0) and physical Android hardware (via ADB). This document details our security boundaries, archive extraction validation, command execution rules, and data privacy safeguards.
┌───────────────────────────┐ stdio (JSON-RPC 2.0) ┌───────────────────────────┐
│ AI Agent │ ──────────────────────────────────> │ Android-MCP-go │
│ (Claude / Cursor / IDE) │ <────────────────────────────────── │ (Host Boundary) │
└───────────────────────────┘ └─────────────┬─────────────┘
│ Managed ADB
▼
┌───────────────────────────┐
│ Android Device │
│ (SELinux Sandbox Boundary)│
└───────────────────────────┘
- Platform-Tools: Downloaded exclusively from official Google HTTPS endpoints (
https://dl.google.com/android/repository/platform-tools-latest-*.zip). - Managed
scrcpy: Downloaded exclusively from official GitHub Releases (https://github.com/Genymobile/scrcpy). - Integrity Verification: SHA-256 digests are calculated and checked against published release checksum assets before extraction.
Archive extraction routines (extractZipSecurely & extractTarGzSecurely) inspect every header entry path before extraction to guarantee entries cannot traverse outside extraction target directories:
filePath := filepath.Join(destDir, header.Name)
if !strings.HasPrefix(filepath.Clean(filePath), filepath.Clean(destDir)) {
return fmt.Errorf("Zip/Tar Slip path traversal attempt detected: %s", header.Name)
}Android-MCP-go NEVER invokes sh -c, cmd /c, or raw shell string evaluation. All commands use exec.CommandContext(ctx, binary, args...) with explicit, unescaped string slices to prevent command injection.
Real-time desktop notifications under --debug automatically redact sensitive parameters (passwords, OTPs, authentication tokens, secret keys) before sending system alerts.
Persistent state updates to ~/.android-mcp/android-mcp.json are written to temporary files (android-mcp.json.tmp.*) and flushed before performing atomic filesystem renames, preventing partial state corruption.
Please report security issues directly to author Ranapratap at tintupratap@gmail.com. Reports will receive initial response within 24 hours.