AI Skill Hub 强烈推荐:appium-mcp MCP工具 是一款优质的MCP工具。AI 综合评分 8.2 分,在同类工具中表现稳健。如果你正在寻找可靠的MCP工具解决方案,这是一个值得深入了解的选择。
基于Appium框架的MCP工具,支持iOS和Android移动应用自动化测试。提供强大的移动设备交互能力,适合移动应用开发者、测试工程师及AI Agent集成者使用,具有高度的扩展性和灵活性。
appium-mcp MCP工具 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
基于Appium框架的MCP工具,支持iOS和Android移动应用自动化测试。提供强大的移动设备交互能力,适合移动应用开发者、测试工程师及AI Agent集成者使用,具有高度的扩展性和灵活性。
appium-mcp MCP工具 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
# 方式一:通过 Claude Code CLI 一键安装
claude skill install https://github.com/appium/appium-mcp
# 方式二:手动配置 claude_desktop_config.json
{
"mcpServers": {
"appium-mcp-mcp--": {
"command": "npx",
"args": ["-y", "appium-mcp"]
}
}
}
# 配置文件位置
# macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
# Windows: %APPDATA%/Claude/claude_desktop_config.json
# 安装后在 Claude 对话中直接使用 # 示例: 用户: 请帮我用 appium-mcp MCP工具 执行以下任务... Claude: [自动调用 appium-mcp MCP工具 MCP 工具处理请求] # 查看可用工具列表 # 在 Claude 中输入:"列出所有可用的 MCP 工具"
// claude_desktop_config.json 配置示例
{
"mcpServers": {
"appium-mcp_mcp__": {
"command": "npx",
"args": ["-y", "appium-mcp"],
"env": {
// "API_KEY": "your-api-key-here"
}
}
}
}
// 保存后重启 Claude Desktop 生效
MCP Appium is an intelligent MCP (Model Context Protocol) server designed to empower AI assistants with a robust suite of tools for mobile automation. It streamlines mobile app testing by enabling natural language interactions, intelligent locator generation, and automated test creation for both Android and iOS platforms.
Create a capabilities.json file to define your device capabilities:
{
"android": {
"appium:app": "/path/to/your/android/app.apk",
"appium:deviceName": "Android Device",
"appium:platformVersion": "11.0",
"appium:automationName": "UiAutomator2",
"appium:udid": "your-device-udid"
},
"ios": {
"appium:app": "/path/to/your/ios/app.ipa",
"appium:deviceName": "iPhone 15 Pro",
"appium:platformVersion": "17.0",
"appium:automationName": "XCUITest",
"appium:udid": "your-device-udid"
},
"general": {
"platformName": "mac",
"appium:automationName": "mac2",
"appium:bundleId": "com.apple.Safari"
}
}
Set the CAPABILITIES_CONFIG environment variable to point to your configuration file.
appium_session_management (action=create).ios or android, the server builds capabilities for that platform (including selected device info when local).general:capabilities exactly as given, orCAPABILITIES_CONFIG is set, it will merge with the general section from your capabilities file.Before you begin, ensure you have the following installed:
MCP Appium supports two driver modes:
appium_session_management creates an android or ios session without remoteServerUrl, MCP Appium uses the bundled appium-uiautomator2-driver or appium-xcuitest-driver dependency directly. You still need the platform toolchains below, but you do not need to install a global Appium server or run appium driver install uiautomator2 / appium driver install xcuitest for this mode.remoteServerUrl is provided to action=create or action=attach, MCP Appium uses the webdriver client to talk to that existing server. In this mode the remote server is responsible for its installed drivers, plugins, device access, and capability handling. Use this mode for platform=general; embedded local creation is available only for Android and iOS.ANDROID_HOME environment variable.adb available on PATH.xcode-select --install.appium_prepare_ios_real_device to download and sign WebDriverAgent in a single call - it will guide you through provisioning profile selection and return capabilities for session startup.Standard config works in most of the tools::
{
"mcpServers": {
"appium-mcp": {
"disabled": false,
"timeout": 100,
"type": "stdio",
"command": "npx",
"args": ["appium-mcp@latest"],
"env": {
"ANDROID_HOME": "/path/to/android/sdk",
"CAPABILITIES_CONFIG": "/path/to/your/capabilities.json"
}
}
}
}
| Tool | Description |
|---|---|
select_device | **REQUIRED FIRST**: Discover available devices and select one. Auto-selects if only one device found |
prepare_ios_simulator | Boot an iOS/tvOS simulator, download WDA (if not cached), and install/launch WDA in a single call. Each step is skipped if already satisfied (iOS/tvOS only). Set APPIUM_MCP_WDA_APP_PATH to skip all downloads and use a local .app bundle instead. |
appium_prepare_ios_real_device | Prepare a real iOS device for Appium testing. **Two-step flow**: (1) call without provisioningProfileUuid to list available .mobileprovision profiles; (2) call again with the chosen UUID and isFreeAccount to download the matching WDA release, package it as an IPA, and resign with the profile. Results are cached per WDA version and profile, so repeat runs are fast. Pass the returned capabilitiesHint to create_session so Appium installs and launches WDA. macOS + Xcode 16+ required. |
Set the SCREENSHOTS_DIR environment variable to specify where screenshots are saved. If not set, screenshots are saved to the current working directory. Supports both absolute and relative paths (relative paths are resolved from the current working directory). The directory is created automatically if it doesn't exist.
Note: For embedded local Android/iOS sessions, MCP Appium already includes the UiAutomator2 and XCUITest driver packages. The system-level requirements are the platform toolchains (ANDROID_HOME, Java, Android SDK tools, Xcode/iOS signing or simulator setup). For remote sessions, configure those requirements on the remote Appium/WebDriver server instead.
| Variable | Required | Description |
|---|---|---|
CAPABILITIES_CONFIG | Optional | Absolute path to a capabilities.json file with per-platform capability presets |
SCREENSHOTS_DIR | Optional | Directory where screenshots and screen recordings are saved. Defaults to the current working directory |
NO_UI | Optional | Set to true or 1 to disable HTML UI components — faster responses, fewer tokens. See [NO_UI Mode](#no_ui-mode) |
APPIUM_MCP_ON_CLIENT_DISCONNECT | Optional | Session cleanup when the MCP client disconnects: delete_all (default) deletes **MCP-owned** Appium sessions (safeDeleteAllSessions); skip keeps those sessions across disconnects (e.g. HTTP/stream clients that reconnect). Attached/remote sessions are not removed by this path. See [MCP disconnect behavior](#mcp-disconnect-behavior). |
APPIUM_MCP_WDA_APP_PATH | Optional | Absolute path to a pre-extracted WebDriverAgentRunner-Runner.app bundle. When set, prepare_ios_simulator skips all GitHub downloads and uses this bundle directly — useful in environments where external downloads are blocked |
REMOTE_SERVER_URL_ALLOW_REGEX | Optional | Regex pattern that remote Appium server URLs must match. Defaults to ^https?:// |
AI_VISION_ENABLED | Optional | Set to true to register the appium_ai tool (vision-based element finding). When unset or false, the AI tool is **not registered** and the LLM has no way to invoke vision-based finding. Requires AI_VISION_API_BASE_URL and AI_VISION_API_KEY to also be set, otherwise the server fails to start. |
AI_VISION_API_BASE_URL | Required when AI_VISION_ENABLED=true | Base URL of the OpenAI-compatible vision model API |
AI_VISION_API_KEY | Required when AI_VISION_ENABLED=true | API key for the vision model provider |
AI_VISION_MODEL | Optional | Vision model name (default: Qwen3-VL-235B-A22B-Instruct) |
AI_VISION_COORD_TYPE | Optional | Coordinate type: normalized (default) or absolute |
AI_VISION_IMAGE_MAX_WIDTH | Optional | Max image width in pixels before compression (default: 1080) |
AI_VISION_IMAGE_QUALITY | Optional | JPEG quality 1–100 for compressed screenshots sent to the vision API (default: 80) |
APPIUM_MCP_DOCS_ENABLED | Optional | Set to true (or 1/yes/on) to register the documentation tools (appium_documentation_query, appium_skills). **Opt-in and disabled by default.** Requires the optional @appium/mcp-documentation package (embeddings cache + ML stack) to be installed separately; when unset it is **never downloaded**. See [Documentation Tools (opt-in)](#documentation-tools-opt-in). |
SENTENCE_TRANSFORMERS_MODEL | Optional | Hugging Face model used for semantic search in Appium documentation queries (default: Xenova/all-MiniLM-L6-v2). Only applies when APPIUM_MCP_DOCS_ENABLED is set. |
APPIUM_MCP_PERSIST_REMOTE_SESSIONS_PATH | Optional | Directory path for persisted attached remote session info. When set, attached remote sessions are stored as JSON files in that directory and can be rehydrated after restart. |
APPIUM_MCP_EVIDENCE | Optional | Set to true or 1 to attach a structured **action evidence record** (locator, resolved element id, context, timing, normalized error code) to appium_find_element and appium_gesture responses as an application/vnd.appium.evidence+json resource block, for CI/debugging. Disabled by default; responses are unchanged when unset. |
APPIUM_MCP_OTEL_ENABLED | Optional | Set to true to enable OpenTelemetry tracing (disabled by default). |
APPIUM_MCP_OTEL_INCLUDE_ARGUMENT_VALUES | Optional | Set to true to include sanitized non-sensitive argument values in spans; disabled by default because values may contain sensitive data. |
OTEL_SERVICE_NAME | Optional | Service name reported to the OpenTelemetry collector (example: appium-mcp). |
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT | Optional | OTLP/HTTP traces endpoint (example: http://127.0.0.1:4318/v1/traces). |
OTEL_TRACES_SAMPLER | Optional | Trace sampling strategy; parentbased_always_on samples new root traces and follows parent decisions. |
OTEL_RESOURCE_ATTRIBUTES | Optional | Comma-separated key=value pairs attached as resource attributes to every span (example: testcase.id=my-test-123,team=platform). |
Use appium-mcp/core to compose the default Appium MCP server with custom business logic without maintaining a fork. Plugins can register MCP tools, prompts, resources, and resource templates, and can wrap tool execution with lifecycle hooks. Call hooks are tool-only: prompts, resources, and resource templates are registered with FastMCP but are not wrapped by beforeCall or afterCall.
createAppiumMcpServer({ policy }) can also hide nonmatching tools and resources from MCP discovery. The factory is async, so await it before starting the returned server. Policy rules are regular expressions matched against tool and resource names exactly as registered. The policy is applied at registration time to both single and batch registration methods. Resource policy matches the resource name only; resources or resource templates without a string name cannot match a non-empty allowResources list.
import { createAppiumMcpServer } from 'appium-mcp/core';
import type {
AppiumMcpPlugin,
McpRegistry,
ToolCallContext,
} from 'appium-mcp/core';
import { z } from 'zod';
class CheckoutPlugin implements AppiumMcpPlugin {
readonly name = 'checkout-plugin';
readonly version = '1.0.0';
register(registry: McpRegistry): void {
const parameters = z.object({ orderId: z.string() });
registry.addTool({
name: 'assert_checkout_summary',
description:
'Assert that the checkout summary screen shows an expected order ID.',
parameters,
execute: async (args) => {
const { orderId } = parameters.parse(args);
return {
content: [
{ type: 'text', text: `Assert checkout order ${orderId}` },
],
};
},
});
}
async beforeCall(ctx: ToolCallContext): Promise<void> {
if (ctx.toolName === 'appium_gesture') {
console.error(`[checkout-plugin] about to call ${ctx.toolName}`);
}
}
}
const server = await createAppiumMcpServer({
plugins: [new CheckoutPlugin()],
additionalInstructions: 'Custom checkout policies are active.',
policy: {
allowTools: [/^appium_session_management$/, /^assert_checkout_summary$/],
allowResources: [/^Generate Code With Locators$/],
},
});
await server.start({ transportType: 'stdio' });
Plugin lifecycle:
register(registry, core): called during server construction. Register custom tools, prompts, resources, and resource templates here.initialize(ctx): called lazily on the first MCP client connection. Use it for async setup such as artifact storage or internal service clients.beforeCall(ctx): called before a registered MCP tool executes. Return a ToolCallResult to short-circuit the tool. This hook only applies to tools, not prompts, resources, or resource templates.afterCall(ctx, result): called after a registered MCP tool executes. Return a modified ToolCallResult to decorate or replace the response. This hook only applies to tools, not prompts, resources, or resource templates.destroy(): called after the last MCP client disconnects.The supported plugin API is intentionally small:
| Surface | Safe methods |
|---|---|
McpRegistry | [addTool](https://github.com/punkpeye/fastmcp#tools), [addTools](https://github.com/punkpeye/fastmcp#tools), [addPrompt](https://github.com/punkpeye/fastmcp#prompts), [addPrompts](https://github.com/punkpeye/fastmcp#prompts), [addResource](https://github.com/punkpeye/fastmcp#resources), [addResources](https://github.com/punkpeye/fastmcp#resources), [addResourceTemplate](https://github.com/punkpeye/fastmcp#resource-templates), [addResourceTemplates](https://github.com/punkpeye/fastmcp#resource-templates) |
AppiumMcpCore | getSessionId(), getSessionInfo(sessionId?), getDriver(sessionId?), listSessions() |
ToolCallContext.session | getSessionId(), getSessionInfo(sessionId?), getDriver(sessionId?), listSessions() |
PluginContext | core, plugins |
McpRegistry methods delegate to the matching FastMCP registration APIs, so their object shapes follow FastMCP's documented tool, prompt, resource, and resource-template definitions. Appium MCP wraps registered tools with plugin call hooks, but prompts and resources are registered directly with FastMCP.
Each plugin name should be unique within the server. If two plugins use the same name, Appium MCP keeps the first plugin registered for that name and skips later plugins with a warning. Use a stable, package-style or organization-prefixed name, such as acme-checkout-plugin, to avoid collisions when composing plugins from multiple teams.
Each tool name should also be unique across all plugins and the core server. Tool names follow FastMCP behavior, not plugin-name behavior: when a tool is registered with the same name as an existing tool, FastMCP replaces the earlier tool definition with the later one. Appium MCP registers built-in tools before plugin tools, which means a plugin tool that uses the same name as a built-in tool replaces the built-in tool. Appium MCP tools usually have an appium_ prefix, so plugin tool names should use that pattern only when they intentionally override a core tool.
Use verifyAppiumMcpNames before publishing or deploying a custom plugin setup. It registers your plugin capabilities into a lightweight collector, registers the Appium MCP core tools, and reports duplicate plugin names, duplicate tool names, and registration errors without starting the MCP server.
The recommended approach is to verify the same plugin array you pass to createAppiumMcpServer({ plugins }). This preserves your real plugin instances and order:
import {
formatVerificationReport,
verifyAppiumMcpNames,
} from 'appium-mcp/core';
import { plugins } from './plugins.js';
const report = verifyAppiumMcpNames({ plugins });
console.log(formatVerificationReport(report));
process.exit(report.ok ? 0 : 1);
When you provide multiple plugins, order is preserved. Plugins are verified in array order after the appium-mcp core tools. This matters because Appium MCP keeps the first plugin for a duplicate plugin name and skips later plugins with the same name, while duplicate tool names follow FastMCP's later-registration-wins behavior. Tool names still need to be unique across all loaded plugins and appium-mcp core; the verifier reports any collisions it finds.
The report labels this package's own shipped tools as appium-mcp core. Plugin sources are labeled as plugin:<name> with the plugin version.
Treat anything outside appium-mcp/core as internal. In particular, plugins should not rely on private server internals, internal session-store modules, tool implementation files, or the raw FastMCP server instance. If a plugin needs another stable primitive, open an issue so it can be added to AppiumMcpCore or McpRegistry deliberately.
See examples/plugin-example.ts for a fuller cookbook with tools, prompts, resources, resource templates, call hooks, and lifecycle setup.
MCP Appium 是一个专为移动开发与自动化设计的智能 MCP (Model Context Protocol) Server。它通过为 AI 助手提供一套强大的移动端自动化工具集,将自然语言交互引入移动测试流程。无论是进行自动化测试编写,还是通过自然语言指令进行 UI 交互,该项目都能显著提升移动端应用的测试效率与智能化水平。
本项目具备强大的跨平台支持能力,能够同时驱动 Android (UiAutomator2) 和 iOS (XCUITest) 的自动化测试。核心亮点在于其 AI 驱动的元素定位功能:开发者无需编写复杂的 XPath 或 Selector,即可通过视觉模型和自然语言描述精准定位 UI 元素。此外,系统还内置了基于优先级策略的智能定位器生成机制,并支持交互式的 Session 管理,让移动自动化变得更加智能与高效。
在开始使用之前,请确保您的系统已安装以下必要环境:Node.js (版本 v22 或更高) 以及 npm 或 yarn 包管理器。进行 Android 测试需要安装 Java Development Kit (JDK 8 或更高版本) 及 Android SDK;若需进行 iOS 测试,则必须在 macOS 环境下安装 Xcode。请务必提前配置好相关的开发环境以确保 MCP Server 能够正常调用底层驱动。
安装过程分为移动端环境准备与 MCP 配置两个阶段。首先,针对 Android 需安装 Android Studio、配置 ANDROID_HOME 环境变量并启用 USB 调试;针对 iOS 则需安装 Xcode 及 Command Line Tools。环境就绪后,通过在 MCP 客户端(如 Claude Desktop)的配置文件中添加 appium-mcp 的标准配置,并指定正确的 ANDROID_HOME 和 CAPABILITIES_CONFIG 路径,即可通过 npx 命令快速启动服务。
本项目支持多种定位策略。在传统模式下,系统会按照优先级顺序尝试使用 accessibility id、id、平台原生谓词(如 iOS 的 predicate string 或 Android 的 uiautomator)进行定位,仅在必要时使用 xpath。对于更高级的场景,您可以直接利用 AI 驱动的元素查找功能,通过自然语言描述来操作 UI,极大地降低了编写自动化脚本的门槛。
用户可以通过创建 `capabilities.json` 文件来定义设备的详细参数(如 app 路径、deviceName、platformVersion 及 udid 等),从而实现对 Android 和 iOS 设备的精准控制。此外,系统支持通过环境变量进行配置,请注意,底层的 Appium 驱动要求(如 JAVA_HOME、UiAutomator2/XCUITest 设置)属于系统级要求,建议在配置完成后,利用内置的 `appium_skills` 工具让 AI 助手协助检查环境。
开发者可以通过 `appium-mcp/core` 提供的插件 API 来扩展功能,而无需维护整个项目的 Fork 版本。该 API 允许插件注册自定义的 MCP tools、prompts、resources 以及资源模板,并支持通过生命周期钩子(lifecycle hooks)对工具执行过程进行封装。这为将 Appium 的能力与特定的业务逻辑相结合提供了极大的灵活性。
为了确保插件开发的安全性与稳定性,项目提供了一个精简且安全的插件 API 表面。在发布或部署自定义插件之前,强��建议使用 `verifyAppiumMcpNames` 工具进行校验。该工具可以在不启动 MCP Server 的情况下,通过轻量级收集器检查是否存在插件名称冲突、工具名称重复或注册错误,从而确保自动化工作流的可靠性。
活跃的开源MCP工具,将Appium强大的移动测试能力与AI Agent结合,358星说明社区认可度高,TypeScript实现保证代码质量。
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
✅ Apache 2.0 — 宽松开源协议,可商用,需保留版权声明和 NOTICE 文件,含专利授权条款。
总体来看,appium-mcp MCP工具 是一款质量优秀的MCP工具,在同类工具中具备一定竞争力。AI Skill Hub 将持续追踪其更新动态,建议收藏备用,结合自身场景选择合适时机引入使用。
| 原始名称 | appium-mcp |
| 原始描述 | 开源MCP工具:Appium MCP on Steroids!。⭐358 · TypeScript |
| Topics | 移动测试自动化iOSAndroidAppium |
| GitHub | https://github.com/appium/appium-mcp |
| License | Apache-2.0 |
| 语言 | TypeScript |
收录时间:2026-05-19 · 更新时间:2026-05-19 · License:Apache-2.0 · AI Skill Hub 不对第三方内容的准确性作法律背书。
选择 Agent 类型,复制安装指令后粘贴到对应客户端