dsh-codex-chrome: Reusing Codex Native Chrome Control Capabilities in DSH

Preface

To operate a real browser using agents in DeepSeek Harness (DSH), the common approach is to spin up Playwright, Puppeteer, or a standalone MCP service. However, this often results in a mismatch between the session and cookies and those already logged in within your daily Chrome. OpenAI Codex comes with a built-in chrome@openai-bundled plugin capable of driving the user’s local Chrome (tabs, login state, accessibility tree, screenshots, and input), but it is bound to Codex’s node_repl host and cannot be directly used as a DSH MCP tool.

The following is an introduction to the community plugin dsh-codex-chrome (Maintainer: BruceZhang1993, GitHub: BruceZhang1993/dsh-codex-chrome): It ports Codex’s Chrome plugin runtime into DSH, exposing a set of native mcp__chrome__* tools and including a control-chrome skill, with zero additional runtime dependencies (reusing Codex’s already cached browser-client.mjs / browser-service.mjs).

What is this

dsh-codex-chrome is a bundle plugin for DeepSeek Harness (version 0.1.0, MIT License, requires Node.js ≥ 20). It does not rewrite browser control logic, but instead:

  1. Interfaces with Codex’s node_repl MCP via a bridge process bin/chrome-mcp.mjs, injecting the turn metadata required by Codex (_meta.x-codex-turn-metadata) into every call.
  2. Re-publishes browser APIs as eleven mcp__chrome__* tools recognizable by DSH.
  3. Bundles a control-chrome skill that guides the model to use accessibility element indices rather than coordinates following an “Observe → Act → Re-observe” pattern.

It is categorized under “Networking Tools” in the community catalog; Catalog Page: skillhub.cn Plugin Page. The community catalog is an independent site and is not officially affiliated with DeepSeek or High-Flyer.

What the Codex Chrome Plugin means on the DSH side

In Codex, Chrome capabilities are enabled in ~/.codex/config.toml:

[plugins."chrome@openai-bundled"]
enabled = true

It is not a standalone MCP server but a combination of skills, hooks, and a vendor runtime; actual control is performed by scripts within the Codex cache directory and can only run as a trusted service within the Codex node_repl host. The migration strategy of this plugin is to reuse this vendor runtime rather than writing a separate browser driver.

Since @deepseek-ai/dsh-mcp-client on the DSH side does not support per-call _meta, the bridge layer must inject metadata such as session_id and turn_id when calling node_repl; otherwise, the browser service will directly error out (e.g., missing session_id, turn_id).

Core Features: Eleven MCP Tools

After restarting the profile, the following tools become visible to the model (all name prefixes are mcp__chrome__, omitted in the table below):

Tool Function
chrome_status List connected browsers, current bindings, and open tabs
chrome_select Bind browser: chrome / edge / brave / vivaldi / opera / iab / extension / default / auto
chrome_tabs list / new / select / close / user_tabs / claim
chrome_navigate goto / back / forward / reload
chrome_observe state (Accessibility tree, recommended) / dom / visible_dom / screenshot / both
chrome_act via:"ax": click, fill value, type, key press, etc.; via:"locator": Playwright locator operations
chrome_read Read text, attributes, visibility, counts, etc.
chrome_evaluate Evaluate within the page (read-only expressions)
chrome_wait Wait for URL, load, timeout, or selector
chrome_js Execute JS within the Codex runtime (agent / browser / tab in scope)
chrome_end_turn Release browser control for the current turn (corresponds to Codex Stop hook)

Recommended workflow (described in the skill): observe → act → observe; prioritize using element indices returned by the accessibility tree, and re-observe after every operation to refresh indices.

Example of a typical observation call (from README):

chrome_observe { "mode": "screenshot", "fullPage": true }

This captures a full-page screenshot of the current page in the user’s own Chrome without launching a separate headless browser.

Installation and Activation

DSH Desktop

Open the Plugin Manager within the application and install the bundle from this plugin directory (or install from the registry once published). The Desktop profile is managed exclusively by the application; the CLI command dsh plugin --profile desktop add … cannot be used (it will be rejected).

CLI profile (web, etc.)

Replace the path with the absolute path of your local clone or downloaded package:

dsh plugin --profile web add /absolute/path/to/dsh-codex-chrome

The equivalent manual approach: add the dependency and bundle entry to the profile’s package.json, then run pnpm install in the profile directory:

"dependencies": { "dsh-codex-chrome": "link:/path/to/dsh-codex-chrome" }
"dsh": { "profile": { "bundles": [ "…", "dsh-codex-chrome" ] } }

After installation and restart, you should see the eleven mcp__chrome__* tools and the control-chrome skill mentioned above.

Environment and Prerequisites

The development verification environment declared for this plugin in the README is Linux (Arch, Chrome 154, Wayland and X11). The following must be met before use:

  1. ChatGPT/Codex Desktop App must have been run at least once to generate ~/.codex/plugins/cache/openai-bundled/{chrome,browser}/… (including browser-client.mjs, browser-service.mjs, extension-host).
  2. The target browser has the ChatGPT/Codex browser extension installed, and the native messaging host com.openai.codexextension is registered (e.g., in ~/.config/google-chrome/NativeMessagingHosts/).
  3. The target browser is currently running.

Optional environment variables (partial list from the materials):

Variable Meaning
CODEX_HOME Codex home directory, default ~/.codex
DSH_CODEX_CHROME_NODE_REPL Absolute path to the node_repl executable (further explained in the truncated section of the README)

The maintainer provides self-check commands in the repository to locally verify package integrity, MCP handshake, and browser connectivity after installation:

node scripts/check-package.mjs
node --test
node scripts/doctor.mjs
node scripts/doctor.mjs --deep
node scripts/smoke.mjs

Use Cases and Notes

Who is it for: Developers already using Chrome extensions + native host in the Codex ecosystem who want agents to operate on the same set of browser states (open tabs, login sessions, cookies) within DSH sessions; suitable for automation tasks requiring accessibility tree-driven click/input, full-page screenshots, navigation, and simple DOM evaluation.

Permissions and Security: The plugin runs with the permissions of the current DSH process; browser operations are equivalent to the scope of operations available to the local user. Before installing, you should read the GitHub Source Code and the MIT License to confirm that the bridge and vendor script behaviors comply with your security policies.

Implementation Limitations (per README): Once the browser service is activated, the Codex kernel filesystem is read-only, and screenshots cannot be written to disk; they are returned via nodeRepl.emitImage and the bridge layer. Accessibility indices are bound to the observe call that generated them, and chrome_act re-reads the state before acting. The vendor screenshot path may mark JPEGs as PNG; the bridge corrects the type based on magic bytes to pass DSH validation.

Not applicable for: Environments without Codex cache and extensions, non-Linux platforms without self-verification, or scenarios expecting to completely detach from the OpenAI Codex runtime to use a pure DSH built-in browser stack—the design premise of this plugin is to reuse the browser service shipped with Codex.

Conclusion

dsh-codex-chrome brings the capabilities of Codex’s chrome@openai-bundled into DSH as native MCP tools, reducing the need to reinvent the browser automation wheel while retaining the user’s sessions and tabs in the real Chrome. To view the categorization and brief introduction, open the SkillHub Catalog Page; for installation, tool tables, and doctor scripts, refer to the GitHub Repository README.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye