Skip to main content

No project description provided

Project description

HarmonyOS Dev MCP

harmonyos_dev_mcp is the current community mainline service for HarmonyOS device automation, app deployment, UI interaction, and E2E assistance.

Run

uv sync --all-packages
uv run harmonyos-dev-mcp

Requirements

  • Python 3.12+
  • DevEco Studio 5.0+
  • hdc
  • uv

Tool Groups

  • General: list_devices query_package logs_query
  • Build: build_app install_app run_app uninstall_app
  • UI: screenshot click_element long_press_element input_text swipe drag press_key find_element
  • E2E: get_ui_tree list_windows wait_element

Call Notes

  • build_app is a long-running tool.
  • Set MCP tools/call timeout to at least 60s.
  • For cold builds, 120s is the recommended timeout.
  • build_app defaults to build_mode="debug", target="hap", and product="default".
  • If a project already defines hvigor signing in build-profile.json5, build_app returns the hvigor output artifact directly.
  • If a project still uses a project-local MDM signing flow and hvigor only produces an unsigned HAP, build_app will try project_root/hapsigner/2-<build_mode>-sign.bat automatically. On success, output_path switches to the signed artifact, usually project_root/hapsigner/signApp.hap.
  • logs_query supports mode="errors" and mode="markers".
  • logs_query defaults to realtime sampling and does not fallback to historical logs unless fallback_to_historical=true.
  • logs_query.package_name is no longer reduced to a single pid by default.
  • query_package.info_type only supports list, abilities, main_ability, and permissions.
  • query_package.info_type="basic" is not supported.
  • input_text.element_handle must be an object returned by find_element or wait_element.
  • Do not pass input_text.element_handle as a JSON string.
  • For MDM-style projects, keep signing materials and scripts under project_root/hapsigner/. The MCP fallback only runs project-local scripts; it does not synthesize signing config.

Correct input_text example:

{
  "element_handle": {
    "window_id": 80,
    "id": "420",
    "compid": "80:420",
    "type": "TextInput"
  },
  "text": "security"
}

Incorrect input_text example:

{
  "element_handle": "{\"window_id\":80,\"id\":\"420\"}",
  "text": "security"
}

Test

uv run pytest services/harmonyos_dev_mcp/tests/unit -v

Docs

  • docs/logs_query.md

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

harmonyos_dev_mcp-0.7.5.tar.gz (89.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

harmonyos_dev_mcp-0.7.5-py3-none-any.whl (85.0 kB view details)

Uploaded Python 3

File details

Details for the file harmonyos_dev_mcp-0.7.5.tar.gz.

File metadata

  • Download URL: harmonyos_dev_mcp-0.7.5.tar.gz
  • Upload date:
  • Size: 89.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for harmonyos_dev_mcp-0.7.5.tar.gz
Algorithm Hash digest
SHA256 c807d03004170b5a3130d08000c30439cd6b82b2eb5c94a53a133c33fe4af6cc
MD5 332572212bdbc45da1b6967c703d5484
BLAKE2b-256 3017a69fa0dcc393c92537e9edf3419f2daf547d8cf9419e8c2ee2d85740815c

See more details on using hashes here.

File details

Details for the file harmonyos_dev_mcp-0.7.5-py3-none-any.whl.

File metadata

  • Download URL: harmonyos_dev_mcp-0.7.5-py3-none-any.whl
  • Upload date:
  • Size: 85.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for harmonyos_dev_mcp-0.7.5-py3-none-any.whl
Algorithm Hash digest
SHA256 eb3ab6930658541a6d25df0636e59d6cdf8dd50d97ab7e9ad6c47a169fe4aa70
MD5 cc7b33e8c7fbfbd1bdd3de5b5cc7f0e9
BLAKE2b-256 df6c70c898f5385cb9694b46a9341f67b7b1ee7bdcba19ef1030a44a8b31746b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page