harmonyos-dev-mcp
Provides tools for HarmonyOS app development, including building, deploying, UI automation, and logging for HarmonyOS devices.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@harmonyos-dev-mcpbuild my project and install on the connected device"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
HarmonyOS Dev MCP
harmonyos_dev_mcp provides HarmonyOS MCP tools for device discovery, app build and deployment, UI automation, E2E inspection, and log validation.
Links
PyPI: harmonyos-dev-mcp
Tool reference: docs/tool_reference.md
Logs query guide: docs/logs_query.md
What It Provides
The package exposes 18 MCP tools:
Parameter notation:
name: requiredname?: optionalname*: conditionally required, depending on the selected mode or target
General tools:
Tool | Parameters |
| none |
|
|
|
|
Build tools:
Tool | Parameters |
|
|
|
|
|
|
|
|
UI tools:
Tool | Parameters |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
E2E tools:
Tool | Parameters |
|
|
|
|
|
|
build_app supports HarmonyOS HAP, HAR, HSP, APP, and HNP build flows. HSP outputs can also be integrated into a HAP with include_hsp=true.
Detailed validation rules, result fields, errors, and examples are in the tool reference.
Layout
mcp_ho_dev/
|- src/harmonyos_dev_mcp/
| |- build/ # Hvigor build helpers, signing, packaging, and target handlers
| |- device/hdc/ # HDC device, package, app, file, and UI adapters
| |- logs/ # Log query parsing and history support
| |- runtime/ # Server factory and explicit MCP tool registration
| |- tools/ # Public MCP tool entrypoints
| |- ui/ # UI tree parsing, selectors, actions, and normalization
| |- utils/ # Compatibility wrappers
| `- _common/ # Shared runtime infrastructure bundled in this package
|- tests/unit/ # Unit tests grouped by domain
|- docs/ # Public tool and log query documentation
|- scripts/ # Release helpers
|- pyproject.toml # Project metadata and build config
|- uv.lock
|- README.mdRequirements
Python 3.12+
DevEco Studio 5.0+
HarmonyOS SDK toolchains, including
hdcuv
Install
Install from PyPI:
pip install harmonyos-dev-mcpInstall from source for local development:
uv syncRun
uv run harmonyos-dev-mcpCheck connected devices:
hdc list targetsDocumentation
Build Examples
Build a debug HAP:
await build_app(r"C:\path\to\project", target="hap", build_mode="debug", product="default")Build HSP modules and integrate them into a HAP:
await build_app(
r"C:\path\to\project",
target="hap",
build_mode="debug",
product="default",
include_hsp=True,
hsp_module_names=["library_one", "library_two"],
)Build an HNP-injected HAP:
await build_app(r"C:\path\to\project", target="hnp", build_mode="debug", product="default")Development
Run unit tests:
uv run pytest tests/unit -vRun with coverage:
uv run pytest tests/unit -v --cov=harmonyos_dev_mcpBuild package artifacts:
uv build --out-dir dist --clearNotes
build_appis a long-running tool. Set MCPtools/call timeoutto at least60s, and prefer120sfor cold builds.build_app target="hnp"builds a base HAP, injects module HNP packages fromentry/hnp, and signs the HAP through SDK packaging tools.build_app target="hsp"builds shared modules;build_app target="hap" include_hsp=truecan integrate one or more HSP outputs into the HAP.logs_querysupportserrorsandmarkersmodes.The shared infrastructure that used to live in a separate common package is bundled in
harmonyos_dev_mcp._common.
License
Apache License 2.0
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
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/Deslord319/harmonyos-dev-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server