The core philosophy of DeepSeek Harness (DSH) is “everything is a plugin.” DeepSeek’s multimodal models (such as deepseek-v4-flash-vision-exp) natively support image input and understanding, allowing them to directly process pasted images. However, image generation and editing usually require additional API calls or complex local deployment. This plugin provides a solution: it uses the locally installed Codex CLI, already logged in with ChatGPT Plus, to handle image generation and editing tasks.

dsh-codex-media is a Codex extension designed for DeepSeek Harness (DSH). It registers four tools through the MCP (Model Context Protocol), enabling DSH to invoke the local Codex CLI to generate images, edit images, save clipboard images, and delegate independent tasks. The plugin is maintained by yujianjian1013 and licensed under the MIT License.

Core Features

The plugin includes the following core capabilities:

  1. Image generation (generate_image): Calls the image_generation model hosted by Codex and outputs the generated image to a specified path.
  2. Image editing (edit_image): Supports redrawing with a reference image. The reference image can be a local path, a SHA256 attachment ID, or clipboard input.
  3. Clipboard image save (clipboard_to_image): Saves the image in the clipboard to local storage. On Windows, it must be used with PowerShell single-threaded mode (pwsh -STA); on non-Windows platforms, this input source is unavailable, while the other features work normally.
  4. Codex subagent (codex_task): Delegates an independent non-image-processing task (such as reading/writing files or executing commands) to local Codex to reduce DeepSeek token consumption.

Installation and Activation

Before installation, ensure the environment meets the following dependencies:

  • DeepSeek Harness (DSH) >= 0.1.0-rc.6
  • Node.js >= 22.19
  • Local Codex CLI is installed and logged in to ChatGPT (image generation and editing require Plus subscription quota)
  • Operating system is Windows (the clipboard feature requires PowerShell single-threaded mode support)

The installation command is:

dsh plugin --profile web add github:yujianjian1013/dsh-codex-media

After installation, add an MCP server configuration to DSH’s cordis.patch.yml; otherwise, the tools cannot be registered. The reference configuration is:

- insert:
    - id: mcp-codexmedia
      name: '@deepseek-ai/dsh-mcp-client'
      config:
        serverName: codexmedia
        transport: stdio
        command: node
        args: !!js '(() => { const { createRequire } = process.getBuiltinModule("node:module"); const home = process.env.DSH_HOME || ((process.env.USERPROFILE || "") + "/.dsh"); return [createRequire(home + "/profiles/web/package.json").resolve("dsh-codex-media/mcp/server.mjs")]; })()'

After modifying the configuration, restart dsh web and refresh the page to apply the changes.

Typical Usage

  • Image understanding: Use DeepSeek’s multimodal model directly. After pasting an image, the model receives it as an image block without plugin intervention.
  • Image generation: Say something like “Draw a …” in the conversation. The model detects the intent and calls the generate_image tool.
  • Image editing: Paste a reference image and say “Change it to …”. The model calls the edit_image tool to redraw it.
  • Clipboard save: Say “Save the clipboard image to X” in the conversation. The model calls the clipboard_to_image tool to save the image.
  • Codex subagent: For code tasks, say “Please help me read and modify /path/to/file”. The model calls the codex_task tool, which is executed by local Codex.

Notes

  • Cost: Image generation and editing consume ChatGPT subscription image quota, not DeepSeek tokens.
  • Storage: Generated images are saved by default under the ~\.codex\generated_images directory. It is recommended to clean this directory regularly.
  • Connection stability: When Codex connects to chatgpt.com, if the WebSocket connection is occasionally reset (error code 10054), the plugin automatically falls back and retries over HTTPS. This is normal behavior.

Ecosystem Context

The DeepSeek Harness ecosystem emphasizes “everything is a plugin.” This plugin is maintained on GitHub and can be viewed in the Skill Hub catalog. It has no direct affiliation with DeepSeek officially.