Skip to main content
Glama
NOTE

Built for real exam prep alongside Study-OS. Works with Samsung Galaxy Tab, Xiaomi Pad, OnePlus Pad, Boox, and Pixel Tablet running AOSP, OneUI, HyperOS, or OxygenOS. Runs 100% locally over stdio — zero cloud relays, zero background Android agent APKs, and zero desktop cursor hijacking.


Why This Exists

General mobile-automation MCP servers are built for tapping UI buttons, not for letting an AI tutor proactively glance at your handwritten math or accounting work while you study:

Problem with raw screenshots

How pad-study-mcp solves it

Privacy leaks — a floating chat bubble, split-screen banking app, autofill overlay, or pulled-down notification shade leaks into the model context.

Fail-closed all-window gate inspects wake/lock state and every visible Android Window #N (FLAG_SECURE, NotificationShade, BiometricPrompt, split-screen, PiP) before a single pixel is captured.

Tiny, blurry handwriting — a 3200×2136 infinite canvas is ~80% blank paper and toolbars, so vision downscaling turns - signs and exponents into mush.

Orientation-aware ink auto-crop strips toolbars, ruled lines, dark PDF gutters, and corner nav pills — zooming handwriting ~2.5× larger while cutting payload size by ~84% (~150 KB → ~24 KB).

Context bloat on follow-ups — re-sending the same full-page image on every "why?" follow-up burns vision tokens and triggers context compaction.

Status-bar-immune ETag diff (if_changed_since) skips sending image bytes (0 KB) when your canvas hasn't changed, while still catching a single minus sign or decimal edit.

Flaky wireless ADB — switching between desk USB-C and campus/couch Tailscale Wi-Fi leaves stale offline devices.

USB → Wi-Fi / Tailscale auto-reconnect prefers USB-C when plugged in, falls back to your wireless/Tailscale target automatically, and recovers stale offline sessions cleanly.


Related MCP server: mcp-android

Smart Ink Auto-Crop

  • Two-pass ruled-line suppression removes full-width notebook rules and graph grids without erasing horizontal fraction bars, minus signs, or T-account dividers.

  • Moat-checked corner pill filtering ignores floating infinite-canvas navigation pills (← ⌖ →) only when isolated by clean whitespace, so genuine writing in the top-right corner is never clipped.

  • Dark-mode & highlighter aware using ImageChops + MaxFilter(3) background-delta detection rather than naive luminance thresholding.

  • Zero-token unchanged follow-ups: every pad_peek response includes a canvas_hash computed over the cropped ink region (immune to clock ticks and battery changes); pass it back as if_changed_since on the next turn to receive {"status": "unchanged"} with 0 image bytes.


Fail-Closed Multi-Window Privacy Gate

  • Cross-OEM wake & lock parsing: handles AOSP, Samsung OneUI, Xiaomi HyperOS, and OnePlus OxygenOS dumpsys power + dumpsys window formats in a single fast ADB shell pass.

  • Every visible window checked: split-screen study apps (StarNote + Xodo PDF) are allowed together; a note app alongside a floating chat window or browser is refused (skipped_non_study_app).

  • Non-overridable hard blocks: password managers (Bitwarden, 1Password, KeePass*, Proton Pass), 2FA authenticators, banking/wallets, messaging, email, NotificationShade, BiometricPrompt, and FLAG_SECURE windows are blocked even if an agent calls allow_any_app=True (unless you explicitly opt in via PAD_STUDY_ALLOW_BLOCKED=1). See SECURITY.md.


Tools & Diagnostics

Tool

Purpose

Key Parameters

pad_peek

Privacy-checked, ink-auto-cropped canvas capture with ETag diffing.

auto_crop=True, max_size=1200, if_changed_since="", allow_any_app=False, device=""

pad_zoom

High-detail crop of a specific region in full-screen tablet coordinates (same privacy gate).

x, y, width, height, max_size=1200, allow_any_app=False, device=""

pad_status

Ultra-fast (~0.2–0.4s) health & privacy check: transport, lock state, battery, and visible apps.

device=""

Built-in CLI diagnostics (pad-study-mcp doctor): verify your ADB binary, USB/Tailscale transport, lock state, battery, visible windows, and privacy decision from the terminal in under a second:

{
  "adb": "/usr/local/bin/adb",
  "status": "ok",
  "device": "100.64.0.10:5555",
  "transport": "wireless",
  "battery_pct": 84,
  "screen_awake": true,
  "screen_locked": false,
  "visible_apps": ["StarNote"],
  "privacy_gate": "allowed"
}

How It's Built

Single-file Python 3.10+ MCP server (mcp + Pillow only) running locally over stdio — zero daemon processes, zero Android helper apps, and zero external network calls.

flowchart LR
  subgraph Tablet["Android Tablet (OneUI · HyperOS · OxygenOS · AOSP)"]
    APP["Study App(s)\nStarNote · Samsung Notes · Goodnotes · Obsidian · Saber"]
    WIN["WindowManager & PowerManager\nWake · Lock · All Windows · FLAG_SECURE"]
  end

  subgraph Transport["Encrypted Local / Mesh Transport"]
    USB["USB-C ADB\n(Preferred when plugged in)"]
    TS["Wi-Fi / Tailscale WireGuard ADB\n(Auto-reconnect + stale-offline recovery)"]
  end

  subgraph Server["pad-study-mcp (Local Python Stdio Server)"]
    GATE["1. Fail-Closed Privacy Gate\nAllowlist + Hard Blocks + Shade Check"]
    CROP["2. Smart Ink Auto-Crop\nToolbar · Ruled Line · Gutter · Pill Removal"]
    ETAG["3. High-Precision ETag Hash\nStatus-Bar-Immune Canvas Diff"]
  end

  subgraph Clients["AI Coding & Study Clients"]
    AGY["Antigravity / Codex / Claude Code / Cursor"]
    SOS["Optional: Study-OS MCP\n(Exact Exam Task + Rubric Context)"]
  end

  APP --> USB
  APP --> TS
  WIN -->|"1. Inspect before capture"| GATE
  USB --> GATE
  TS --> GATE
  GATE -->|"Refuse (0 px) if locked/blocked/unlisted"| AGY
  GATE -->|"Allowed → exec-out screencap"| CROP
  CROP --> ETAG
  ETAG -->|"~24 KB JPEG or 0 KB unchanged"| AGY
  SOS -.->|"Parallel task + handwritten check"| AGY

Quick Start

Prerequisites: Python 3.10+, adb (Android Platform-Tools), and USB debugging enabled on your Android tablet.

1-Line MCP Install (uvx)

Add pad-study to your MCP client config — works identically in Antigravity, Claude Code, Cursor, and any MCP-compatible client:

{
  "mcpServers": {
    "pad-study": {
      "command": "uvx",
      "args": ["--from", "git+https://github.com/shadjosef/pad-study-mcp", "pad-study-mcp"],
      "env": {
        "PAD_STUDY_DEVICE": "100.64.0.10:5555"
      }
    }
  }
}

(Omit PAD_STUDY_DEVICE if you only plug in over USB-C — pad-study-mcp auto-detects the attached tablet.)

codex mcp add pad-study \
  --env PAD_STUDY_DEVICE=100.64.0.10:5555 \
  -- uvx --from git+https://github.com/shadjosef/pad-study-mcp pad-study-mcp

Campus and office Wi-Fi networks typically enable AP client isolation, which blocks direct LAN connections between your laptop and tablet. Tailscale creates an encrypted peer-to-peer WireGuard tunnel between them automatically:

  1. Install Tailscale on both your computer and Android tablet (whitelist Tailscale from battery optimization on Android).

  2. Plug the tablet in via USB-C once after reboot and enable TCP ADB:

    adb tcpip 5555
    adb connect <tablet-tailscale-ip>:5555
  3. Unplug USB-C and set PAD_STUDY_DEVICE="<tablet-tailscale-ip>:5555" (or save the IP in ~/.config/pad-study-mcp/device).

  4. On untrusted public Wi-Fi, see the network hygiene notes in SECURITY.md (close port 5555 via adb -s <target> usb when done, or use USB-C).

git clone https://github.com/shadjosef/pad-study-mcp.git
cd pad-study-mcp
uv venv .venv
uv pip install --python .venv/bin/python -e ".[dev]"

# Verify ADB, lock state, visible windows, and privacy gate:
.venv/bin/pad-study-mcp doctor

# Run the full 21-test unit suite (privacy gate, auto-crop, ETag, device recovery):
.venv/bin/pytest -v

Add a short instruction to your agent's global rules (GEMINI.md, AGENTS.md, or CLAUDE.md) so you never have to say "check my tablet" manually:

Whenever I ask about math, accounting, finance, economics, statistics, or physics
— or ask "is this right?", "check this", or "next step" — proactively call
`pad_peek()` first (passing `if_changed_since="<last canvas_hash>"` on follow-up turns).
If it returns `screen_off_or_locked`, `blocked_for_privacy`, `skipped_non_study_app`,
or `offline`, silently answer my text question normally.

Supported Tablets & Study Apps

Works with any Android tablet supporting ADB (Samsung Galaxy Tab, Xiaomi Pad, OnePlus Pad, Boox, Pixel Tablet, Lenovo Tab).

Category

Built-in Allowlisted Apps

Handwriting & Infinite Canvas

StarNote, Notein, Samsung Notes, Goodnotes, Notewise, Flexcil, MyScript Notes / Nebo, Boox Notes, Squid, Touchnotes, Jnotes, Mi Canvas, Xiaomi Notes, Saber (FOSS), Butterfly (FOSS), Concepts, Krita

Knowledge, Flashcards & PDFs

Obsidian, Notion, OneNote, AnkiDroid, KOReader, Boox NeoReader, Xodo PDF, Adobe Acrobat Reader, WPS Office / Lite

Calculators

Google Calculator, AOSP Calculator, Samsung Popup Calculator, OnePlus Calculator, Xiaomi Calculator

(Need another app? Pass a comma-separated package list via PAD_STUDY_EXTRA_APPS.)


Configuration

All environment variables are optional:

Variable

Description

PAD_STUDY_ADB

Explicit path to the adb binary (otherwise auto-detected from PATH & standard Android SDK locations on macOS/Linux/Windows).

PAD_STUDY_DEVICE

Explicit USB serial or wireless <ip>:5555 target (takes priority when multiple Android devices are attached).

PAD_STUDY_IP_CACHE

File containing a cached wireless/Tailscale IP (defaults to ~/.config/pad-study-mcp/device).

PAD_STUDY_PORT

Default ADB TCP port when a bare IP is supplied (default 5555).

PAD_STUDY_EXTRA_APPS

Comma-separated extra Android package names to allowlist as study apps.

PAD_STUDY_BLOCKED_APPS

Comma-separated extra package names or *glob* patterns to always hard-block.

PAD_STUDY_ALLOW_BLOCKED

Set to 1 only if you explicitly want to permit overriding BLOCKED_PACKAGES / FLAG_SECURE (default off).


License & Security

  • License: MIT

  • Privacy & Network Security: See SECURITY.md for the fail-closed multi-window architecture, campus/public Wi-Fi ADB hygiene, and vulnerability reporting.

Available Tools

3 tools
pad_peekA

Capture the user's study tablet canvas with privacy guard, ink auto-crop, and ETag diff check.

Args: auto_crop: Crop empty infinite-canvas margins & toolbars around handwritten ink for sharper OCR. max_size: Max output image edge in pixels (clamped to 128-4096, default 1200). if_changed_since: Optional canvas_hash returned by a previous pad_peek call in this chat. If the canvas has not changed, skips sending image bytes (0 image tokens!). allow_any_app: Relaxes the study-app allowlist when the user explicitly asks to view another non-sensitive app. Never bypasses blocked sensitive apps, FLAG_SECURE, or NotificationShade. device: Optional explicit ADB serial or ip:port override.

Inputs: device, max_size, auto_crop, allow_any_app, +1 more. Returns: result

pad_statusB

Fast (~0.2-0.4s) health & privacy check of the Android study tablet (transport, lock state, visible apps, battery).

Inputs: device. Returns: result

pad_zoomB

Capture a zoomed crop of a specific region on the tablet screen (in full screen coordinates).

Inputs: x (required), y (required), width (required), height (required), +3 more. Returns: result

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 3 tools

    Disambiguation5/5

    Each tool targets a distinct operation: pad_status checks device health/privacy, pad_peek captures the full canvas, and pad_zoom captures a specific region. Their descriptions clearly delineate when to use each, with no overlapping responsibilities.

    Naming Consistency5/5

    All tools use a consistent snake_case pad_ prefix followed by a concise action verb/noun (status, peek, zoom). The pattern is predictable and easy to extend.

    Tool Count5/5

    Three tools are well-scoped for a focused tablet inspection server: health/status, full capture, and regional capture. Each tool has a clear purpose and earns its place without redundancy.

    Completeness4/5

    The surface covers status checking, full canvas capture, and zoomed inspection, which are the core lifecycle operations for a study-tablet monitoring MCP. Minor gaps exist around structured text/OCR extraction or explicit app-list retrieval, but these can be worked around via existing capture and status tools.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      B
      quality
      B
      maintenance
      Enables an AI agent to control an Android phone over a private Tailscale network via accessibility UI automation, screenshots, gestures, notifications, clipboard, intents, SAF file access, and optional Termux/Shizuku shells without root or ADB.
      65
      -
    • A
      license
      Not graded
      quality
      A
      maintenance
      Lets AI agents see and use a real Android phone over Wi-Fi: read the screen, find elements by text or ID, tap, type, swipe, take screenshots and read notifications, without ADB or root.
      564
      MIT
    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables MCP-compatible AI assistants to see and control Android devices through screenshots, taps, swipes, typing, app management, UI inspection, file transfer, shell commands, and audio/video streaming. It connects over ADB with optional low-latency acceleration for faster input and near-instant screenshots.
      801 npm
      MIT