Skip to main content
Glama
HyperOS Doctor MCP

HyperOS Doctor MCP

by leaves-body

HyperOS Doctor MCP

Read-only HyperOS / MIUI diagnostics over ADB, with a local CLI, privacy-minimised JSON/HTML reports, and a Model Context Protocol (MCP) server for AI agents.

中文使用指南:docs/usage-zh.md · Compatibility · Security

Status: alpha. The parsers, rules, CLI and MCP tool registration are covered by automated tests. Physical-device compatibility and end-to-end MCP-host testing are still pending. Do not interpret a finding as proof of a hardware fault.

What it does

HyperOS Doctor turns a small set of fixed, read-only ADB queries into evidence that an AI agent or a person can inspect:

  • Device manufacturer, model, Android and HyperOS/MIUI version fields.

  • NFC setting and service state.

  • Battery level, reported health, charging state and snapshot temperature.

  • /data storage usage.

  • An optional one-shot top process snapshot.

  • Transparent findings with severity, evidence, safe next steps and limitations.

It is designed for Xiaomi, Redmi and POCO troubleshooting workflows, not as another general-purpose Android remote-control server.

Related MCP server: adbmcp

Safety and privacy

  • No Root required. No writes. No settings changes, package operations, process killing, reboot, flashing or arbitrary shell tool.

  • Only allow-listed build properties and the battery / nfc dumpsys services are exposed.

  • Report serial numbers are masked, including partial-read failure warnings.

  • HTML reports are self-contained: no external scripts, fonts, trackers or network requests.

  • Output files are not overwritten unless --force is explicit.

  • hyperos_list_devices returns unmasked serials for device selection; do not publish that result.

See SECURITY.md before sharing a report.

Install

Requirements: Python 3.10+ and Android Platform Tools. The base CLI has no third-party Python runtime dependencies.

From a source checkout:

python -m pip install -e .
# Add MCP support:
python -m pip install -e ".[mcp]"

Enable USB debugging on your phone, connect it, unlock it and accept the USB-debugging authorization prompt. Verify the local connection:

adb devices
hyperos-doctor devices

If adb is not on PATH, pass its full path before the subcommand:

hyperos-doctor --adb "C:\platform-tools\adb.exe" devices

CLI usage

# Human-readable summary in the terminal
hyperos-doctor scan

# Save shareable reports; existing files are protected
hyperos-doctor scan --output report.html --json-output report.json

# Select one of several devices
hyperos-doctor scan --serial DEVICE_SERIAL --output report.html

# Skip the one-shot process list
hyperos-doctor scan --no-processes --json

# Explicitly replace existing report files
hyperos-doctor scan --output report.html --force

A synthetic, phone-free example is included at examples/sample-report.html. Regenerate it with:

python examples/offline_demo.py

MCP server

Install the mcp extra, then register the stdio server in an MCP-compatible host:

{
  "mcpServers": {
    "hyperos-doctor": {
      "command": "hyperos-doctor",
      "args": ["mcp"]
    }
  }
}

Use the absolute path to the installed hyperos-doctor executable if the host does not inherit your shell's PATH. A custom ADB path goes before mcp:

{
  "mcpServers": {
    "hyperos-doctor": {
      "command": "hyperos-doctor",
      "args": ["--adb", "C:\\platform-tools\\adb.exe", "mcp"]
    }
  }
}

The server deliberately exposes only three tools:

Tool

Purpose

hyperos_list_devices

List ADB devices and authorization states; unmasked serials for local selection.

hyperos_get_snapshot

Return a read-only, serial-masked evidence snapshot.

hyperos_run_diagnostics

Return evidence, transparent findings, safe next steps and limitations.

The agent cannot supply an ADB command. The SDK adapter supports MCP Python SDK 1.x and 2.x. See compatibility for the exact validation boundary.

Diagnostic rules

Rules are intentionally visible in src/hyperos_doctor/diagnostics.py, rather than hidden in a prompt.

Signal

Rule outcome

NFC setting off or service not on

Warning with safe user checks

/data usage ≥ 85% / ≥ 95%

Warning / critical

Snapshot battery temperature ≥ 45°C / ≥ 50°C

Warning / critical

Battery health other than good / unknown

Warning to investigate the reported field

One process at ≥ 80% instantaneous CPU

Info only; not a sustained-load claim

Non-Xiaomi-family manufacturer

Scope note, not an error

A single snapshot cannot diagnose intermittent failures, battery capacity, motherboard faults or persistent CPU abuse. Missing fields are reported as limitations rather than silently converted into “healthy” results.

Development

python -m pip install -e ".[mcp]"
python -m unittest discover -s tests -v

Contributions are welcome, especially anonymized parser fixtures from real HyperOS/MIUI versions. Never attach full serial numbers, account identifiers, private logs or authorization tokens. See CONTRIBUTING.md.

Machine discovery

  • llms.txt gives AI tools a concise, factual project summary and validation limits.

  • server.example.json is a template for a future MCP Registry submission; replace placeholders only after the package and repository are actually published.

  • Suggested GitHub topics: mcp, mcp-server, hyperos, miui, xiaomi, redmi, poco, adb, android-diagnostics, python.

These files improve machine readability; they do not guarantee search ranking, adoption or eligibility for any third-party program.

License

MIT. Xiaomi, Redmi, POCO, HyperOS and MIUI are trademarks of their respective owners. This is an independent project and is not affiliated with or endorsed by Xiaomi.

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
      Not graded
      quality
      D
      maintenance
      Enables AI agents to inspect a connected Android device over ADB through read-only tools covering device status, installed packages, running processes, battery, and logcat output. It speaks MCP over stdio and must run on the same machine as the adb server and USB-attached device.
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables AI agents to control Android devices through the Android Debug Bridge, covering device listing, shell commands, app install/uninstall, logcat reading, screenshots, UI automation (tap/swipe/type/key events), dumpsys queries, file transfer, port forwarding, permission management, and Wi-Fi pairing. Failures are mapped to typed, actionable causes and tool calls are safety-annotated and guardrailed, with multi-device calls scoped explicitly by serial.
      35
      61 npm
      MIT
    • A
      license
      B
      quality
      B
      maintenance
      Enables AI agents to inspect and control Android devices through ADB, including shell commands, logcat, UI automation, app management, screenshots, and file transfer, even inside Termux/proot without a native adb binary.
      41
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Enables AI agents to control Android devices through ADB for screen capture, UI automation, app launching, file transfer, and allowlisted shell execution.
      11
      31 npm
      1
      Apache 2.0