Clipboard tool¶
✅ Implemented 🧪 Tested
Current state:
clipboardMCP tool is fully implemented. On API 35,cmd clipboardreturns “No shell command implementation”, so the implementation routes through the AutoMobile Accessibility Service. See the Status Glossary for chip definitions.
Goal¶
Provide clipboard copy/paste/clear/get for Android 29/35 emulators and best-effort support on devices.
MCP tool¶
clipboard({
action: "copy" | "paste" | "clear" | "get",
text?: string
})
Android implementation¶
Primary path (API 29/35 if supported):
adb -s <device> shell cmd clipboard set "<text>"adb -s <device> shell cmd clipboard getadb -s <device> shell cmd clipboard clear
Capability probe:
adb -s <device> shell cmd clipboard help
Fallback path (helper APK):
- Helper app exposes a broadcast receiver or bound service to set/read
the clipboard via
ClipboardManager. - AutoMobile reads results via file or socket for
get.
Notes:
- Newer Android versions restrict clipboard reads for background apps. The helper should run in the foreground when possible.
ADB validation (API 35)¶
Status:
- API 29 not validated yet (no local AVD available).
Attempted commands:
adb -s <device> shell cmd clipboard set "Hello AutoMobile"adb -s <device> shell cmd clipboard getadb -s <device> shell cmd clipboard clearadb -s <device> shell cmd clipboard get
Observed results:
cmd clipboardreturns “No shell command implementation” on API 35.dumpsys clipboardreturns empty output.
Notes:
- ADB-only clipboard manipulation appears unsupported on this emulator/API level; a helper APK fallback is likely required.
Plan¶
- Implement adb
cmd clipboardsupport with capability detection. - Add helper APK fallback for consistent behavior.
Risks¶
- Clipboard reads may be blocked on physical devices without foreground UI.
- Service call clipboard APIs are unstable across OEMs.