npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

preflite

v2.0.2

Published

Preflight — Local mobile AI testing via MCP. AI-assisted testing on real Android/iOS/Harmony devices.

Readme

Preflight

Local MCP server for testing mobile apps on real Android, iOS, and HarmonyOS devices with AI coding assistants.

npm version License: Apache-2.0 Release

Preflight gives Claude Code, Cursor, Codex, and other MCP clients a real mobile device to inspect, operate, and test. It turns natural-language testing requests into structured visual-flow runs with live viewing, screenshots, and saved reports.

Why Preflight?

  • Test on real devices instead of mocked browser views or screenshots.
  • Let coding agents inspect screens, tap, type, swipe, wait, and assert UI state.
  • Generate visual-flow tests without fragile XPath selectors, accessibility-id assumptions, or fixed coordinates.
  • Keep the runtime local: devices, reports, configuration, and the MCP server stay on your machine.
  • Use the same workflow across Android, iOS, and HarmonyOS.

Quick Start

Install the local runtime and register the MCP server:

npx -y preflite@latest setup

This installs the packaged runtime under ~/.preflight/runtime, writes a Preflight MCP entry for Codex (~/.codex/config.toml), and writes a Cursor project entry when you run it inside a repository (.cursor/mcp.json).

Create ~/.preflight/config.json with a Midscene-compatible vision model:

{
  "env": {
    "MIDSCENE_MODEL_BASE_URL": "https://ark.cn-beijing.volces.com/api/v3",
    "MIDSCENE_MODEL_API_KEY": "sk-xxxxxxxxxxxxxxxx",
    "MIDSCENE_MODEL_NAME": "doubao-seed-2-0-lite-260215",
    "MIDSCENE_MODEL_FAMILY": "doubao-seed",
    "MIDSCENE_MODEL_REASONING_ENABLED": "false"
  }
}

Restart your AI coding assistant, then ask it to use Preflight:

Check my connected devices and run a smoke test on the app.

What You Can Ask

Once the MCP server is available, your coding agent can work with real devices through requests like:

  • "List my connected Android and iOS devices."
  • "Open the app and verify the login flow."
  • "Explore the settings screen and turn it into a visual-flow test."
  • "Install this APK and run a smoke test."
  • "Run the flow, watch it live, and save the report."

Requirements

| Dependency | Required for | Notes | |-----------|-------------|-------| | Node.js >= 20.11 | All platforms | Install via nvm or nodejs.org. | | AI model API key | All platforms | Any Midscene-compatible vision model. | | adb | Android | Ships with Android SDK platform-tools. Ensure adb is on your PATH, or set ADB_BINARY_PATH. | | Xcode + iproxy | iOS | Xcode from the Mac App Store. iproxy ships with brew install libimobiledevice. | | WebDriverAgent | iOS | Build and deploy WebDriverAgent to your device, then set WDA_PROJECT_ROOT. | | hdc | HarmonyOS | Ships with DevEco Studio. Ensure hdc is on your PATH. |

Model Configuration

Preflight loads model configuration from ~/.preflight/config.json, ~/.preflight/config.yaml, or ~/.preflight/config.yml. You can also rely on standard provider environment variables such as OPENAI_API_KEY or ANTHROPIC_API_KEY.

| Provider | MIDSCENE_MODEL_BASE_URL | Example MIDSCENE_MODEL_NAME | |----------|--------------------------|-------------------------------| | OpenAI | https://api.openai.com/v1 | gpt-4o | | Anthropic | https://api.anthropic.com/v1 | claude-sonnet-4-20250514 | | Doubao / Volcengine | https://ark.cn-beijing.volces.com/api/v3 | doubao-seed-2-0-lite-260215 |

iOS Setup

iOS testing requires WebDriverAgent running on your device:

git clone https://github.com/facebook/WebDriverAgent.git
cd WebDriverAgent
./Scripts/bootstrap.sh
open WebDriverAgent.xcodeproj

Build the WebDriverAgentRunner scheme targeting your device. Then add the project path to ~/.preflight/config.json:

{
  "env": {
    "WDA_PROJECT_ROOT": "/path/to/WebDriverAgent",
    "WDA_SCHEME": "WebDriverAgentRunner"
  }
}

How It Works

Preflight connects your AI assistant to local device automation through MCP. The assistant does not need to write platform-specific automation scripts; it asks Preflight for device state, explores screens, validates visual-flow JSON, and runs the flow through the local runtime.

flowchart LR
    subgraph AI["AI Coding Assistant"]
        MCP["MCP Client"]
    end

    subgraph Preflight["Preflight MCP Server"]
        EXP["Exploration Tools"]
        IR["Visual Flow IR"]
        AGENT["Local Runtime"]
    end

    subgraph Midscene["Midscene SDK"]
        MS["Vision Agent"]
    end

    subgraph Device["Real Device"]
        SCREEN["Screen and UI Tree"]
    end

    AI <-->|stdio| MCP
    MCP --> EXP
    MCP --> IR
    EXP --> AGENT
    IR --> AGENT
    AGENT --> MS
    MS <-->|adb / WDA / hdc| Device
    SCREEN -.->|screenshots| MS

The main pieces are:

  1. Exploration tools help the assistant understand the current screen and choose what to test.
  2. Visual Flow IR captures a test as structured JSON with steps, assertions, and app context.
  3. Midscene SDK converts high-level visual instructions into device actions such as tap, type, swipe, wait, and assert.

MCP Tools

| Category | Tools | |----------|-------| | Agent | agent_health · start_agent · stop_agent · doctor · config_status | | Device | list_devices · install_app | | Exploration | exploration_start · exploration_end · exploration_get_page_summary · exploration_ai_act · exploration_ask_about_screen · exploration_screenshot · exploration_type · exploration_wait | | Visual Flow | get_visual_flow_ir_rules · validate_visual_flow · run_flow · watch_run · cancel_run · save_report · read_report |

Reports

Runs write report assets under:

~/.preflight/midscene_run/report/<reportName>/

A report can include the HTML summary, execution JSON, screenshots, and compressed recordings when the platform recorder and ffmpeg are available.

Development

Clone the repository when you want to work on Preflight itself:

git clone https://github.com/zifengjiang/Preflight.git
cd Preflight
npm install
npm test
npm run check
npm run build

Register the local development MCP server:

npm run mcp:setup

Release

Releases are triggered by version tags:

git tag v1.1.1
git push origin v1.1.1

The release workflow publishes the npm package and creates a GitHub Release.

License

Apache 2.0