We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/desamtralized/adb-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
CLAUDE.md•1.87 KiB
# CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
## Project Overview
This is an MCP (Model Context Protocol) server that provides ADB tools for Android device management, specifically focused on WiFi connections and screenshot capture. The server exposes 5 main tools through the MCP protocol for remote Android device interaction.
## Architecture
**Core Components:**
- **MCP Server**: Single-file TypeScript implementation (`src/index.ts`) using `@modelcontextprotocol/sdk`
- **Tool Handlers**: Five ADB command wrappers exposed as MCP tools
- **Transport**: Uses stdio transport for MCP communication
**Key Design Patterns:**
- Each tool maps to specific ADB commands via `child_process.exec`
- Async/await pattern with promisified exec for command execution
- Centralized error handling with MCP-specific error codes
- Tool schema validation using JSON Schema
## Development Commands
```bash
# Build the project
npm run build
# Development with watch mode
npm run dev
# Start the MCP server
npm start
# Install dependencies
npm install
```
## Tool Architecture
The MCP server exposes these tools:
1. `adb_connect_wifi` - Connect to Android device over WiFi
2. `adb_screenshot` - Capture device screenshots
3. `adb_list_devices` - List connected devices
4. `adb_disconnect` - Disconnect from WiFi device
5. `adb_device_info` - Get device information
All tools execute ADB commands via `execAsync` and return results through MCP's content format.
## Prerequisites
- ADB must be installed and available in PATH
- Android device with USB debugging enabled
- For WiFi connections: device must be on same network and have `adb tcpip 5555` run first
## Error Handling
The server uses MCP's error system with `McpError` and appropriate error codes. ADB command failures are caught and wrapped in MCP errors with descriptive messages.