Sponsored by Deepsite.site

ADB MCP Server

Created By
srmorete8 months ago
An MCP (Model Context Protocol) server for interacting with Android devices through ADB in TypeScript.
Content

ADB MCP Server

An MCP (Model Context Protocol) server for interacting with Android devices through ADB. This TypeScript-based tool provides a bridge between AI models and Android device functionality.

Features

  • 📱 Device Management - List and interact with connected Android devices
  • 📦 App Installation - Deploy APK files to connected devices
  • 📋 Logging - Access device logs through logcat
  • 🔄 File Transfer - Push and pull files between device and host
  • 📸 UI Interaction - Capture screenshots and analyze UI hierarchy
  • 🔧 Shell Command Execution - Run custom commands on the device

Prerequisites

  • Node.js (v16 or higher recommended, tested with Node.js v16, v18, and v20)
  • ADB (Android Debug Bridge) installed and in your PATH
  • An Android device or emulator connected via USB or network with USB debugging enabled
  • Permission to access the device (accepted debugging authorization on device)

Installation

# Clone the repository
git clone https://github.com/srmorete/adb-mcp.git
cd adb-mcp

# Install dependencies
npm install

# Build the TypeScript code
npm run build

# Run the server
npx adb-mcp

Configuration

ADB Path Configuration

The server uses default ADB paths. For custom ADB location:

export ADB_PATH=/path/to/adb
npx adb-mcp

MCP Configuration

Add the ADB MCP server configuration:

{
  "mcpServers": {
    "adb": {
      "command": "npx",
      "args": [
        "adb-mcp"
      ]
    }
  }
}

Usage

Starting the Server

IMPORTANT: The server must be running before using any ADB tools.

Start the server using:

npx adb-mcp

You should see:

[INFO] ADB MCP Server connected and ready

Keep this terminal window open while using the ADB tools.

Available Tools

All tools are available with the following naming convention:

📱 Device Management

  • adb_devices - List connected devices
  • adb_shell - Execute shell commands on a device

📦 App Management

  • adb_install - Install an APK file using a local file path

📋 Logging

  • adb_logcat - View device logs with optional filtering

🔄 File Transfer

  • adb_pull - Pull files from a device
  • adb_push - Push files to a device

🔍 UI Interaction

  • dump_image - Take a screenshot of the current screen
  • inspect_ui - Get UI hierarchy in XML format (most useful for AI interaction)

Troubleshooting

If tools aren't working:

  • Server Issues:

    • Ensure the server is running (npx adb-mcp)
    • Check server output for error messages
    • Try detailed logs: LOG_LEVEL=3 npx adb-mcp
    • Kill hanging processes:
      • ps aux | grep "adb-mcp" | grep -v grep
      • then kill -9 [PID]
  • Device Connection:

    • Verify connection with adb_devices
    • If "unauthorized", accept debugging authorization on device
    • Check USB/network connections
    • Try restarting ADB: adb kill-server && adb start-server
  • ADB Issues:

    • Verify ADB installation: adb version
  • Device Setup:

    • Use an emulator (it was built using one), for real devices maybe try this:
      • Ensure USB debugging is enabled
      • For newer Android versions, enable "USB debugging (Security settings)"
      • Try different USB port or cable
      • or let me know in an issue

Compatibility

  • Android 8.0 and higher
  • MCP clients including Claude in Cursor IDE
  • Was built on macOS but should run on any POSIX compatible (Linux etc).
  • Did not try on Windows but maybe it works.

Contributing

  • Contributions are welcome! Submit a Pull Request.
  • For major changes, open an issue to discuss first.
  • You can, of course, also fork it
  • Note: this project was vibe-coded so if you spot some weird stuff... well now you know 🙂

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
Playwright McpPlaywright MCP server
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
ChatWiseThe second fastest AI chatbot™
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Serper MCP ServerA Serper MCP Server
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
DeepChatYour AI Partner on Desktop
Amap Maps高德地图官方 MCP Server
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
CursorThe AI Code Editor
WindsurfThe new purpose-built IDE to harness magic
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Tavily Mcp