# Dsh Codex Migrate

> Migrate Codex CLI conversations / MCP servers / memories into DeepSeek Harness ｜ 把 Codex CLI 的对话、MCP、记忆迁移到 DeepSeek Harness

- **Type:** MCP server
- **Install:** `agentstack add mcp-polarskicpl-dsh-codex-migrate`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [polarskicpl](https://agentstack.voostack.com/s/polarskicpl)
- **Installs:** 0
- **Category:** [Integrations](https://agentstack.voostack.com/c/integrations)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [polarskicpl](https://github.com/polarskicpl)
- **Source:** https://github.com/polarskicpl/dsh-codex-migrate
- **Website:** https://www.npmjs.com/package/dsh-codex-migrate

## Install

```sh
agentstack add mcp-polarskicpl-dsh-codex-migrate
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# dsh-codex-migrate

  

[中文](#中文) · [English](#english)

## 中文

把 [Codex CLI](https://github.com/openai/codex) 的历史迁移进
[DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness)(DSH):

- **对话 → 真正的 DSH 会话**:用户轮次、助手轮次与工具调用按 DSH 原生事件格式
  转换(工具卡片默认折叠),按项目挂载到对应工作区,侧边栏直接可见、可续聊。
- **MCP 服务器 → 注册行**:`config.toml` 的 `[mcp_servers.*]` 变成
  `@deepseek-ai/dsh-mcp-client` cordis 行,并生成一段可直接复制给任意 agent 的
  **注册提示词**,让 agent 帮你完成注册。
- **记忆与 AGENTS.md**:复制到输出目录。
- **项目文件(可选)**:按项目复制文本文件。

内置中英双语(界面跟随 DSH 语言;生成产物跟随 `language` 配置)。

### 安装

```bash
dsh plugin --profile web add dsh-codex-migrate
```

(或手动把 `cordis.patch.yml` 里的行合并进你的 profile patch),然后重启 DSH。
设置面板位于 **设置 → Codex 迁移**。

包发布在 npm:[dsh-codex-migrate](https://www.npmjs.com/package/dsh-codex-migrate)
(`dsh plugin add` 按包名从 npm registry 拉取;源码见
[GitHub 仓库](https://github.com/polarskicpl/dsh-codex-migrate))。

### 配置

| 键 | 默认 | 含义 |
| --- | --- | --- |
| `codexDir` | `''` | Codex 数据目录;留空 = 自动检测(`~/.codex`) |
| `outputDir` | `''` | 产物目录;留空 = `/codex-sync` |
| `language` | `en` | 生成产物的语言:`en` \| `zh` \| `auto`(跟随界面语言) |
| `sessionMode` | `new` | `all` \| `new` \| `selected` |
| `projectMode` | `all` | `all` \| `selected` |
| `includeSubagentSessions` | `false` | 子智能体线程默认隐藏 |
| `importAsDshSessions` | `true` | 生成真正的 DSH 会话(取消则只出 Markdown) |
| … | | 频率、上限、MCP/记忆开关等,见 `cordis.patch.yml` |

### 生成产物(`outputDir`)

```
codex-sync/
├── config.json / state.json / diagnostics.json
├── index.md                     # 会话索引
├── sessions/*.md                # 每个会话的 Markdown
├── projects/                    # 可选的项目文件副本
├── memories/ , AGENTS.md
└── mcp/
    ├── cordis-mcp-rows.yml      # 可直接合并的 insert 块
    ├── report.md
    └── register-prompt.md       # 发给任意 agent 即可完成注册
```

### 安全边界

这是一个**宿主插件**:运行在 DSH 进程中,没有会话级沙箱。它**只写
`outputDir` 内部、只读 Codex 目录**。注册迁移过来的 MCP 之前请先审阅你的
Codex MCP 配置——注册后这些工具对会话内所有 agent(含子代理)可见;SSH 类
服务器建议使用命令白名单(`--whitelist` / `commandWhitelist`)而非黑名单。

### 开发

```bash
npm run build          # 把浏览器面打包成 lib/client.js
```

宿主面是纯 ESM,无需构建;浏览器面把 `src/client/index.js` 包装成 DSH Web 外壳
消费的 `window.__ModuleLoader__.load` 形式(运行时 require 由装载器的模块表解析)。

### 许可证

MIT

---

## English

Migrate your [Codex CLI](https://github.com/openai/codex) history into
[DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (DSH):

- **Conversations → real DSH sessions**: user turns, assistant turns and tool
  calls are converted into native DSH event format (tool cards collapse by
  default), mounted into per-project workspaces, and appear in the sidebar.
- **MCP servers → registration rows**: `config.toml` `[mcp_servers.*]` entries
  become `@deepseek-ai/dsh-mcp-client` cordis rows, plus a copy-paste
  **registration prompt** you can hand to any agent to complete the
  registration for you.
- **Memories & AGENTS.md**: copied into the output directory.
- **Project files (optional)**: text files copied per project.

English and Chinese are both built in (UI follows the DSH locale; generated
artifacts follow the `language` config).

### Install

```bash
dsh plugin --profile web add dsh-codex-migrate
```

(or add the row from `cordis.patch.yml` to your profile patch manually), then
restart DSH. The settings panel appears under **Settings → Codex Migration**.

The package is published on npm:
[dsh-codex-migrate](https://www.npmjs.com/package/dsh-codex-migrate)
(`dsh plugin add` resolves the name from the npm registry; source lives in the
[GitHub repository](https://github.com/polarskicpl/dsh-codex-migrate)).

### Configure

| Key | Default | Meaning |
| --- | --- | --- |
| `codexDir` | `''` | Codex data dir; empty = auto-detect (`~/.codex`) |
| `outputDir` | `''` | Where artifacts live; empty = `/codex-sync` |
| `language` | `en` | `en` \| `zh` \| `auto` (follow UI locale) for generated artifacts |
| `sessionMode` | `new` | `all` \| `new` \| `selected` |
| `projectMode` | `all` | `all` \| `selected` |
| `includeSubagentSessions` | `false` | Subagent threads are hidden by default |
| `importAsDshSessions` | `true` | Create real DSH sessions (uncheck for Markdown-only) |
| … | | frequency, caps, MCP/memories toggles — see `cordis.patch.yml` |

### Generated artifacts (`outputDir`)

```
codex-sync/
├── config.json / state.json / diagnostics.json
├── index.md                     # session index
├── sessions/*.md                # per-session Markdown
├── projects/                    # optional project file copies
├── memories/ , AGENTS.md
└── mcp/
    ├── cordis-mcp-rows.yml      # DSH-ready insert block
    ├── report.md
    └── register-prompt.md       # paste to any agent to finish registration
```

### Security boundary

This is a **host plugin**: it runs in the DSH process without a per-session
sandbox. It only **writes inside `outputDir`** and only **reads the Codex
directory**. Review your Codex MCP config before registering migrated MCP
servers — after registration those tools are visible to every agent in a
session, including subagents. For SSH-style servers prefer a command
whitelist (`--whitelist` / `commandWhitelist`) over a blacklist.

### Development

```bash
npm run build          # bundles the client half into lib/client.js
```

The host half is plain ESM and needs no build step. The client half wraps
`src/client/index.js` into the `window.__ModuleLoader__.load` form consumed by
the DSH web shell (runtime requires are resolved by the loader's module table).

### License

MIT

## Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [polarskicpl](https://github.com/polarskicpl)
- **Source:** [polarskicpl/dsh-codex-migrate](https://github.com/polarskicpl/dsh-codex-migrate)
- **License:** MIT
- **Homepage:** https://www.npmjs.com/package/dsh-codex-migrate

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/mcp-polarskicpl-dsh-codex-migrate
- Seller: https://agentstack.voostack.com/s/polarskicpl
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
