Skip to main content
Glama

MCP Appium Server

by Rahulec08

MCP Appium 서버

Appium을 사용한 모바일 앱 자동화를 위한 MCP(Model Context Protocol) 서버 구현.

필수 조건

  1. Node.js(v14 이상)
  2. 자바 개발 키트(JDK)
  3. Android SDK(Android 테스트용)
  4. Xcode(iOS 테스트용, macOS 전용)
  5. Appium 서버
  6. Android 기기 또는 에뮬레이터 / iOS 기기 또는 시뮬레이터

환경 설정

명령을 실행하기 전에 환경 변수가 올바르게 설정되었는지 확인하세요.

  1. .bash_profile , .zshrc 또는 다른 셸 구성 파일에 필요한 환경 변수가 포함되어 있는지 확인하세요.

지엑스피1

  1. MCP-Appium을 실행하기 전에 환경 파일을 소싱하세요.
source ~/.bash_profile # For bash # OR source ~/.zshrc # For zsh

참고 : 시스템은 드라이버를 초기화할 때 자동으로 .bash_profile 소싱하려고 시도하지만, 새 터미널 세션에서 테스트를 실행하기 전에 수동으로 적절한 환경을 설정하는 것이 좋습니다.

Xcode 명령줄 도구 구성

iOS 테스트를 위해서는 적절한 Xcode 명령줄 도구 구성이 필수입니다.

  1. Xcode 명령줄 도구가 아직 설치되지 않았다면 설치하세요.
xcode-select --install
  1. 설치를 확인하고 현재 Xcode 경로를 확인하세요.
xcode-select -p
  1. 필요한 경우 올바른 Xcode 경로를 설정하세요(특히 여러 Xcode 버전이 있는 경우):
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
  1. Xcode 라이선스 계약에 동의하세요:
sudo xcodebuild -license accept
  1. iOS 실제 기기 테스트를 위해 Xcode에서 Apple 개발자 계정이 올바르게 구성되었는지 확인하세요.
    • Xcode를 엽니다
    • 환경 설정 > 계정으로 이동하세요
    • 아직 추가하지 않았다면 Apple ID를 추가하세요.
    • 필요한 프로비저닝 프로필을 다운로드하세요
  2. iOS 개발을 위한 환경 변수 설정:
# Add these to your ~/.bash_profile or ~/.zshrc export DEVELOPER_DIR="/Applications/Xcode.app/Contents/Developer" export PATH="$DEVELOPER_DIR/usr/bin:$PATH"
  1. 업데이트된 구성을 소싱하세요.
source ~/.bash_profile # For bash # OR source ~/.zshrc # For zsh

설정

  1. 종속성 설치:
npm install
  1. Appium 서버를 설치하고 시작하세요:
npm install -g appium appium
  1. Android 기기/에뮬레이터 설정:
    • Android 기기에서 개발자 옵션 활성화
    • USB 디버깅 활성화
    • USB를 통해 장치를 연결하거나 에뮬레이터를 시작하세요
    • adb devices 사용하여 장치가 연결되었는지 확인하세요.
  2. iOS 테스트용(macOS만 해당):
    • Xcode 명령줄 도구가 설치되어 있는지 확인하세요: xcode-select --install
    • iOS 시뮬레이터를 설정하거나 실제 장치를 연결하세요
    • 실제 기기를 사용하는 경우 iOS 기기의 개발 컴퓨터를 신뢰하세요.

테스트 실행

  1. 프로젝트를 빌드하세요:
npm run build
  1. MCP 서버를 시작합니다.
npm run dev
  1. 새 터미널에서 테스트를 실행하세요.
npm test

테스트 구성

안드로이드 구성

예제 테스트에서는 Android 설정 앱을 데모로 사용합니다. 직접 앱을 테스트하려면 다음 단계를 따르세요.

  1. examples/appium-test.ts 편집:
    • 장치와 일치하도록 deviceName 업데이트하세요.
    • APK 파일에 app 경로를 설정하거나
    • 설치된 앱의 appPackageappActivity 업데이트
  2. 일반적인 기능 구성:
const capabilities: AppiumCapabilities = { platformName: "Android", deviceName: "YOUR_DEVICE_NAME", automationName: "UiAutomator2", // For installing and testing an APK: app: "./path/to/your/app.apk", // OR for testing an installed app: appPackage: "your.app.package", appActivity: ".MainActivity", noReset: true, };

iOS 구성

새로운 Xcode 명령줄 지원을 사용하여 iOS를 테스트하는 경우:

  1. examples/xcode-appium-example.ts 의 구성 예:
const capabilities: AppiumCapabilities = { platformName: "iOS", deviceName: "iPhone 13", // Your simulator or device name automationName: "XCUITest", udid: "DEVICE_UDID", // Get this from XcodeCommands.getIosSimulators() // For installing and testing an app: app: "./path/to/your/app.app", // OR for testing an installed app: bundleId: "com.your.app", noReset: true, };

사용 가능한 작업

MCP 서버는 다양한 Appium 작업을 지원합니다.

  1. 요소 상호작용:
    • 요소 찾기
    • W3C Actions API를 사용한 탭/클릭 요소("W3C 표준 제스처" 섹션 참조)
    • 텍스트를 입력하세요
    • W3C Actions API를 사용하여 요소로 스크롤
    • 길게 누르기
  2. 앱 관리:
    • 앱 실행/종료
    • 앱 재설정
    • 현재 패키지/활동 가져오기
  3. 장치 제어:
    • 화면 방향
    • 키보드 취급
    • 기기 잠금/잠금 해제
    • 스크린샷
    • 배터리 정보
  4. 고급 기능:
    • 컨텍스트 전환(네이티브/웹뷰)
    • 파일 작업
    • 알림
    • 사용자 정의 제스처
  5. Xcode 명령줄 도구(iOS 전용):
    • iOS 시뮬레이터 관리(부팅, 종료)
    • 시뮬레이터에 앱 설치/제거
    • 앱 실행/종료
    • 스크린샷 찍기
    • 비디오 녹화
    • 시뮬레이터 생성/삭제
    • 장치 유형 및 런타임 가져오기

W3C 표준 제스처

MCP-Appium 라이브러리는 이제 모바일 자동화의 최신 표준인 터치 제스처를 위한 W3C WebDriver Actions API를 구현합니다.

탭 요소에 대한 W3C 작업

tapElement 메서드는 이제 지능형 폴백을 갖춘 W3C Actions API를 사용합니다.

// The method will try in this order: // 1. Standard WebdriverIO click() // 2. W3C Actions API // 3. Legacy TouchAction API (fallback for backward compatibility) await appium.tapElement("//android.widget.Button[@text='OK']"); // or using the click alias await appium.click("//android.widget.Button[@text='OK']");

스크롤을 위한 W3C 작업

scrollToElement 메서드는 이제 W3C Actions API를 사용합니다.

// Uses W3C Actions API for more reliable scrolling await appium.scrollToElement( "//android.widget.TextView[@text='About phone']", // selector "down", // direction: "up", "down", "left", "right" "xpath", // strategy 10 // maxScrolls );

사용자 정의 W3C 제스처

executeMobileCommand 메서드를 사용하여 사용자 정의 W3C 제스처를 만들 수 있습니다.

// Create custom W3C Actions API gesture const w3cActions = { actions: [ { type: "pointer", id: "finger1", parameters: { pointerType: "touch" }, actions: [ // Move to start position { type: "pointerMove", duration: 0, x: startX, y: startY }, // Press down { type: "pointerDown", button: 0 }, // Move to end position over duration milliseconds { type: "pointerMove", duration: duration, origin: "viewport", x: endX, y: endY, }, // Release { type: "pointerUp", button: 0 }, ], }, ], }; // Execute the W3C Actions using executeScript await appium.executeMobileCommand("performActions", [w3cActions.actions]);

W3C 표준 제스처 구현의 더 많은 예를 보려면 examples/w3c-actions-swipe-demo.ts 참조하세요.

Xcode 명령줄 도구 사용

새로운 XcodeCommands 클래스는 iOS 테스트를 위한 강력한 도구를 제공합니다.

import { XcodeCommands } from "../src/lib/xcode/xcodeCommands.js"; // Check if Xcode CLI tools are installed const isInstalled = await XcodeCommands.isXcodeCliInstalled(); // Get available simulators const simulators = await XcodeCommands.getIosSimulators(); // Boot a simulator await XcodeCommands.bootSimulator("SIMULATOR_UDID"); // Install an app await XcodeCommands.installApp("SIMULATOR_UDID", "/path/to/app.app"); // Launch an app await XcodeCommands.launchApp("SIMULATOR_UDID", "com.example.app"); // Take a screenshot await XcodeCommands.takeScreenshot("SIMULATOR_UDID", "/path/to/output.png"); // Shutdown a simulator await XcodeCommands.shutdownSimulator("SIMULATOR_UDID");

클릭 기능 사용하기

click() 메서드는 tapElement() 보다 더 직관적인 대안을 제공합니다.

// Using the click method await appium.click("//android.widget.Button[@text='OK']"); // This is equivalent to: await appium.tapElement("//android.widget.Button[@text='OK']");

문제 해결

  1. 장치를 찾을 수 없습니다:
    • adb devices 출력 확인
    • USB 디버깅이 활성화되어 있는지 확인하세요
    • 장치를 다시 연결해보세요
  2. 앱이 설치되지 않음:
    • APK 경로가 올바른지 확인하세요
    • 장치에 충분한 저장 공간이 있는지 확인하세요
    • 앱이 디버그용으로 서명되었는지 확인하세요
  3. 찾을 수 없는 요소:
    • Appium Inspector를 사용하여 선택기 확인
    • 화면에 요소가 보이는지 확인하세요
    • 다양한 위치 전략을 시도해 보세요
  4. 연결 문제:
    • Appium 서버가 실행 중인지 확인하세요
    • 포트 충돌 확인
    • 올바른 기능이 설정되었는지 확인하세요
  5. iOS 시뮬레이터 문제:
    • Xcode 명령줄 도구가 설치되어 있는지 확인하세요: xcode-select -p
    • xcrun simctl list devices 사용하여 시뮬레이터 UDID가 올바른지 확인하세요.
    • 시뮬레이터가 응답하지 않으면 닫고 다시 시작하세요.

기여하다

추가 기능이나 버그 수정에 대한 문제점과 풀 리퀘스트를 자유롭게 제출하세요.

특허

MIT

Install Server
A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

local-only server

The server can only run on the client's local machine because it depends on local resources.

Appium을 사용하여 모바일 앱 자동화를 구현하고, 표준화된 프로토콜을 통해 다양한 장치 상호작용, 요소 작업 및 앱 관리를 지원하는 MCP(Model Context Protocol) 서버입니다.

  1. 필수 조건
    1. 환경 설정
      1. Xcode 명령줄 도구 구성
    2. 설정
      1. 테스트 실행
        1. 테스트 구성
          1. 안드로이드 구성
          2. iOS 구성
        2. 사용 가능한 작업
          1. W3C 표준 제스처
            1. 탭 요소에 대한 W3C 작업
            2. 스크롤을 위한 W3C 작업
            3. 사용자 정의 W3C 제스처
          2. Xcode 명령줄 도구 사용
            1. 클릭 기능 사용하기
              1. 문제 해결
                1. 기여하다
                  1. 특허

                    Related MCP Servers

                    • -
                      security
                      F
                      license
                      -
                      quality
                      A Model Context Protocol (MCP) server implementation for interacting with Phabricator API. This server allows LLMs to interact with Phabricator through a standardized interface.
                      Last updated -
                      5
                      Python
                    • A
                      security
                      A
                      license
                      A
                      quality
                      A beginner-friendly Model Context Protocol (MCP) server that helps users understand MCP concepts, provides interactive examples, and lists available MCP servers. This server is designed to be a helpful companion for developers working with MCP. Also comes with a huge list of servers you can install.
                      Last updated -
                      3
                      9
                      36
                      JavaScript
                      Apache 2.0
                    • -
                      security
                      F
                      license
                      -
                      quality
                      This MCP server implementation allows users to manage and expose actions as tools from their Integration App workspace through the Model Context Protocol.
                      Last updated -
                      10
                      21
                      TypeScript
                    • A
                      security
                      F
                      license
                      A
                      quality
                      A Model Context Protocol (MCP) server that interacts with system APIs, allowing users to check connections, search employees, register breakfast, and update chemical information by shifts.
                      Last updated -
                      21
                      37
                      JavaScript

                    View all related MCP servers

                    MCP directory API

                    We provide all the information about MCP servers via our MCP API.

                    curl -X GET 'https://glama.ai/api/mcp/v1/servers/Rahulec08/appium-mcp'

                    If you have feedback or need assistance with the MCP directory API, please join our Discord server