somebdly/dsh-docker0

dsh-docker

Docker MCP Gateway 管理面板:经 SSH 在远端服务器执行 docker mcp 命令,管理 Docker MCP(列出/部署/移除 profile 中的 MCP、搜索/拉取 Docker MCP Catalog)。免构建(纯 ESM:Host 端 Node 原生 import + spawn python paramiko,Client 端零依赖纯 DOM)。

包名
dsh-docker
版本
0.1.0
许可证
MIT
最近更新
2026年9月7日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:somebdly/dsh-docker

方式二:手工配置

  1. ~/.dsh/profiles/web/package.jsondependencies 增加:

    "dsh-docker": "file:"
    
  2. dsh.profile.bundles 数组追加 dsh-docker

  3. ~/.dsh/profiles/web/cordis.patch.yml 保留:

    - insert:
        - id: dsh-docker
          name: 'dsh-docker'
    
  4. 在 profile 目录执行 npm install,重启 dsh web

安装后侧边栏出现「Docker」入口,点击打开管理面板。


⚙️ 配置

配置来源优先级:环境变量 > ~/.dsh/dsh-docker/config.json > cordis 行内 config

环境变量

环境变量说明
MCPGW_SSH_HOSTSSH 主机
MCPGW_SSH_PORTSSH 端口(默认 22)
MCPGW_SSH_USERSSH 用户
MCPGW_SSH_PWDSSH 密码(建议用 env,不写进 config.json)
MCPGW_SSH_AUTH认证方式:password(默认)或 key
MCPGW_SSH_KEY私钥路径(auth=key 时使用)
MCPGW_SSH_PASSPHRASE私钥口令(可选)

运行时配置(~/.dsh/dsh-docker/config.json,位于用户主目录、勿提交 git)

{
  "pollIntervalMs": 8000,
  "activeTargetId": "remote",
  "targets": [
    {
      "id": "local",
      "name": "本机 Docker",
      "type": "local",
      "dockerPath": ""
    },
    {
      "id": "remote",
      "name": "远端服务器",
      "type": "ssh",
      "ssh": {
        "host": "203.0.113.10",
        "port": 22,
        "user": "root",
        "auth": "password",
        "password": ""
      }
    }
  ]
}

旧版单 ssh 配置会自动迁移为 targets 数组中的 SSH 目标。

推荐配置方式

  1. 插件「连接设置」弹窗(推荐):侧边栏「Docker」→ 右上「设置」→ 填写 SSH host / port / user,选择认证方式(密码或密钥),保存。密码经 DPAPI 加密落盘,界面不回显。
  2. 环境变量:适合脚本/CI,不落盘。
  3. 手工写 config.json:如上示例。

运行时配置(~/.dsh/dsh-docker/config.json,位于用户主目录、勿提交 git)

{
  "pollIntervalMs": 8000,
  "activeTargetId": "remote",
  "targets": [
    {
      "id": "local",
      "name": "本机 Docker",
      "type": "local",
      "dockerPath": ""
    },
    {
      "id": "remote",
      "name": "远端服务器",
      "type": "ssh",
      "ssh": {
        "host": "203.0.113.10",
        "port": 22,
        "user": "root",
        "auth": "password",
        "password": ""
      }
    }
  ]
}

旧版单 ssh 配置会自动迁移为 targets 数组中的 SSH 目标。

推荐配置方式

  1. 插件「连接设置」弹窗(推荐):侧边栏「Docker」→ 右上「设置」→ 填写 SSH host / port / user,选择认证方式(密码或密钥),保存。密码经 DPAPI 加密落盘,界面不回显。
  2. 环境变量:适合脚本/CI,不落盘。
  3. 手工写 config.json:如上示例。

🖥️ 使用

面板布局

  • 顶部:管理目标选择器(本机 / SSH 远端)+ 连接状态指示 + 设置按钮
  • MCP tab:已部署(deployed)/ 仓库(catalog)两个子页
    • 已部署:查看 profile 中的 MCP servers,部署/移除
    • 仓库:搜索官方 Docker MCP Catalog,一键部署
  • 容器 tab:容器(ps)/ 镜像(images)两个子页
    • 容器:列表、启停/重启/删除、日志、详情、进入终端、清理停止容器、新建容器
    • 镜像:拉取、构建、导入、运行、单个删除、批量勾选删除

交互式容器终端(仅 SSH 目标)

  1. 在容器列表点击「终端」
  2. 面板内打开 docker exec -it sh 交互式 shell(PTY)
  3. 支持实时输入输出、窗口尺寸调整、关闭会话

自定义部署 MCP

  • 远端 https 地址:直接填 MCP server URL
  • 本地镜像:先在本机 docker pull 成功,再填镜像地址;gateway 以 --pull never 加载本地镜像
  • 写入目标 profile 的 working_set 后需重启 gateway 生效(面板一键重启,自动带 --verify-signatures=false 解决镜像签名校验访问 Docker Hub CDN 被墙的问题)