Skip to main content
Glama
dsh-phone-buddy

dsh-phone-buddy

by sunxian-max

dsh-phone-buddy

English | 简体中文

Android device control and a banter knowledge base for DeepSeek Harness, exposed as 14 MCP tools.

Control a physical device or an emulator from the agent: screenshot, tap, swipe, long-press, key events, CJK text injection, and a one-shot "type → send → verify" flow. Alongside it sits a retrieval layer over four markdown knowledge files (persona card, playbook, principle notes, formula drills).

Why it exists

Two problems this solves, both found the hard way:

  1. adb shell input text cannot type Chinese. It throws NullPointerException: Attempt to get length of null array for any non-ASCII input. The only reliable channel is an ADBKeyboard broadcast with base64 payload — this plugin wraps that.

  2. Chat platforms silently rewrite content. A blocked message becomes a row of asterisks, and the recall window is often two minutes. The send tool therefore returns a screenshot and tells you to look at it immediately, because the server has no OCR and cannot judge on your behalf.

Related MCP server: Phone MCP

Tools

Device (10)

Tool

Purpose

phone_status

Active device, kind (physical/emulator), foreground window, IME, resolution

phone_devices

List every adb device, flagged emulator or physical

phone_use

Switch the active device

phone_shot

Screenshot to a local PNG; returns path, serial, and real resolution

phone_tap

Tap a coordinate

phone_swipe

Swipe between two points

phone_long_press

Long-press (message menus)

phone_key

Key event (4=back 3=home 26=power 82=unlock)

phone_type

Inject text into the focused input (any Unicode)

phone_send

Tap input → inject → tap send → screenshot, in one call

Knowledge (4)

Tool

Purpose

banter_quick

Cheat sheet: filter-safe patterns, formulas, recall flow, hard rules

banter_personas

List persona cards

banter_search

Keyword search across the knowledge files

banter_read

Read one file, or one persona card

Requirements

Dependency

Required

Note

Node.js

yes

Bundled with DSH

adb

yes

platform-tools

ADBKeyboard IME

yes

the only path for CJK input

Device or emulator

yes

USB debugging, or adb connect

root

no

screenshot/tap/type all work with plain shell

Physical device vs emulator

Leave DEVICE_SERIAL unset and the plugin picks the first online device — both kinds work.

Physical

Emulator

Serial

USB serial

emulator-5554 or 127.0.0.1:7555

Connect

USB + authorize on device

adb connect <ip:port> first

Common ports

—

LDPlayer 5555 / MuMu 7555 / Nox 62001 / MEmu 21503

Detection

emulator: false

emulator: true

phone_shot returns the actual resolution and a conversion hint, because the image preview in most viewers is scaled.

Install

npm i -g dsh-phone-buddy
# or inside a DSH profile
dsh plugin add dsh-phone-buddy

The postinstall step mirrors server.mjs and knowledge/ into <DSH_HOME>/plugins/phone-buddy/ and keeps any persona files you already wrote. Restart DSH afterwards.

Then enable the IME once per device:

adb install ADBKeyboard.apk
adb shell ime enable com.android.adbkeyboard/.AdbIME

Configuration

Env

Default

Meaning

ADB_PATH

adb

Absolute path to the adb binary

DEVICE_SERIAL

empty

Pin one device; empty = auto-pick first online

ADB_KB_IME

com.android.adbkeyboard/.AdbIME

ADBKeyboard IME id

PHONE_SHOT_DIR

<tmp>/phone-buddy

Screenshot output directory

PERSONA_NAME

first non-template

Default persona card

Personas

knowledge/personas/ holds one .md per persona; the file name is the id. TEMPLATE.md is a fill-in-the-blanks starter. Change accounts by adding a card — nothing in the code assumes a particular in-game name.

Limitations

  • No OCR. phone_send returns a screenshot path; judging it is the caller's job.

  • Coordinates must be measured. Every resolution and layout differs.

  • The IME gets switched. phone_type enables ADBKeyboard when needed and does not switch back.

  • Single-device assumption in each call, though switching is supported.

License

MIT

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      C
      quality
      B
      maintenance
      Enables AI agents to control Android phones, emulators, redroid containers, iOS devices, and cloud-hosted devices through a perceive-act-verify loop of screen reading, taps, gestures, typing, and app launching. Exposes 138 tools for driving screens, elements, and files over adb, Portal APIs, and ios-portal without running ARM-only code on the device.
      94
      1
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents to remotely control a real Android phone over MCP with no ADB, root, or emulator, by connecting a broker server to a sideloaded APK. Exposes tools to list devices, capture screenshots, read the UI tree, open links and deep links, and perform taps, swipes, typing, and global navigation actions.
      1
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables MCP-compatible AI agents to perceive and control an Android phone through tools for screenshots, visible text and coordinates, app/screen queries, taps, swipes, text input, key events, app launching, and interrupt/resume, closing the perception-action loop.
      6
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables MCP clients to control an Android phone by reading the screen, taking screenshots, tapping, typing, swiping, opening apps, and running multi-step tasks. It also supports on-device Android app testing and optional adb commands.
      1,381 npm
      2
      MIT