scrcpy-mcp: Instructions file for Codex

AGENTS.md

scrcpy-mcp AGENTS.md is an instructions file for Codex, OpenCode from JuanCF/scrcpy-mcp. It costs 1,841 tokens per session, scanned A, original, MIT.

Project instructions for scrcpy-mcp, an MCP server that lets coding agents view and control Android devices through ADB and scrcpy. It describes the project layout and its build, lint, type-checking, and test commands.

In plain words
What is it for?
Use it when developing scrcpy-mcp, reviewing its source, running the server, checking code quality, or running unit and integration tests.
Why use it?
It gives an agent the project context needed to change the code safely and check whether changes work. It also provides the commands needed to run and inspect the server.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: mentions AGENTS.md.

This is JuanCF/scrcpy-mcp's own configuration. It tells Codex and OpenCode how to work on scrcpy-mcp itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything scrcpy-mcp configures →

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is import { execAdbShell, resolveSerial } from "../utils/adb.js";.

Reuse

Borrowing it

Nothing to install: this file belongs to JuanCF/scrcpy-mcp. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/JuanCF/scrcpy-mcp/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/JuanCF/scrcpy-mcp

Made for: Codex, OpenCode.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for scrcpy-mcp AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/juancf/scrcpy-mcp/agents-md/github.svg)](https://agentmods.dev/instructions/juancf/scrcpy-mcp/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/juancf/scrcpy-mcp/agents-md"><img src="https://agentmods.dev/badge/instructions/juancf/scrcpy-mcp/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for scrcpy-mcp AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/juancf/scrcpy-mcp/agents-md"><img src="https://agentmods.dev/badge/instructions/juancf/scrcpy-mcp/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,841 This file is loaded in full into every session.
When invoked 1,841 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.01841 $0.01841
Opus 5.5 $0.00736 $0.00736
Sonnet 5.5 $0.00368 $0.00368
Haiku 4.5 $0.00184 $0.00184

Measured 1mo ago against content hash 75d691e52afd, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

scrcpy-mcp AGENTS.md 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 1mo ago.

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.

AGENTS.md · 230 lines

How it starts

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

AGENTS.md

Guidelines for AI coding agents working on scrcpy-mcp.

Project Overview

scrcpy-mcp is a Model Context Protocol (MCP) server that provides AI agents with vision and control over Android devices via ADB and scrcpy. It exposes tools for device management, input, screenshots, and more.

Project Documentation

Build/Lint/Test Commands

# Build the project
npm run build

# Development mode (run directly with tsx)
npm run dev

# Run the built server
npm start

# Run MCP Inspector for testing
npm run inspect

# Lint check
npm run lint

# Lint with auto-fix
npm run lint:fix

# Type check
npx tsc --noEmit

# Run all tests
npm run test

# Run integration tests only
npm run test:integration

# Run a single test file
npx vitest run tests/example.test.ts

# Run tests matching a pattern
npx vitest run --testNamePattern "device"

Project Structure

src/
├── index.ts           # Entry point, server setup, tool registration
├── utils/
│   ├── adb.ts         # ADB utility functions (exec, device detection, etc.)
│   ├── audio.ts       # Audio hub, playback sink, recording/clip encoder sinks
│   ├── ffmpeg.ts      # ffmpeg/ffplay binary resolution
│   ├── scrcpy.ts      # scrcpy session lifecycle, control protocol, video decode
│   ├── mjpeg.ts       # HTTP MJPEG server and ffplay viewer launcher
│   └── constants.ts   # Shared constants (protocol types, env vars, keycodes)
└── tools/
    ├── apps.ts        # App management (start, stop, install, uninstall, list, current)
    ├── audio.ts       # Audio streaming, recording, and clip capture tools
    ├── clipboard.ts   # Clipboard get/set (scrcpy + ADB fallback)
    ├── device.ts      # Device management (list, info, screen, panels, rotation, WiFi)
    ├── files.ts       # File push/pull/list
    ├── input.ts       # Touch/keyboard/scroll input (scrcpy + ADB fallback)
    ├── session.ts     # scrcpy session start/stop
    ├── shell.ts       # Arbitrary ADB shell command execution
    ├── ui.ts          # UI hierarchy dump and element finder
    ├── video.ts       # MJPEG video stream start/stop
    └── vision.ts      # Screenshot and recording

Read the full file on GitHub · 230 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. 1mo ago Changed · +1 lines · +29 tokens per session 75d691e52afd
  2. 1mo ago Changed · +5 lines · +119 tokens per session f2669494c577
  3. 2mo ago First seen · 224 lines · 1,693 tokens per session scan A 36c6e076c1bf

Subscribe to this mod's changes

scrcpy-mcp AGENTS.md is an instructions file published in the GitHub repository JuanCF/scrcpy-mcp (131 stars, last pushed 1mo ago), licensed MIT. It adds 1,841 tokens to every session, about $0.0074 per session on Opus 5.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.

Related

scrcpy-mcp AGENTS.md compared with instructions from other repositories

scrcpy-mcp AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
scrcpy-mcp AGENTS.mdJuanCF/scrcpy-mcpInstructions file1311mo agoMITA1,841Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA9,719GitHub Copilot
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA5,516GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143kyesterdayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149ktodayMITA4,680Codex, OpenCode
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA3,093GitHub Copilot
vscode model-prompts.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA2,022GitHub Copilot