001_workspace

A project rulebook for DroidMind, a system that lets AI assistants control and inspect Android devices through the Model Context Protocol (MCP). It describes the main components, technologies, and security boundaries.

In plain words
What is it for?
Use it when working on DroidMind's MCP server, Android Debug Bridge (ADB) wrapper, device tools and resources, asynchronous operations, transports, or security layer.
Why use it?
It gives agents a shared understanding of how Android device control, debugging, file access, networking, and authentication fit together. This reduces changes that conflict with the project's architecture or safety checks.

Cursor rule for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/hyperb1iss/droidmind/001_workspace
Clone the repo
git clone --depth 1 https://github.com/hyperb1iss/droidmind

Made for: Cursor.

Per session 679 This file is loaded in full into every session.
When invoked 679 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00679 $0.00679
Opus 5 $0.00340 $0.00340
Sonnet 5 $0.00136 $0.00136
Haiku 4.5 $0.00068 $0.00068

Measured yesterday against content hash 6dda94750817, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

001_workspace scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/001_workspace.mdc · 80 lines

How it starts

The opening of the file, as written. The whole thing — 80 lines — stays where its author put it; the contents beside it link to each section on GitHub.

DroidMind Core Architecture

Project Essence

DroidMind bridges AI assistants and Android devices through the Model Context Protocol (MCP). It enables control, debugging, and system analysis of Android devices using natural language through AI interfaces like Claude and ChatGPT. The server exposes ADB capabilities as MCP resources and tools for seamless integration.

Technology Stack

  • Python 3.13+ core implementation
  • UV for project and package management
  • Ruff, MyPy, and Pylint for code style and analysis
  • MCP Protocol (v1.3.0+) for AI communication
  • ADB Shell for Android device interaction
  • Async I/O for non-blocking operations
  • Starlette/Uvicorn for SSE transport
  • Rich for beautiful terminal interfaces

Primary Components

  • MCP Protocol Layer: Implements Model Context Protocol server
    • Resource handlers for device information and file access
    • Tool implementations for device control
    • Prompt templates for common operations
  • ADB Wrapper: Secure interface to Android Debug Bridge
    • Command sanitization and execution
    • Async operation support
    • TCP/IP device connection management
  • Security Layer: Permission and authentication
    • Command validation and injection prevention
    • Risk level categorization for operations
    • Explicit confirmation for dangerous operations
  • Transport Protocols:
    • stdio for terminal/CLI usage
    • SSE (Server-Sent Events) for network/web usage

Key Directories

  • /droidmind/: Core server implementation
    • /server/: MCP server implementation
    • /adb/: ADB wrapper and command handlers
    • /resources/: MCP resource implementations
    • /tools/: MCP tool implementations
    • /security/: Input validation and permissions
    • /transport/: Communication protocols (stdio, SSE)
  • /docs/: Project documentation and examples
  • /tests/: Testing framework and test cases
  • /examples/: Example integrations with MCP clients
  • /.cursor/: Cursor AI assistance configuration

Core Constraints

  • All user input must be sanitized to prevent command injection
  • High-risk operations (system changes, flashing) require explicit confirmation
  • Respect device permission model for sensitive operations
  • Maintain clear separation between UI layer and ADB command interface
  • Follow Python type hints throughout the codebase (mypy validated)
  • Maintain test coverage for all core functionality

Read the full file on GitHub · 80 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 80 lines · 679 tokens per session scan A 6dda94750817

Subscribe to this mod's changes

001_workspace is a cursor rule published in the GitHub repository hyperb1iss/droidmind (430 stars, last pushed 7mo ago), licensed Apache-2.0. It adds 679 tokens to every session, about $0.0034 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.