Skip to content
dsh.fish
Bundle

dsh-agent-sync

DSH plugin that scans other AI agents on this machine (Codex, Claude Code, cc-switch, custom sources) and one-click syncs their MCP servers and skills into DeepSeek Harness.

Source
kuaiyukuaikuai
stars
4 stars
License
MIT
Updated
Updated 7 days ago

Readme

<div align="center">

# ๐Ÿฆพ dsh-agent-sync

**One-click sync of MCP servers & Skills from 20+ AI agents into DeepSeek Harness**

**English** | [็ฎ€ไฝ“ไธญๆ–‡](./README.zh-CN.md)

[![License](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)
[![Node](https://img.shields.io/badge/node-%3E%3D22.5-green)](./package.json)
[![DSH](https://img.shields.io/badge/DSH%20Plugin-v0.1.0-4f6ef7)](./package.json)
[![Awesome DSH Plugin](https://awesome-dsh-plugin.com/badge.svg)](https://awesome-dsh-plugin.com)
[![Plugin Market](https://img.shields.io/badge/DSH%20Plugin%20Market-awesome--dsh--plugin-8b93a1)](https://awesome-dsh-plugin.com/p/kuaiyukuaikuai/dsh-agent-sync/)
[![PR](https://img.shields.io/badge/PRs-welcome-16a34a)](https://github.com/kuaiyukuaikuai/dsh-agent-sync/pulls)

Scans other AI agents installed on this machine โ€” **Codex, Claude Code, cc-switch,
Hermes, opencode, Gemini, Grok, Kimi, CodeBuddy, Trae, OpenClaw, Qoder, WorkBuddy,
Zcode, Cursor, Windsurf, Cline, Roo Code, Qwen Code, โ€ฆ** โ€” and syncs their **MCP
servers** and **Skills** into DSH with one click.

</div>

---

## โœจ Features

| Capability | What it does |
|---|---|
| ๐Ÿ” Auto-scan | Reads each agent's real config (`~/.codex/config.toml`, `~/.claude.json`, `~/.cc-switch/cc-switch.db`, `~/.codebuddy/mcp.json`, `~/.workbuddy/.mcp.json`, โ€ฆ) and discovers MCP servers + Skills |
| โšก One-click sync MCP | Writes servers as `@deepseek-ai/dsh-mcp-client` instances into each profile's `cordis.patch.yml` (auto-repairs invalid YAML) โ†’ they become `mcp__<server>__<tool>` tools |
| ๐Ÿง  One-click sync Skills | Copies/links skill bundles into `$DSH_HOME/skills` (**global**) or `<workspace>/.dsh/skills` (**per-workspace**), auto-discovered by DSH's skill-filesystem provider |
| ๐Ÿ—‚๏ธ Scope-aware management | **MCP/Skills ็ฎก็†** page: enabled/disabled switch, remove, skills grouped by global + each workspace tab |
| โž• Add MCP / Skill | Manual add โ€” MCP by form (stdio / streamable-http), Skill from a **folder / single .md / .zip** (or drag & drop) into global or a workspace |
| โ‡„ Migrate Skills | Move or **copy** skills between global / workspaces (migrate dialog, multi-select) |
| ๐Ÿท๏ธ Skill groups | Create named groups, bind skills, filter the list by group |
| ๐Ÿ“„ Skill content view | Click a skill โ†’ detail modal shows metadata **and the SKILL.md body** |
| ๐Ÿ—‘๏ธ Delete confirm | Remove buttons arm a 3-second inline confirm (auto-reverts) |
| โš™๏ธ Config | **Skill sync mode** (copy / link/junction) + **MCP sync target** (all / desktop / web profiles) from the โš™๏ธ settings dialog |
| ๐Ÿ”€ Enable / Disable | Toggle any synced MCP server or skill on/off โ€” disabled MCPs are dropped from the profile patch, disabled skills have their `SKILL.md` renamed to `SKILL.md.disabled` (hidden, fully reversible) |
| ๐Ÿ–ฅ๏ธ GUI panel | Settings โ†’ **MCP/Skills**: centered MCP/Skills switch, capsule tabs & buttons, card grid, search |
| ๐Ÿ› ๏ธ Model tools | `agent_sync_scan` / `agent_sync_do` / `agent_sync_status` / `agent_sync_config` / `agent_sync_add_skill` / `agent_sync_toggle` / `agent_sync_remove` / `agent_sync_sources` |
| ๐Ÿงฉ Extensible | A generic agent registry (`AGENT_DEFS`) โ€” adding a new agent is one line |

## ๐Ÿ“ธ Screenshots

| MCP/Skills ็ฎก็† | MCP/Skills ๅŒๆญฅ | ๆทปๅŠ ๆŠ€่ƒฝ |
|---|---|---|
| ![main](assets/screenshot-main.png) | ![sync](assets/screenshot-sync.png) | ![add](assets/screenshot-add.png) |

## ๐Ÿš€ Quick start

### Prerequisites

- A running DSH (desktop or headless) with **Node.js โ‰ฅ 22.5**
- The agents you want to sync must be installed on the same machine (nothing is shipped with the plugin)

### Install

**Option A โ€” as a profile bundle (recommended)**

Add `dsh-agent-sync` to your profile's `dsh.profile.bundles` and install it:

```bash
cd "$DSH_HOME/profiles/<name>"
pnpm add dsh-agent-sync        # or: pnpm add github:kuaiyukuaikuai/dsh-agent-sync
```

Restart DSH. The bundled [`cordis.patch.yml`](./cordis.patch.yml) mounts the plugin automatically.

**Option B โ€” manual row**

Place the package where your profile can resolve it, then append to
`$DSH_HOME/profiles/<name>/cordis.patch.yml`:

```yaml
- insert:
    - id: dsh-agent-sync
      name: 'dsh-agent-sync'
```

Restart DSH.

## ๐Ÿ“– Usage

### GUI panel

**Settings โ†’ MCP/Skills** (main page **MCP/Skills ็ฎก็†**)

- **Manage (main page)** โ€” a centered **MCP / Skills** switch; card grid where each card has a **toggle switch** (enable/disable in one control) and a **remove button with a 3-second inline confirm**; disabled items are greyed with a badge. **Skills are grouped by scope**: global (`~/.dsh/skills`) and per-workspace (`<workspace>/.dsh/skills`) with workspace tabs + a search box + skill-group filter chips.
- **Toolbar (right of the switch)** โ€” **โ‡„ ่ฟ็งปๆŠ€่ƒฝ** (migrate/copy skills between scopes) and **๏ผ‹ ๆทปๅŠ  MCP / ๏ผ‹ ๆทปๅŠ  Skill** (manual add).
- **MCP/SkillsๅŒๆญฅ โ†’** โ€” a button that opens the sync page: per-source tabs (common agents + "More โ–พ"), select-all, sync buttons (choose **global or a workspace** as the skill target), custom sources.
- **๏ผ‹ ๆทปๅŠ  Skill** dialog โ€” pick a **folder** (bundle), a **single .md**, or a **.zip** โ€” or **drag & drop** any of those onto the dialog; choose the target scope (global / workspace).
- **โš™๏ธ ่ฎพ็ฝฎ** dialog โ€” **Skill ๅŒๆญฅๆ–นๅผ** (copy / link=junction) and **MCP ๅŒๆญฅ็›ฎๆ ‡** (all / desktop / web profiles).

> **UI implementation** โ€” no component library. The panel is vanilla React (`React.createElement`) styled with DSH's theme tokens (`--dsw-alias-*`), capsule tabs/buttons, and a small custom CSS toggle switch.

### Model tools

```
agent_sync_scan        # list what can be synced (env values are hidden, keys only)
agent_sync_do          # mcp/skills: ["all"] or names; scope: global or a workspace path
agent_sync_config      # get/set { skillSyncMode: copy|link, syncProfiles: all|desktop|web }
agent_sync_add_skill   # add a skill from a local directory (SKILL.md) or .md file, scope optional
agent_sync_toggle      # enable/disable a synced mcp/skill ({type, name, enabled})
agent_sync_status      # current DSH-side state + sync bookkeeping (incl. disabled items)
agent_sync_remove      # remove a synced mcp/skill
agent_sync_sources     # manage custom sources (list / add / delete)
```

## ๐Ÿ“ฆ Supported agents

| Source | Config read |
|---|---|
| Codex | `~/.codex/config.toml` (`mcp_servers`) + `~/.codex/skills` |
| Claude Code | `~/.claude.json`, `~/.claude/settings.json` + skills + plugins |
| cc-switch | `~/.cc-switch/cc-switch.db` (`mcp_servers` / `skills` tables) |
| Hermes | `~/.hermes/config.{yaml,yml,json}` |
| opencode | `~/.config/opencode/{opencode,config}.json` |
| Gemini | `~/.gemini/settings.json` |
| Grok | `~/.grok/config.*` |
| Kimi | `~/.kimi/config.toml` (`mcp.*`) |
| CodeBuddy | `~/.codebuddy/mcp.json` |
| Trae | `~/.trae-cn/mcp.json` |
| OpenClaw | `~/.openclaw` / `~/.clawdbot` `config.*` |
| Qoder | `~/.qoder*/mcp.json` |
| WorkBuddy | `~/.workbuddy/.mcp.json` |
| Zcode | `~/.zcode/config.json` |
| Lingma | `~/.lingma/mcp.json` |
| CodeMoss | `~/.codemoss/config.json` |
| Copilot | `~/.copilot/mcp.json` |
| Cursor | `~/.cursor/mcp.json` |
| Windsurf | `~/.codeium/windsurf/mcp_config.json` |
| Cline | `~/.cline/mcp_settings.json` |
| Roo Code | `~/.roo/mcp_settings.json` |
| Qwen Code | `~/.codeqwen/mcp.json` |
| Custom | your own sources (JSON / TOML / skills directory) |

All paths are home-relative โ†’ **works on any machine** where those agents are installed
(Windows / macOS / Linux). Configs in JSON, YAML-ish, and TOML shapes are parsed.

## ๐Ÿ”ง How it works

```
other agents' configs โ”€โ”€โ–บ scan โ”€โ”€โ–บ sync โ”€โ”€โ–บ DSH
  ~/.codex/...                     โ”‚
  ~/.claude.json                   โ”œโ”€ MCP   โ†’ profiles/*/cordis.patch.yml (dsh-mcp-client rows)
  ~/.cc-switch/cc-switch.db        โ”‚
  ~/.workbuddy/.mcp.json           โ””โ”€ Skills โ†’ $DSH_HOME/skills/<name>/SKILL.md
  ...
```

- **MCP** is written into each profile's `cordis.patch.yml` (a managed `# --- dsh-agent-sync managed ---` section, repaired if the file was invalid). The desktop GUI shell composes once at boot, so **MCP activates on the next DSH restart**; the `dsh` CLI / headless boot hot-applies profile patches via HMR.
- **Skills** are copied (default) or **linked via junction** (`skillSyncMode: link`) into `$DSH_HOME/skills` (global) or `<workspace>/.dsh/skills` (per-workspace), and discovered by sessions whose agent preset mounts the `skill-filesystem` provider. In link mode, disabling a skill removes the junction (never touches the source); enabling recreates it.

## โš ๏ธ Security notes

- Syncing MCP **copies env values verbatim** (DB passwords, API keys, โ€ฆ) into `cordis.patch.yml` and `$DSH_HOME/agent-sync/state.json` โ€” same plaintext exposure as the source configs already have.
- Scan output only lists **env key names, never values**.
- Treat `state.json` / patch files as secrets; consider a token with an expiry and prefer environment-variable references where possible.

## โ“ FAQ

**Why don't I see any MCP/Skills?**
Nothing is installed on the machine yet, or that agent stores its config elsewhere. The `custom` source lets you point at any JSON/TOML/skills directory.

**Do I need to restart DSH after syncing MCP?**
Yes โ€” the desktop GUI shell composes its profile once at boot. The `dsh` CLI/headless path hot-applies profile patches.

**Can I remove something?**
Yes โ€” the GUI's **MCP/Skills ็ฎก็†** page has remove buttons (with a 3-second inline confirm), or use `agent_sync_remove`.

## ๐Ÿง‘โ€๐Ÿ’ป Development

```bash
pnpm install
pnpm test          # node --test
```

```
index.mjs        Host plugin: scanners, sync, HTTP routes (in-process, Node built-ins only)
client.js        Browser panel (lazy-CJS, zero build) โ€” registers Settings โ†’ MCP/SkillsๅŒๆญฅ
cordis.patch.yml Bundle patch that mounts the plugin row
plugin-market.json  DSH plugin market submission entry
```

## ๐Ÿ›’ DSH Plugin Market

Listed in the [awesome-dsh-plugin](https://github.com/awesome-dsh-plugin/awesome-dsh-plugin) community curated list โ€” find it in **DSH โ†’ Settings โ†’ Plugin Market**, on [awesome-dsh-plugin.com](https://awesome-dsh-plugin.com/p/kuaiyukuaikuai/dsh-agent-sync/), or install directly:

```bash
dsh plugin --profile web add github:kuaiyukuaikuai/dsh-agent-sync
```

## ๐Ÿ“„ License

[MIT](./LICENSE)

Install

dsh plugin --profile web add github:kuaiyukuaikuai/dsh-agent-sync

Profile: web

  • This source has no pinned commit, so a later push upstream changes what installs. Prefer pinning a commit.
Source