Skip to main content
Glama
desamtralized

ADB Screenshot MCP Server

adb_disconnect

Disconnect from a WiFi ADB device by specifying its IP address and port to end remote Android device management sessions.

Instructions

Disconnect from a WiFi ADB device

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ip_addressYesIP address of the device to disconnect from
portNoPort number (default: 5555)5555

Implementation Reference

  • The handler for the 'adb_disconnect' tool. It destructures the input arguments (ip_address and optional port), executes the 'adb disconnect' command using execAsync, and returns a text response with the stdout.
    case "adb_disconnect": {
      const { ip_address, port = "5555" } = args as {
        ip_address: string;
        port?: string;
      };
    
      const { stdout, stderr } = await execAsync(`adb disconnect ${ip_address}:${port}`);
      
      return {
        content: [
          {
            type: "text",
            text: `Disconnected from ${ip_address}:${port}\n${stdout}`,
          },
        ],
      };
    }
  • The input schema for the 'adb_disconnect' tool, defining required ip_address and optional port with descriptions.
    {
      name: "adb_disconnect",
      description: "Disconnect from a WiFi ADB device",
      inputSchema: {
        type: "object",
        properties: {
          ip_address: {
            type: "string",
            description: "IP address of the device to disconnect from",
          },
          port: {
            type: "string",
            description: "Port number (default: 5555)",
            default: "5555",
          },
        },
        required: ["ip_address"],
      },
    },
  • src/index.ts:30-113 (registration)
    The tool is registered in the ListToolsRequestSchema handler by including it in the tools array returned.
    return {
      tools: [
        {
          name: "adb_connect_wifi",
          description: "Connect to an Android device over WiFi using ADB",
          inputSchema: {
            type: "object",
            properties: {
              ip_address: {
                type: "string",
                description: "IP address of the Android device",
              },
              port: {
                type: "string",
                description: "Port number (default: 5555)",
                default: "5555",
              },
            },
            required: ["ip_address"],
          },
        },
        {
          name: "adb_screenshot",
          description: "Take a screenshot of the connected Android device",
          inputSchema: {
            type: "object",
            properties: {
              output_path: {
                type: "string",
                description: "Local path to save the screenshot (default: screenshot.png)",
                default: "screenshot.png",
              },
              device_id: {
                type: "string",
                description: "Device ID/serial (optional, uses first device if not specified)",
              },
            },
            required: [],
          },
        },
        {
          name: "adb_list_devices",
          description: "List all connected ADB devices",
          inputSchema: {
            type: "object",
            properties: {},
            required: [],
          },
        },
        {
          name: "adb_disconnect",
          description: "Disconnect from a WiFi ADB device",
          inputSchema: {
            type: "object",
            properties: {
              ip_address: {
                type: "string",
                description: "IP address of the device to disconnect from",
              },
              port: {
                type: "string",
                description: "Port number (default: 5555)",
                default: "5555",
              },
            },
            required: ["ip_address"],
          },
        },
        {
          name: "adb_device_info",
          description: "Get information about a connected device",
          inputSchema: {
            type: "object",
            properties: {
              device_id: {
                type: "string",
                description: "Device ID/serial (optional, uses first device if not specified)",
              },
            },
            required: [],
          },
        },
      ],
    };

Latest Blog Posts

MCP directory API

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