image-gen-mcp: DeepSeek Harness Image Generation Plugin

Preface

The DeepSeek Harness (DSH) plugin ecosystem allows users to extend model capabilities without modifying core logic. image-gen-mcp is designed to address the issue of models requiring image generation but lacking a standard interface. By connecting to any image generation endpoint compatible with the OpenAI format, this plugin exposes standardized tools to the model, enabling it to directly invoke image generation functions.

What is it

image-gen-mcp is a DeepSeek Harness plugin maintained by bauerelizabeth07139, categorized under “Model Inference”.

Its core function is to encapsulate image generation capabilities as MCP (Model Context Protocol) tools. Once the plugin is successfully mounted, the model gains two tools: image_generate (generate images) and image_config_status (check configuration status), along with a built-in skill that guides the model to follow the correct workflow when invoking these tools.

Installation and Configuration

Environment Requirements

Running the plugin requires Node.js ≥ 22.

Installation Steps

Install the plugin to a specified profile (e.g., web) via the DSH CLI:

dsh plugin --profile web add bauerelizabeth07139/image-gen-mcp

In DeepSeek Harness Desktop, you can enter the repository address above in the “Add plugin” dialog within the plugin sidebar, or directly input the GitHub shorthand.

Configuration Description

When mounting the plugin, the backend address and credentials must be provided; otherwise, no tools will be mounted. Configuration items are injected via environment variables or the plugin configuration table.

Configuration Item List:

Config Item Environment Variable Default Value Description
baseUrl IMAGE_GEN_BASE_URL None Backend base URL, excluding /v1
apiKey IMAGE_GEN_API_KEY None Backend API Key
model IMAGE_GEN_DEFAULT_MODEL Empty Default model name; uses dall-e-3 in openai mode and gpt-image-1 in generic mode if empty
provider IMAGE_GEN_PROVIDER generic Specify response format: generic (URL response) or openai (base64 response)
timeoutMs IMAGE_GEN_TIMEOUT_MS 30000 Server-side HTTP timeout duration
toolCallTimeoutMs - 120000 DSH timeout budget for each tool call
env - {} Pass-through of raw environment variables

Configuration Example:

- id: dsh-image-gen-mcp
  name: 'dsh-image-gen-mcp'
  config:
    baseUrl: 'https://api.example.com'
    apiKey: 'sk-...'
    model: 'gpt-image-1'
    provider: 'generic'

Security Note: The plugin explicitly forwards credentials, while DeepSeek Harness cleans variables resembling KEY, TOKEN, SECRET, etc., from the environment inherited by child processes to prevent credential leakage.

Usage

Upon successful mounting of the plugin, the model automatically acquires the following two tools:

  1. mcp__image_generation__image_config_status
    Checks if baseUrl and apiKey are correctly configured. When image generation fails for unknown reasons, this tool should be prioritized to troubleshoot configuration issues.

  2. mcp__image_generation__image_generate
    Executes image generation. The required parameter is prompt, with optional parameters including model, size, and n.

The model automatically handles the workflow via the plugin’s built-in skill (located at skills/image-generation/SKILL.md): it first calls image_config_status, then calls image_generate after confirming everything is correct, and finally returns the generated image artifact or specific error messages.

Notes

  • Base URL Format: When configuring baseUrl, do not include /v1; the plugin automatically appends the path during requests.
  • Transport Protocol: DSH’s MCP client reads Newline Delimited JSON (NDJSON), whereas the plugin backend service expects an LSP-like Content-Length framing format. The plugin performs byte-level format conversion between the two via bridge.mjs; otherwise, the handshake would time out.
  • Permissions and Source: The plugin runs with the permissions of the current DSH process. Before use, it is recommended to review the source code and license (MIT) to ensure compliance with security and regulatory requirements.
  • Version Compatibility: Requires a DeepSeek Harness version that satisfies the constraints defined in the dsh field (typically >=0.1.5-rc.1 <0.2.0-0 || >=0.2.0-rc.0 <0.3.0-0).

Conclusion

image-gen-mcp provides a standardized way for models to access third-party image generation services through DeepSeek Harness. By utilizing built-in skills, it reduces the error rate of manual tool handling by the model, making it suitable for scenarios requiring multimodal generation capabilities.

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

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

Xiaoye