Get the FREE Ultimate OpenClaw Setup Guide →

HarmonyOS

MCP server for manipulating HarmonyOS next devices.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio xixianliang-harmonyos-mcp-server python server.py \
  --env PYTHONWARNINGS="ignore" \
  --env PYTHONUNBUFFERED="1"

How to use

HarmonyOS MCP Server provides a Python-based MCP interface to manipulate HarmonyOS devices. It exposes an MCP server that can be interacted with via the OpenAI Agents ecosystem or Claude/OpenAI SDKs, enabling tool-based workflows to perform tasks on connected HarmonyOS devices. You can wire the server into an agent workflow or LangGraph pipelines, letting your AI agents issue MCP tool calls to perform actions such as launching apps, querying device state, or performing automated device interactions. Examples in the repository show how to connect via the OpenAI Agents Python package and how to integrate with LangGraph to build richer agent workflows.

To use the server with the OpenAI Agents SDK, start the MCP server and then create an Agent that includes MCPServerStdio as one of its MCP sources. You can then issue natural language instructions like “Launch the settings app” and rely on the agent to translate that into MCP tool invocations. If you prefer LangGraph, you can load the MCP tools into your graph, bind them to your LLM, and construct a workflow that navigates responses and tool invocations to achieve a task on the device. The server is designed to be used in local development environments with Python 3.13 as indicated by the project metadata.

How to install

Prerequisites:

  • Python 3.13 installed on your system
  • Git installed
  • Basic familiarity with running Python scripts from the project root

Install and run:

  1. Clone the repository git clone https://github.com/XixianLiang/HarmonyOS-mcp-server.git cd HarmonyOS-mcp-server

  2. Install dependencies (if any exist in a requirements file, otherwise ensure Python 3.13 is available) python -m pip install --upgrade pip python -m pip install -r requirements.txt 2>/dev/null || true

  3. Run the MCP server python server.py

  4. Verify the server is running by sending a test MCP command or using the sample Python scripts from the repository to connect via the MCP protocol.

Additional notes

Tips and common considerations:

  • Ensure you are using Python 3.13 to match the project’s stated compatibility.
  • When running the server behind an IDE or in a container, ensure the working directory contains server.py and any required assets.
  • The repository demonstrates integration with Claude Desktop and OpenAI SDKs; you can adapt your own agent workflows to invoke the MCP tools exposed by this server.
  • If you encounter environment-related issues, set PYTHONUNBUFFERED=1 to get real-time logs and consider adjusting PYTHONWARNINGS to suppress minor warnings during development.
  • For LangGraph usage, follow the examples to load MCP prompts and bind MCP tools, enabling your LLM to execute device actions through the MCP server.
  • If you plan to deploy in production, consider adding proper authentication, logging, and error handling around MCP tool invocations.

Related MCP Servers

Sponsor this space

Reach thousands of developers