ohos-playwright-mcp

ohos-playwright-mcp

MCP server for HarmonyOS/OpenHarmony ArkWeb that enables browser automation using playwright-core over CDP, providing tools for navigation, input, network, cookies, and more.

Category
Visit Server

README

ohos-playwright-mcp

MCP server for HarmonyOS / OpenHarmony ArkWeb (Chromium 132-based) — the ohos counterpart of @playwright/mcp.

Drives ArkWeb through playwright-core over the Chrome DevTools Protocol. Bootstrap (hdc connect → aa starthdc fport → CDP endpoint) is delegated to ohos-playwright.

Why this exists

ArkWeb on HarmonyOS denies AF_UNIX socket creation in its sandbox, which breaks any tool that tries to launch Chrome the playwright way. connectOverCDP over a TCP-forwarded port works fine, and that's what this server uses end-to-end.

Install

npm i -g ohos-playwright-mcp ohos-playwright playwright-core

Node ≥ 24. hdc must be on PATH and an OpenHarmony / HarmonyOS device reachable.

MCP client config

{
  "mcpServers": {
    "ohos": {
      "command": "ohos-playwright-mcp"
    }
  }
}

If the peer deps live in a non-standard location, point at them explicitly:

{
  "mcpServers": {
    "ohos": {
      "command": "node",
      "args": ["/abs/path/to/server.mjs"],
      "env": {
        "ARKWEB_OHOS_PW_REGISTER": "/abs/path/to/ohos-playwright/dist/register.mjs",
        "ARKWEB_OHOS_PW_SETUP":    "/abs/path/to/ohos-playwright/dist/setup.mjs",
        "ARKWEB_PW_CORE":          "/abs/path/to/playwright-core/index.mjs"
      }
    }
  }
}

Other env vars:

  • OHOS_PW_INFO_PATH — where the CDP endpoint cache lives (default: <tmpdir>/ohos-playwright-cdp.json).
  • Any OHOS_PW_* vars consumed by ohos-playwright/setup (device serial, browser bundle name, port, etc.) — see that project's README.

Tools (61)

Navigationnavigate, navigate_back, navigate_forward, reload, wait, wait_for

Read-onlyevaluate, get_text, get_html, screenshot, snapshot

Tabs / lifecyclelist_pages, select_page, tab_new, tab_close, close, resize

Input (selector-based)click, hover, type, fill, fill_form, press_key, select_option, file_upload, drag

Input (raw mouse)mouse_move_xy, mouse_click_xy, mouse_down, mouse_up, mouse_drag_xy, mouse_wheel

Diagnosticsconsole_messages, handle_dialog

Networknetwork_requests, network_request, network_state_set, route, route_list, unroute

Cookiescookie_list, cookie_get, cookie_set, cookie_delete, cookie_clear

Storagelocalstorage_list, localstorage_get, localstorage_set, localstorage_delete, localstorage_clear, sessionstorage_list, sessionstorage_get, sessionstorage_set, sessionstorage_delete, sessionstorage_clear, storage_state

Visualizationhighlight, hide_highlight

Heavypdf_save (may not work on foreground ArkWeb), start_tracing, stop_tracing

Each tool's JSON schema is published via standard MCP tools/list.

ArkWeb-specific notes

  • screenshot uses raw CDP Page.captureScreenshot to skip Playwright's font-wait, which hangs on some ArkWeb pages.
  • snapshot calls Accessibility.getFullAXTree via a fresh CDP session because Playwright 1.x removed page.accessibility.
  • tab_new uses the /json/new HTTP endpoint with PUT (ArkWeb rejects the playwright context.newPage() path).
  • navigate_back / navigate_forward use waitUntil: 'commit' because ArkWeb doesn't re-fire load for cached history navigation.
  • ArkWeb tabs can occasionally crash into arkweb-error://webdata/ under heavy CDP load. The server auto-recovers by spawning a blank tab.

License

MIT © 2026 social4hyq

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured