Mobile Next MCP Server

Mobile Next MCP Server

一个模型上下文协议服务器,通过与平台无关的接口,为 iOS 和 Android 设备实现可扩展的移动自动化。它允许代理和大型语言模型 (LLM) 使用辅助功能快照或基于坐标的交互与移动应用程序进行交互。

Category
访问服务器

Tools

list_apps_on_device

List all apps on device

launch_app

Launch an app on mobile device

terminate_app

Stop and terminate an app on mobile device

get_screen_size

Get the screen size of the mobile device in pixels

click_on_screen_at_coordinates

Click on the screen at given x,y coordinates

list_elements_on_screen

List elements on screen and their coordinates, with display text or accessibility label. Do not cache this result.

press_button

Press a button on device

open_url

Open a URL in browser on device

swipe_on_screen

Swipe on the screen

type_text

Type text into the focused element

take_device_screenshot

Take a screenshot of the mobile device. Use this to understand what's on screen, if you need to press an element that is available through view hierarchy then you must list elements on screen instead. Do not cache this result.

README

Mobile Next - 用于移动自动化的 MCP 服务器

这是一个 模型上下文协议 (MCP) 服务器,它通过平台无关的接口实现可扩展的移动自动化,无需了解不同的 iOS 或 Android 知识。 该服务器允许 Agent 和 LLM 通过结构化的可访问性快照或基于屏幕截图的基于坐标的点击与原生 iOS/Android 应用程序和设备进行交互。

https://github.com/user-attachments/assets/c4e89c4f-cc71-4424-8184-bdbc8c638fa1

<p align="center"> <a href="https://www.npmjs.com/package/@mobilenext/mobile-mcp"> <img src="https://img.shields.io/badge/npm-@mobilenext/mobile--mcp-red" alt="npm"> </a> <a href="https://github.com/mobile-next/mobile-mcp"> <img src="https://img.shields.io/badge/github-repo-black" alt="GitHub repo"> </a> </p>

<p align="center"> <a href="https://github.com/mobile-next/"> <img alt="mobile-mcp" src="https://raw.githubusercontent.com/mobile-next/mobile-next-assets/refs/heads/main/mobile-mcp-banner.png" width="600"> </a> </p>

🚀 Mobile MCP 路线图:构建移动的未来

加入我们,我们将不断增强 Mobile MCP! 查看我们的详细路线图,了解即将推出的功能、改进和里程碑。 您的反馈对于塑造移动自动化的未来至关重要。

👉 探索路线图

主要用例

我们如何帮助扩展移动自动化:

  • 📲 用于测试或数据录入场景的原生应用程序自动化(iOS 和 Android)。
  • 📝 无需手动控制模拟器/仿真器或物理设备(iPhone、Samsung、Google Pixel 等)的脚本化流程和表单交互
  • 🧭 自动化由 LLM 驱动的多步骤用户旅程
  • 👆 用于基于代理的框架的通用移动应用程序交互
  • 🤖 支持移动自动化用例的代理间通信、数据提取

主要特点

  • 🚀 快速且轻量级:对于大多数交互,使用原生可访问性树,或者在 a11y 标签不可用时使用基于屏幕截图的坐标。
  • 🤖 对 LLM 友好:可访问性(快照)中不需要计算机视觉模型。
  • 🧿 视觉感知:评估和分析屏幕上实际呈现的内容,以决定下一步操作。 如果可访问性数据或视图层次结构坐标不可用,它会回退到基于屏幕截图的分析。
  • 📊 确定性工具应用:通过尽可能依赖结构化数据,减少纯粹基于屏幕截图的方法中发现的歧义。
  • 📺 提取结构化数据:使您能够从屏幕上可见的任何内容中提取结构化数据。

Mobile MCP 架构

<p align="center"> <a href="https://raw.githubusercontent.com/mobile-next/mobile-next-assets/refs/heads/main/mobile-mcp-arch-1.png"> <img alt="mobile-mcp" src="https://raw.githubusercontent.com/mobile-next/mobile-next-assets/refs/heads/main/mobile-mcp-arch-1.png" width="600"> </a> </p>

安装和配置

Claude Desktop 详细指南

{
  "mcpServers": {
    "mobile-mcp": {
      "command": "npx",
      "args": ["-y", "@mobilenext/mobile-mcp@latest"]
    }
  }
}

Claude 代码:

claude mcp add mobile -- npx -y @mobilenext/mobile-mcp@latest

前提条件

将 MCP 与您的代理和移动设备连接所需的内容:

模拟器、仿真器和物理设备

启动后,Mobile MCP 可以连接到:

  • macOS/Linux 上的 iOS 模拟器
  • Linux/Windows/macOS 上的 Android 模拟器
  • 物理 iOS 或 Android 设备(需要正确的平台工具和驱动程序)

在运行 Mobile Next Mobile MCP 之前,请确保您已安装并正确配置了移动平台 SDK(Xcode、Android SDK)。

在模拟器/仿真器上以“无头”模式运行

当您没有连接到机器的物理电话时,您可以在后台使用模拟器或仿真器运行 Mobile MCP。

例如,在 Android 上:

  1. 启动一个模拟器 (avdmanager / emulator 命令)。
  2. 使用所需的标志运行 Mobile MCP

在 iOS 上,您需要 Xcode 并在使用 Mobile MCP 与该模拟器实例之前运行模拟器。

  • xcrun simctl list
  • xcrun simctl boot "iPhone 16"

移动命令和交互工具

这些命令和工具支持基于可访问性的定位器(首选)和基于坐标的输入,当可访问性/自动化 ID 丢失时,为您提供灵活性,以实现可靠和无缝的自动化。

mobile_list_apps

  • 描述: 列出设备上所有已安装的应用程序
  • 参数:
    • bundleId (string): 应用程序的唯一 bundle/package 标识符,例如:com.google.android.keep 或 com.apple.mobilenotes )

mobile_launch_app

  • 描述: 在设备/模拟器上启动指定的应用程序
  • 参数:
    • bundleId (string): 应用程序的唯一 bundle/package 标识符,例如:com.google.android.keep 或 com.apple.mobilenotes )

mobile_terminate_app

  • 描述: 终止正在运行的应用程序
  • 参数:
    • packageName (string): 根据应用程序的 bundle/package 标识符调用 am force stop 或根据 pid 终止应用程序。

mobile_get_screen_size

  • 描述: 获取移动设备的屏幕尺寸(以像素为单位)
  • 参数:

mobile_click_on_screen_at_coordinates

  • 描述: 根据坐标点击指定的屏幕坐标。
  • 参数:
    • x (number): X 坐标
    • y (number): Y 坐标

mobile_list_elements_on_screen

  • 描述: 列出屏幕上的元素及其坐标,以及显示文本或可访问性标签。
  • 参数:

mobile_element_tap

  • 描述: 点击由可访问性定位器标识的 UI 元素
  • 参数:
    • element (string): 人类可读的元素描述(例如,“登录按钮”)
    • ref (string): 来自快照的可访问性/自动化 ID 或引用

mobile_tap

  • 描述: 点击指定的屏幕坐标
  • 参数:
    • x (number): X 坐标
    • y (number): Y 坐标

mobile_press_button

  • 描述: 按下设备上的按钮(主页、返回、音量、回车、电源按钮。)
  • 参数:

mobile_open_url

  • 描述: 在设备上的浏览器中打开 URL
  • 参数:
    • url (string): 要打开的 URL(例如,“https://example.com”)。

mobile_type_text

  • 描述: 将文本键入到聚焦的 UI 元素中(例如,TextField、SearchField)
  • 参数:
    • text (string): 要键入的文本
    • submit (boolean): 键入后是否按 Enter/Return

mobile_element_swipe

  • 描述: 执行从一个 UI 元素到另一个 UI 元素的滑动操作
  • 参数:
    • startElement (string): 开始元素的人类可读描述
    • startRef (string): 开始元素的可访问性/自动化 ID
    • endElement (string): 结束元素的人类可读描述
    • endRef (string): 结束元素的可访问性/自动化 ID

mobile_swipe

  • 描述: 在两组屏幕坐标之间执行滑动操作
  • 参数:
    • startX (number): 开始 X 坐标
    • startY (number): 开始 Y 坐标
    • endX (number): 结束 X 坐标
    • endY (number): 结束 Y 坐标

mobile_press_key

  • 描述: 按下硬件键或触发特殊事件(例如,Android 上的返回按钮)
  • 参数:
    • key (string): 键标识符(例如,HOME、BACK、VOLUME_UP 等)

mobile_take_screenshot

  • 描述: 捕获当前设备屏幕的屏幕截图
  • 参数:

mobile_get_source

  • 描述: 获取当前设备 UI 结构(可访问性快照)(xml 格式)
  • 参数:

感谢所有贡献者 ❤️

我们感谢所有帮助改进此项目的人。

<a href = "https://github.com/mobile-next/mobile-mcp/graphs/contributors"> <img src = "https://contrib.rocks/image?repo=mobile-next/mobile-mcp"/> </a>

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选