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

@donghao1980/autogo-mcp

v0.3.6

Published

MCP server for AutoGo and ADB workflows - 40 tools for Android/iOS automation

Readme

AutoGo MCP

AutoGo MCP 是一个基于 stdio 的 MCP Server,将 AutoGo SDK 的强大功能暴露给支持 MCP 的客户端,提供完整的 Android/iOS 自动化能力。

✨ 功能特性

🔧 项目管理

  • run_project - 运行 AutoGo 项目到指定设备,支持调试模式
  • stop_project - 停止设备上的 AutoGo 项目
  • sync_files - 同步项目中的 so 和 assets 到设备

📱 设备管理

  • list_devices - 列出当前可见的 ADB 设备
  • connect_device - 连接远程 ADB 设备
  • adb_command - 执行自定义 ADB 命令

📲 应用管理

  • app_current_package - 获取当前页面的应用包名
  • app_current_activity - 获取当前页面的 Activity 名称
  • app_launch - 启动应用,支持"包名/类名"格式
  • app_get_list - 获取手机中所有应用列表
  • app_get_name - 获取应用名称
  • app_get_version - 获取应用版本号
  • app_is_installed - 判断应用是否已安装
  • app_install - 安装应用(支持 APK/XAPK)
  • app_uninstall - 卸载应用
  • app_force_stop - 强制停止应用

🖼️ 图色操作

  • capture_screen - 截取设备屏幕,支持保存到设备或下载到本地
  • get_pixel_color - 获取指定坐标的像素颜色值
  • find_color - 在屏幕上查找指定颜色的位置
  • compare_color - 比较指定位置的颜色是否匹配
  • find_multi_colors - 多点找色,精确定位目标
  • compare_multi_colors - 多点比色,验证位置颜色
  • find_multi_colors_all - 查找所有匹配的多点颜色位置

📝 OCR 文字识别

  • ocr_screen - 对整个屏幕进行 OCR 文字识别
  • ocr_region - 对屏幕指定区域进行 OCR 文字识别
  • ocr_image - 对设备上的图片文件进行 OCR 文字识别
  • ocr_detect - 检测屏幕上的文字区域位置
  • ocr_detect_region - 检测指定区域内的文字位置
  • ocr_find_text - 在屏幕上查找指定文字的位置

🎯 YOLO 目标检测

  • yolo_detect - 对整个屏幕进行目标检测
  • yolo_detect_region - 对屏幕指定区域进行目标检测
  • yolo_detect_image - 对设备上的图片文件进行目标检测
  • yolo_find_object - 在屏幕上查找指定类别的目标
  • yolo_count_objects - 统计屏幕上各类目标的数量

🖼️ OpenCV 图像处理

  • opencv_match_template - 模板匹配查找图片

🎬 Motion 运动检测

当前版本暂未启用,后续版本开放。

📋 UI 节点操作

  • get_screen_nodes - 抓取当前屏幕节点树并按条件过滤

📊 日志管理

  • read_project_logs - 读取运行会话的增量日志

📦 环境要求

  • Node.js 18 及以上
  • AutoGo SDK
  • ADB(可选;如果 PATH 中没有,需要显式指定)

🚀 安装与使用

推荐直接通过 npx 启动:

npx -y @donghao1980/autogo-mcp

⚙️ 环境变量

| 变量名 | 说明 | 默认值 | |--------|------|--------| | AUTOGO_AG_PATH | AutoGo SDK 路径 | Windows: C:\Users\Public\ag.exemacOS: /Users/Shared/ag | | AUTOGO_ADB_PATH | ADB 可执行文件路径 | - | | AUTOGO_DEFAULT_DEVICE | 默认设备序列号或 ip:port | - | | AUTOGO_PROJECT_PATH | AutoGo 项目根目录(可选,支持自动检测) | - |

🔄 自动检测项目目录

MCP 会自动从当前工作目录向上查找 AutoGo 项目目录(检测 main.go 中是否包含 github.com/Dasongzi1366/AutoGoautogo.cc)。

优先级

  1. 显式传入的 projectPath 参数
  2. 环境变量 AUTOGO_PROJECT_PATH
  3. 自动检测当前目录及父目录

🔌 MCP 客户端配置

最简配置

{
  "mcpServers": {
    "autogo": {
      "command": "npx",
      "args": ["-y", "@donghao1980/autogo-mcp"]
    }
  }
}

推荐配置

{
  "mcpServers": {
    "autogo": {
      "command": "npx",
      "args": ["-y", "@donghao1980/autogo-mcp"],
      "env": {
        "AUTOGO_AG_PATH": "C:\\Users\\Public\\ag.exe",
        "AUTOGO_ADB_PATH": "C:\\Android\\platform-tools\\adb.exe",
        "AUTOGO_DEFAULT_DEVICE": "192.168.1.100:5555"
      }
    }
  }
}

macOS 示例

{
  "mcpServers": {
    "autogo": {
      "command": "npx",
      "args": ["-y", "@donghao1980/autogo-mcp"],
      "env": {
        "AUTOGO_AG_PATH": "/Users/Shared/ag",
        "AUTOGO_ADB_PATH": "/opt/homebrew/bin/adb",
        "AUTOGO_DEFAULT_DEVICE": "emulator-5554"
      }
    }
  }
}

📖 使用示例

应用管理

// 获取当前应用包名
{}

// 启动应用
{
  "packageName": "com.tencent.mm"
}

// 启动指定 Activity
{
  "packageName": "com.tencent.mm/.ui.LauncherUI"
}

// 安装应用
{
  "path": "/sdcard/app.apk"
}

// 强制停止应用
{
  "packageName": "com.tencent.mm"
}

图色操作

// 截图
{
  "remotePath": "/sdcard/screenshot.png",
  "localPath": "C:\\screenshots\\screen.png"
}

// 找色
{
  "color": "#FF0000",
  "region": [100, 200, 300, 400],
  "threshold": 4
}

// 多点找色
{
  "firstColor": "#f64d30",
  "colors": [[5, 5, "#ffffff"], [10, 10, "#000000"]],
  "threshold": 4
}

OCR 文字识别

// 全屏 OCR
{}

// 区域 OCR
{
  "x": 100,
  "y": 200,
  "width": 300,
  "height": 100
}

// 查找文字
{
  "text": "登录",
  "confidence": 0.8
}

YOLO 目标检测

// 全屏检测
{
  "confidence": 0.5,
  "iou": 0.45
}

// 查找特定目标
{
  "className": "person",
  "confidence": 0.6
}

OpenCV 图像处理

// 模板匹配
{
  "templatePath": "/sdcard/template.png",
  "threshold": 0.8
}

Motion 运动检测

当前版本暂未启用,后续版本开放。

UI 节点操作

// 获取所有可点击节点
{
  "clickable": true
}

// 按文本查找节点
{
  "text": "确定"
}

// 按 ID 查找节点
{
  "id": "com.example.app:id/button"
}

🛠️ 本地开发

# 安装依赖
npm install

# 类型检查
npm run check

# 编译
npm run build

# 运行
npm start

📁 项目结构

AutoGo-mcp-main/
├── src/
│   ├── tools/
│   │   ├── projectTools.ts    # 项目管理工具
│   │   ├── adbTools.ts        # ADB 设备工具
│   │   ├── appTools.ts        # 应用管理工具
│   │   ├── uiTools.ts         # UI 节点工具
│   │   ├── screenshotTools.ts # 图色操作工具
│   │   ├── ocrTools.ts        # OCR 文字识别工具
│   │   ├── yoloTools.ts       # YOLO 目标检测工具
│   │   ├── opencvTools.ts     # OpenCV 图像处理工具
│   │   ├── motionTools.ts     # Motion 运动检测工具
│   │   └── sessionTools.ts    # 日志管理工具
│   ├── lib/
│   │   ├── config.ts          # 配置管理(含自动检测项目目录)
│   │   ├── command.ts         # 命令执行
│   │   ├── device.ts          # 设备管理
│   │   ├── mcp.ts             # MCP 工具定义
│   │   └── sessionStore.ts    # 会话存储
│   └── server.ts              # MCP 服务器入口
├── package.json
├── tsconfig.json
└── README.md

📊 工具统计

| 模块 | 工具数量 | 功能描述 | |------|----------|----------| | Project | 3 | 项目运行、停止、同步 | | Session | 1 | 日志读取 | | ADB | 2 | 设备列表、命令执行 | | App | 10 | 应用管理、启动、安装等 | | UI | 1 | 屏幕节点获取 | | Screenshot | 7 | 截图、找色、比色 | | OCR | 6 | 文字识别、检测 | | YOLO | 5 | 目标检测 | | OpenCV | 1 | 模板匹配 | | 总计 | 36 | - |

🔗 相关链接

📄 License

MIT