dsh-mcp-connectors 0.1.3 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/CHANGELOG.zh-CN.md +15 -0
- package/README.md +20 -3
- package/README.zh-CN.md +21 -4
- package/lib/board-css.js +85 -0
- package/lib/catalog-data.js +198 -0
- package/lib/client.js +100 -11
- package/lib/cordis.js +493 -0
- package/lib/core.js +143 -4
- package/lib/index.js +95 -0
- package/lib/mcpso.js +295 -0
- package/lib/registry.js +274 -0
- package/lib/sources.js +6 -2
- package/lib/workbuddy.js +203 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,27 @@ All notable changes to this project are documented here. Format follows [Keep a
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [0.2.0] - 2026-11-18
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- Support DSH's real MCP configuration format: `~/.dsh/profiles/<profile>/cordis.patch.yml` (`@deepseek-ai/dsh-mcp-client` entries). Each profile appears as its own source under the DSH group; reads, adds, edits, deletes, and native `disabled` toggling are supported, and rewrites touch only the target entry's `config:` block so comments and other plugins survive.
|
|
12
|
+
- The previous `~/.dsh/mcp.json` path is still read for backward compatibility.
|
|
13
|
+
- Connector catalog: the seven official `modelcontextprotocol/servers` reference servers are built in, and the official MCP Registry can be searched live. Install into one or more agents at once, then toggle or uninstall from the catalog. Required parameters (directories, repository paths, tokens) are collected up front; Windows DSH targets get `cmd /c npx|uvx` automatically.
|
|
14
|
+
- Connector detail view: repository / website links, package, transport, registry name, launch command with parameter placeholders, environment variables, install parameters, and the agents it is installed in. Cards also link to the repository directly. Registry entries are not all from GitHub; the detail view says so when no repository is attached.
|
|
15
|
+
- The detail view lazily fetches and renders the GitHub repository README (headings / lists / code blocks / links; long files truncated to 600 lines with a GitHub link). Fetching is restricted to github.com → raw.githubusercontent.com and cached for 30 minutes.
|
|
16
|
+
- Online (MCP Registry) is now the default catalog tab and supports cursor pagination via "Load more" — the official `modelcontextprotocol/servers` repo intentionally only maintains a handful of reference implementations.
|
|
17
|
+
- New "mcp.so Top 100" source: reads only the mcp.so rankings page (respects robots.txt and never touches its `/search`), showing rank, author, description, monthly searches, stars and score. Successful fetches are cached to disk; network failures fall back to the last snapshot with an explicit stale marker.
|
|
18
|
+
- mcp.so entries are now installable: clicking Details / Install fetches the entry's detail page on demand, parses its `mcpServers` config (including `${VAR}` / `YOUR_TOKEN` credential placeholders) and opens the normal install form. Pages without a usable config degrade to a link to mcp.so. Detail responses are cached for 30 minutes with a local fallback.
|
|
19
|
+
- Removed the "Official reference" tab. The 7 built-in reference implementations now appear only as an offline fallback when every online source fails and WorkBuddy is not installed.
|
|
20
|
+
- New "WorkBuddy connectors" source: reads the local WorkBuddy official connector marketplace cache (318 entries, 272 installable MCP connectors, the rest CLI). MCP connectors keep WorkBuddy's `${VAR}` credential placeholders and install back into `~/.workbuddy/connectors/default/mcp.json` using the `connector:<id>` convention — real credentials stay in WorkBuddy's own key store and are never written to config by the plugin. CLI connectors are browse-only. The source is hidden entirely when WorkBuddy is not installed.
|
|
21
|
+
|
|
22
|
+
## [0.1.4] - 2026-11-18
|
|
23
|
+
|
|
24
|
+
### 变更
|
|
25
|
+
|
|
26
|
+
- Also publishes to GitHub Packages (`@elegant01/dsh-mcp-connectors`) so the repo sidebar shows the package.
|
|
27
|
+
|
|
7
28
|
## [0.1.3] - 2026-11-18
|
|
8
29
|
|
|
9
30
|
### 变更
|
package/CHANGELOG.zh-CN.md
CHANGED
|
@@ -4,6 +4,21 @@
|
|
|
4
4
|
|
|
5
5
|
## [未发布]
|
|
6
6
|
|
|
7
|
+
## [0.2.0] - 2026-11-18
|
|
8
|
+
|
|
9
|
+
### 新增
|
|
10
|
+
|
|
11
|
+
- 支持 DSH 真实的 MCP 配置形态:`~/.dsh/profiles/<profile>/cordis.patch.yml`(`@deepseek-ai/dsh-mcp-client` 条目)。每个 profile 在 DSH 分组下单独列出;支持读取、新增、编辑、删除,以及原生 `disabled` 启停。写入只替换目标条目的 `config:` 块,注释与其它插件配置原样保留。
|
|
12
|
+
- 旧的 `~/.dsh/mcp.json` 路径继续兼容读取。
|
|
13
|
+
- 连接器目录:内置 `modelcontextprotocol/servers` 的 7 个官方参考服务器,并可在线搜索官方 MCP Registry。可一次安装到多个 Agent,装好后直接在目录里启停或卸载;必填参数(目录、仓库路径、Token 等)在安装前收集,Windows 上的 DSH 目标会自动包成 `cmd /c npx|uvx`。
|
|
14
|
+
- 连接器详情页:显示仓库 / 官网地址、包名、传输方式、registry 名称、带占位符说明的启动命令、环境变量、安装参数和已安装的 Agent;列表卡片也直接带「仓库地址」链接。Registry 条目不是都来自 GitHub,没有仓库地址时详情页会明确提示。
|
|
15
|
+
- 详情页按需抓取并渲染 GitHub 仓库 README(标题 / 列表 / 代码块 / 链接,长文截断到 600 行并给出 GitHub 链接);抓取只允许 github.com → raw.githubusercontent.com,缓存 30 分钟。
|
|
16
|
+
- 「在线发现」改为默认 Tab,并支持游标分页「加载更多」——官方 `modelcontextprotocol/servers` 仓库本来就只维护少量参考实现,完整目录在 MCP Registry。
|
|
17
|
+
- 新增「mcp.so 热门」来源:只抓取 mcp.so 排行榜 Top 100(遵守 robots.txt,不碰它的 /search),展示排名、作者、简介、月搜、星标和评分;成功结果落盘缓存,网络失败时回退到上次快照并明确标注。
|
|
18
|
+
- mcp.so 支持详情与安装:点「详情 / 安装」时按需抓取该条目详情页,解析其中的 `mcpServers` 配置(含 `${VAR}` / `YOUR_TOKEN` 等凭据占位符),转成安装表单;没有可用配置时退化为跳转 mcp.so。详情结果缓存 30 分钟,失败时回退本地快照。
|
|
19
|
+
- 移除「官方参考」Tab。在线来源都失败且本机没有 WorkBuddy 时,才在空状态里露出内置的 7 个官方参考实现作为断网兜底。
|
|
20
|
+
- 新增「WorkBuddy 连接器」来源:读取本机 WorkBuddy 官方连接器市场缓存(318 条,272 个可安装 MCP,其余为 CLI 类型)。MCP 类型保留 WorkBuddy 的 `${VAR}` 凭据占位符并安装回 `~/.workbuddy/connectors/default/mcp.json`(`connector:<id>` 命名),凭据仍由 WorkBuddy 自己的 key store 保管、不写入配置;CLI 类型只展示不安装;没装 WorkBuddy 时该来源不出现。
|
|
21
|
+
|
|
7
22
|
## [0.1.1] - 2026-11-17
|
|
8
23
|
|
|
9
24
|
### 变更
|
package/README.md
CHANGED
|
@@ -25,10 +25,11 @@ This plugin auto-discovers those files, shows them in one panel, and lets you to
|
|
|
25
25
|
## Features
|
|
26
26
|
|
|
27
27
|
- **Auto-discovery** — scans `~`, `%APPDATA%` and `%LOCALAPPDATA%` (macOS/Linux equivalents included), identifies configs by file name **and** content (`mcpServers` / `mcp` keys, `[mcp_servers]` sections). First scan ≈250 ms on a typical dev machine, then cached.
|
|
28
|
-
- **Multi-format support** — JSON (`mcpServers`), OpenCode-style (`mcp`), Codex TOML (`[mcp_servers.*]
|
|
28
|
+
- **Multi-format support** — JSON (`mcpServers`), OpenCode-style (`mcp`), Codex TOML (`[mcp_servers.*]`), DSH's `cordis.patch.yml` (`@deepseek-ai/dsh-mcp-client` entries), and JSONC (comments / trailing commas). TOML and YAML are rewritten entry-by-entry so comments and unrelated settings survive byte-for-byte.
|
|
29
29
|
- **Safe writes** — every write snapshots the original file into `~/.dsh/mcp-connectors/backups/` (last 100 kept). Restore any version with one click; the restore itself is backed up too.
|
|
30
30
|
- **Enable / disable** — MCP has no cross-tool `disabled` flag, so disabling removes the entry from the config and keeps its definition in the manager state; enabling writes it back.
|
|
31
31
|
- **Product grouping** — tools that split their config across files (e.g. WorkBuddy user-level + connectors) render as one card, each server still bound to its own file.
|
|
32
|
+
- **Connector catalog** — three sources: the official [MCP Registry](https://registry.modelcontextprotocol.io/) (live search + paging), the [mcp.so Top 100](https://mcp.so/zh/rankings/servers) (details and install, with an offline cache), and the local **WorkBuddy official connector marketplace** (MCP connectors install back into WorkBuddy; CLI connectors are browse-only). Pick target agents, fill in parameters, install in one click; installed entries can be toggled or uninstalled in place. Every entry has a detail view (repository / website, README, launch command, environment, parameters). If all online sources are unavailable and WorkBuddy is not installed, the 7 built-in reference implementations appear as an offline fallback.
|
|
32
33
|
- **Drag to reorder** — display-only ordering stored in plugin state; config files are never touched.
|
|
33
34
|
- **Panel that fits the settings page** — vertical layout, sticky section headers, collapsible groups, status/agent filters, back-to-top, and light/dark that follows the host theme.
|
|
34
35
|
|
|
@@ -38,7 +39,8 @@ This plugin auto-discovers those files, shows them in one panel, and lets you to
|
|
|
38
39
|
|
|
39
40
|
| Agent | Path | Format |
|
|
40
41
|
| --- | --- | --- |
|
|
41
|
-
| DSH | `~/.dsh/
|
|
42
|
+
| DSH | `~/.dsh/profiles/<profile>/cordis.patch.yml` | YAML `@deepseek-ai/dsh-mcp-client` entries |
|
|
43
|
+
| DSH (legacy) | `~/.dsh/mcp.json` | JSON `mcpServers` |
|
|
42
44
|
| Claude Code | `~/.claude.json` | JSON `mcpServers` |
|
|
43
45
|
| Codex | `~/.codex/config.toml` | TOML `[mcp_servers.*]` |
|
|
44
46
|
| Cursor | `~/.cursor/mcp.json` | JSON `mcpServers` |
|
|
@@ -76,7 +78,9 @@ Restart DSH, then open **Settings → Connectors**. Host routes are registered a
|
|
|
76
78
|
|
|
77
79
|
- Every mutating request needs a custom header, `application/json`, and a same-origin `Origin`; the host's `connection.fetch` gate still applies.
|
|
78
80
|
- Writes are serialized, and a backup always precedes a write.
|
|
79
|
-
- Deleting a server removes only that entry; other keys in the file are preserved (JSON is re-serialized, Codex TOML is rewritten per section).
|
|
81
|
+
- Deleting a server removes only that entry; other keys in the file are preserved (JSON is re-serialized, Codex TOML is rewritten per section, DSH YAML replaces only the target entry's `config:` block).
|
|
82
|
+
- Online catalog search only talks to `registry.modelcontextprotocol.io` (results cached for 10 minutes). mcp.so access is limited to its allowed rankings and detail pages (cached for 30 minutes, robots.txt respected, `/search` never touched). WorkBuddy connectors are read from the local marketplace cache. Nothing is installed or run automatically — you confirm the target agents and parameters in the panel.
|
|
83
|
+
- WorkBuddy connector installs keep `${VAR}` credential placeholders; real secrets stay in WorkBuddy's own key store and are never written to config by the plugin.
|
|
80
84
|
|
|
81
85
|
## Development
|
|
82
86
|
|
|
@@ -88,6 +92,19 @@ npm test # full regression suite against a temp HOME
|
|
|
88
92
|
npm run preview # docs/preview.html — real component with fixture data
|
|
89
93
|
```
|
|
90
94
|
|
|
95
|
+
## Releasing
|
|
96
|
+
|
|
97
|
+
Publishing is fully automated:
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
node scripts/bump.cjs 0.2.0 # bump package.json + lockfile + changelog
|
|
101
|
+
git commit -am "chore(release): v0.2.0"
|
|
102
|
+
git push origin main
|
|
103
|
+
git tag v0.2.0 && git push origin v0.2.0
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
The `publish.yml` workflow runs the full test suite and publishes with [npm Trusted Publishing](https://docs.npmjs.com/trusted-publishers) (GitHub OIDC) — no `NPM_TOKEN`, no OTP, and provenance is signed automatically.
|
|
107
|
+
|
|
91
108
|
## Icons
|
|
92
109
|
|
|
93
110
|
Agent brand marks in `assets/agent-icons/` come from [@lobehub/icons](https://github.com/lobehub/lobe-icons) (MIT) and are vendored here; they are inlined into the build, so nothing is loaded from external paths at runtime.
|
package/README.zh-CN.md
CHANGED
|
@@ -24,10 +24,11 @@
|
|
|
24
24
|
## 功能
|
|
25
25
|
|
|
26
26
|
- **自动发现**——扫描 `~`、`%APPDATA%`、`%LOCALAPPDATA%`(macOS / Linux 对应目录同样覆盖),按文件名**和**文件内容双重判据识别(`mcpServers` / `mcp` 键、`[mcp_servers]` 节区)。常规开发机首扫约 250ms,之后走缓存。
|
|
27
|
-
- **多格式**——JSON(`mcpServers`)、OpenCode 风格(`mcp`)、Codex TOML(`[mcp_servers.*]`
|
|
27
|
+
- **多格式**——JSON(`mcpServers`)、OpenCode 风格(`mcp`)、Codex TOML(`[mcp_servers.*]`)、DSH 的 `cordis.patch.yml`(`@deepseek-ai/dsh-mcp-client` 条目),以及 JSONC(注释 / 尾逗号)。TOML / YAML 都只重写目标条目,注释和其它配置逐字节保留。
|
|
28
28
|
- **安全写入**——每次写入前把原文件快照到 `~/.dsh/mcp-connectors/backups/`(保留最近 100 份),任意版本一键恢复;恢复前也会先备份当前内容。
|
|
29
|
-
-
|
|
29
|
+
- **启停**——DSH 条目有原生 `disabled` 字段,直接改这一行;其它工具没有统一字段,停用 = 条目移出配置文件、定义存进管理器状态,启用再写回。
|
|
30
30
|
- **产品归组**——配置分散在多个文件里的工具(如 WorkBuddy 用户级 + 连接器)合成一张卡片,但每台 server 仍绑定自己的文件。
|
|
31
|
+
- **连接器目录**——三个来源:官方 [MCP Registry](https://registry.modelcontextprotocol.io/)(在线搜索 + 分页)、[mcp.so 热门 Top 100](https://mcp.so/zh/rankings/servers)(可详情、可安装,带离线缓存),以及本机 **WorkBuddy 官方连接器市场**(MCP 类型可装回 WorkBuddy,CLI 类型仅展示)。勾选目标 Agent、填好参数后一键安装,已安装的直接启停或卸载。每个条目有详情页(仓库 / 官网地址、README、启动命令、环境变量、参数)。在线来源都不可用且本机没有 WorkBuddy 时,才会露出内置的 7 个官方参考实现作为断网兜底。
|
|
31
32
|
- **拖拽排序**——顺序只存在插件状态里,配置文件一个字节都不动。
|
|
32
33
|
- **适配设置页的面板**——竖向布局、区块头吸顶、分组可折叠、状态 / Agent 筛选、回到顶部,明暗主题跟随宿主。
|
|
33
34
|
|
|
@@ -37,7 +38,8 @@
|
|
|
37
38
|
|
|
38
39
|
| Agent | 路径 | 格式 |
|
|
39
40
|
| --- | --- | --- |
|
|
40
|
-
| DSH | `~/.dsh/
|
|
41
|
+
| DSH | `~/.dsh/profiles/<profile>/cordis.patch.yml` | YAML `@deepseek-ai/dsh-mcp-client` 条目 |
|
|
42
|
+
| DSH(旧版兼容) | `~/.dsh/mcp.json` | JSON `mcpServers` |
|
|
41
43
|
| Claude Code | `~/.claude.json` | JSON `mcpServers` |
|
|
42
44
|
| Codex | `~/.codex/config.toml` | TOML `[mcp_servers.*]` |
|
|
43
45
|
| Cursor | `~/.cursor/mcp.json` | JSON `mcpServers` |
|
|
@@ -75,7 +77,9 @@ dsh plugin --profile web add https://github.com/elegant01/dsh-mcp-connectors
|
|
|
75
77
|
|
|
76
78
|
- 所有写接口要求自定义头 + `application/json` + 同源 `Origin`,宿主 `connection.fetch` 门禁照常生效;
|
|
77
79
|
- 写操作串行执行,写前必备份;
|
|
78
|
-
- 删除服务器只删目标条目,文件里的其它键原样保留(JSON 重序列化,Codex TOML
|
|
80
|
+
- 删除服务器只删目标条目,文件里的其它键原样保留(JSON 重序列化,Codex TOML 按节区重写,DSH YAML 只替换目标条目的 `config:` 块)。
|
|
81
|
+
- 连接器在线发现只访问固定域名 `registry.modelcontextprotocol.io`(结果缓存 10 分钟);mcp.so 只读取允许抓取的排行榜页与详情页(缓存 30 分钟,遵守 robots.txt,不碰 `/search`);WorkBuddy 连接器只读本机市场缓存。插件不会自动安装或运行任何服务器,必须由你在面板里确认目标 Agent 和参数。
|
|
82
|
+
- WorkBuddy 连接器安装时保留 `${VAR}` 凭据占位符,真实密钥仍由 WorkBuddy 自己的 key store 保管,插件不会写入明文凭据。
|
|
79
83
|
|
|
80
84
|
## 开发
|
|
81
85
|
|
|
@@ -87,6 +91,19 @@ npm test # 用临时 HOME 跑全量回归
|
|
|
87
91
|
npm run preview # docs/preview.html,真实组件 + 假数据
|
|
88
92
|
```
|
|
89
93
|
|
|
94
|
+
## 发版
|
|
95
|
+
|
|
96
|
+
发布全自动:
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
node scripts/bump.cjs 0.2.0 # 同步 package.json + lockfile + changelog
|
|
100
|
+
git commit -am "chore(release): v0.2.0"
|
|
101
|
+
git push origin main
|
|
102
|
+
git tag v0.2.0 && git push origin v0.2.0
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
`publish.yml` 会跑完整测试并用 [npm Trusted Publishing](https://docs.npmjs.com/trusted-publishers)(GitHub OIDC)发布——**不需要 NPM_TOKEN,也不受 OTP 限制**,provenance 自动签名。
|
|
106
|
+
|
|
90
107
|
## 图标
|
|
91
108
|
|
|
92
109
|
`assets/agent-icons/` 下的各 Agent 品牌图标取自 [@lobehub/icons](https://github.com/lobehub/lobe-icons)(MIT),已随仓库拷贝并在构建时内联,运行时不依赖任何外部路径。
|
package/lib/board-css.js
CHANGED
|
@@ -273,6 +273,7 @@ const BOARD_CSS = `
|
|
|
273
273
|
.dmm-tag.cyan { background:var(--status-cyan-bg); color:var(--status-cyan-text); }
|
|
274
274
|
.dmm-tag.purple { background:var(--status-purple-bg); color:var(--status-purple-text); }
|
|
275
275
|
.dmm-tag.gray { background:var(--bg-secondary-default); color:var(--text-secondary); }
|
|
276
|
+
.dmm-tag.accent { background:var(--accent-50); color:var(--accent-700); }
|
|
276
277
|
|
|
277
278
|
/* ---------- \u5F00\u5173 ---------- */
|
|
278
279
|
.dmm-switch {
|
|
@@ -406,6 +407,90 @@ const BOARD_CSS = `
|
|
|
406
407
|
.dmm[data-theme="dark"] .dmm-toast { background:var(--n-100); color:var(--n-900); }
|
|
407
408
|
.dmm-toast.err { background:var(--status-error-text); color:#fff; }
|
|
408
409
|
|
|
410
|
+
/* ---------- \u8FDE\u63A5\u5668\u76EE\u5F55 ---------- */
|
|
411
|
+
.dmm-catalog-subtitle { font-size:13px; color:var(--text-secondary); margin-bottom:10px; }
|
|
412
|
+
.dmm-catalog-search { display:flex; gap:8px; margin-bottom:6px; }
|
|
413
|
+
.dmm-catalog-search .dmm-input { flex:1; }
|
|
414
|
+
.dmm-catalog-list { display:flex; flex-direction:column; gap:10px; margin-top:10px; }
|
|
415
|
+
.dmm-catalog-card {
|
|
416
|
+
display:flex; gap:12px; align-items:flex-start;
|
|
417
|
+
padding:12px; border:1px solid var(--border-table); border-radius:var(--r-ctl);
|
|
418
|
+
background:var(--bg-primary-default);
|
|
419
|
+
}
|
|
420
|
+
.dmm-catalog-main { flex:1; min-width:0; }
|
|
421
|
+
.dmm-catalog-title { display:flex; align-items:center; gap:6px; flex-wrap:wrap; font-weight:600; font-size:14px; }
|
|
422
|
+
.dmm-catalog-desc { font-size:13px; line-height:19px; color:var(--text-secondary); margin-top:4px; }
|
|
423
|
+
.dmm-catalog-meta { margin-top:4px; font-size:12px; color:var(--text-tertiary); }
|
|
424
|
+
.dmm-catalog-meta code { font-family:var(--mono); }
|
|
425
|
+
.dmm-catalog-warn {
|
|
426
|
+
margin-top:6px; padding:6px 8px; border-radius:var(--r-chip);
|
|
427
|
+
background:var(--status-yellow-bg); color:var(--status-yellow-text);
|
|
428
|
+
font-size:12px; line-height:17px;
|
|
429
|
+
}
|
|
430
|
+
.dmm-catalog-installs { display:flex; flex-direction:column; gap:6px; margin-top:8px; }
|
|
431
|
+
.dmm-catalog-install {
|
|
432
|
+
display:flex; align-items:center; gap:8px;
|
|
433
|
+
padding:6px 8px; border-radius:var(--r-chip);
|
|
434
|
+
background:var(--bg-secondary-default);
|
|
435
|
+
}
|
|
436
|
+
.dmm-catalog-install-name { font-size:12.5px; color:var(--text-secondary); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
|
|
437
|
+
.dmm-catalog-actions { flex:none; display:flex; flex-direction:row; gap:6px; align-items:flex-start; }
|
|
438
|
+
.dmm-detail-section { margin-top:14px; }
|
|
439
|
+
.dmm-detail-section-title { font-size:12px; font-weight:600; color:var(--text-secondary); text-transform:uppercase; letter-spacing:.04em; margin-bottom:6px; }
|
|
440
|
+
.dmm-detail-grid, .dmm-detail-list { display:flex; flex-direction:column; gap:6px; }
|
|
441
|
+
.dmm-detail-row { display:flex; gap:10px; align-items:flex-start; font-size:13px; line-height:18px; }
|
|
442
|
+
.dmm-detail-label { flex:0 0 124px; color:var(--text-secondary); }
|
|
443
|
+
.dmm-detail-value { flex:1; min-width:0; word-break:break-all; }
|
|
444
|
+
.dmm-code-block {
|
|
445
|
+
margin:0; padding:8px 10px; border-radius:var(--r-chip);
|
|
446
|
+
background:var(--bg-secondary-default); color:var(--text-primary);
|
|
447
|
+
font-family:var(--mono); font-size:12px; line-height:18px;
|
|
448
|
+
white-space:pre-wrap; word-break:break-all;
|
|
449
|
+
}
|
|
450
|
+
.dmm-readme {
|
|
451
|
+
max-height:340px; overflow:auto;
|
|
452
|
+
padding:8px 10px;
|
|
453
|
+
border:1px solid var(--border-table); border-radius:var(--r-chip);
|
|
454
|
+
background:var(--bg-primary-default);
|
|
455
|
+
font-size:13px; line-height:20px;
|
|
456
|
+
}
|
|
457
|
+
.dmm-md-p { margin:4px 0; white-space:pre-wrap; }
|
|
458
|
+
.dmm-md-h1 { font-size:16px; font-weight:600; margin:12px 0 6px; }
|
|
459
|
+
.dmm-md-h2 { font-size:15px; font-weight:600; margin:10px 0 5px; }
|
|
460
|
+
.dmm-md-h3 { font-size:14px; font-weight:600; margin:8px 0 4px; }
|
|
461
|
+
.dmm-md-list { margin:4px 0; padding-left:18px; }
|
|
462
|
+
.dmm-md-list li { margin:2px 0; }
|
|
463
|
+
.dmm-md-code {
|
|
464
|
+
font-family:var(--mono); font-size:12px;
|
|
465
|
+
padding:1px 4px; border-radius:4px;
|
|
466
|
+
background:var(--bg-secondary-default);
|
|
467
|
+
}
|
|
468
|
+
.dmm-catalog-more { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-top:10px; }
|
|
469
|
+
.dmm-modal-head .dmm-segmented { flex-wrap:wrap; }
|
|
470
|
+
.dmm-rank-card {
|
|
471
|
+
display:flex; gap:12px; align-items:flex-start;
|
|
472
|
+
padding:12px; border:1px solid var(--border-table); border-radius:var(--r-ctl);
|
|
473
|
+
background:var(--bg-primary-default);
|
|
474
|
+
}
|
|
475
|
+
.dmm-rank-no {
|
|
476
|
+
flex:none; width:30px; height:30px; border-radius:50%;
|
|
477
|
+
display:flex; align-items:center; justify-content:center;
|
|
478
|
+
font-size:13px; font-weight:600; font-variant-numeric:tabular-nums;
|
|
479
|
+
background:var(--bg-secondary-default); color:var(--text-secondary);
|
|
480
|
+
}
|
|
481
|
+
.dmm-rank-card:nth-child(-n+3) .dmm-rank-no { background:var(--status-yellow-bg); color:var(--status-yellow-text); }
|
|
482
|
+
.dmm-rank-author { font-size:12px; color:var(--text-secondary); }
|
|
483
|
+
.dmm-rank-metrics { display:flex; align-items:center; gap:6px; flex-wrap:wrap; margin-top:6px; }
|
|
484
|
+
.dmm-link { color:var(--accent-600); text-decoration:none; }
|
|
485
|
+
.dmm-link:hover { text-decoration:underline; }
|
|
486
|
+
.dmm[data-theme="dark"] .dmm-link { color:var(--accent-300); }
|
|
487
|
+
.dmm[data-theme="dark"] .dmm-tag.accent { background:var(--accent-700); color:var(--n-50); }
|
|
488
|
+
.dmm-catalog-meta .dmm-link { margin-left:8px; }
|
|
489
|
+
.dmm-check-list { display:flex; flex-direction:column; gap:6px; }
|
|
490
|
+
.dmm-check { display:flex; align-items:center; gap:8px; font-size:13px; cursor:pointer; }
|
|
491
|
+
.dmm-check input { accent-color:var(--accent-500); width:15px; height:15px; }
|
|
492
|
+
.dmm-req { color:var(--text-error); }
|
|
493
|
+
|
|
409
494
|
/* ---------- \u54CD\u5E94\u5F0F ---------- */
|
|
410
495
|
@media (max-width:1080px) { .dmm-kpi-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
|
|
411
496
|
@media (max-width:640px) {
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
const REFERENCE_WARNING = "\u5B98\u65B9\u53C2\u8003\u5B9E\u73B0\uFF0C\u7528\u6765\u6F14\u793A MCP \u80FD\u529B\uFF0C\u4E0D\u5EFA\u8BAE\u76F4\u63A5\u7528\u4E8E\u751F\u4EA7\u73AF\u5883\uFF1B\u8BF7\u81EA\u884C\u8BC4\u4F30\u6743\u9650\u4E0E\u5B89\u5168\u8FB9\u754C\u3002";
|
|
2
|
+
const OFFICIAL_CATALOG = [
|
|
3
|
+
{
|
|
4
|
+
id: "filesystem",
|
|
5
|
+
title: "Filesystem",
|
|
6
|
+
description: "Secure file operations with configurable access controls.",
|
|
7
|
+
descriptionZh: "\u5E26\u8BBF\u95EE\u63A7\u5236\u7684\u5B89\u5168\u6587\u4EF6\u8BFB\u5199\u3001\u641C\u7D22\u4E0E\u7F16\u8F91\u3002",
|
|
8
|
+
source: "official",
|
|
9
|
+
transport: "stdio",
|
|
10
|
+
packageId: "@modelcontextprotocol/server-filesystem",
|
|
11
|
+
command: "npx",
|
|
12
|
+
args: ["-y", "@modelcontextprotocol/server-filesystem", "{{dirs}}"],
|
|
13
|
+
fields: [
|
|
14
|
+
{
|
|
15
|
+
key: "dirs",
|
|
16
|
+
label: "\u5141\u8BB8\u8BBF\u95EE\u7684\u76EE\u5F55",
|
|
17
|
+
labelEn: "Allowed directories",
|
|
18
|
+
description: "\u6BCF\u884C\u4E00\u4E2A\u7EDD\u5BF9\u8DEF\u5F84\uFF1B\u670D\u52A1\u5668\u53EA\u80FD\u8BBF\u95EE\u8FD9\u4E9B\u76EE\u5F55\u3002",
|
|
19
|
+
required: true,
|
|
20
|
+
kind: "lines",
|
|
21
|
+
placeholder: "F:\\centos\\my-project"
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
repository: "https://github.com/modelcontextprotocol/servers/tree/main/src/filesystem",
|
|
25
|
+
tags: ["files"],
|
|
26
|
+
warning: REFERENCE_WARNING
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
id: "git",
|
|
30
|
+
title: "Git",
|
|
31
|
+
description: "Tools to read, search, and manipulate Git repositories.",
|
|
32
|
+
descriptionZh: "\u8BFB\u53D6\u3001\u641C\u7D22\u548C\u64CD\u4F5C Git \u4ED3\u5E93\u3002",
|
|
33
|
+
source: "official",
|
|
34
|
+
transport: "stdio",
|
|
35
|
+
packageId: "mcp-server-git",
|
|
36
|
+
command: "uvx",
|
|
37
|
+
args: ["mcp-server-git", "--repository", "{{repo}}"],
|
|
38
|
+
fields: [
|
|
39
|
+
{
|
|
40
|
+
key: "repo",
|
|
41
|
+
label: "\u4ED3\u5E93\u8DEF\u5F84",
|
|
42
|
+
labelEn: "Repository path",
|
|
43
|
+
required: true,
|
|
44
|
+
kind: "path",
|
|
45
|
+
default: ".",
|
|
46
|
+
placeholder: "F:\\centos\\my-project"
|
|
47
|
+
}
|
|
48
|
+
],
|
|
49
|
+
repository: "https://github.com/modelcontextprotocol/servers/tree/main/src/git",
|
|
50
|
+
tags: ["git"],
|
|
51
|
+
warning: REFERENCE_WARNING
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
id: "memory",
|
|
55
|
+
title: "Memory",
|
|
56
|
+
description: "Knowledge graph-based persistent memory system.",
|
|
57
|
+
descriptionZh: "\u57FA\u4E8E\u77E5\u8BC6\u56FE\u8C31\u7684\u6301\u4E45\u8BB0\u5FC6\u7CFB\u7EDF\u3002",
|
|
58
|
+
source: "official",
|
|
59
|
+
transport: "stdio",
|
|
60
|
+
packageId: "@modelcontextprotocol/server-memory",
|
|
61
|
+
command: "npx",
|
|
62
|
+
args: ["-y", "@modelcontextprotocol/server-memory"],
|
|
63
|
+
env: { MEMORY_FILE_PATH: "{{MEMORY_FILE_PATH}}" },
|
|
64
|
+
fields: [
|
|
65
|
+
{
|
|
66
|
+
key: "MEMORY_FILE_PATH",
|
|
67
|
+
label: "\u8BB0\u5FC6\u6587\u4EF6\u8DEF\u5F84\uFF08\u53EF\u9009\uFF09",
|
|
68
|
+
labelEn: "Memory file path (optional)",
|
|
69
|
+
description: "\u7559\u7A7A\u5219\u4F7F\u7528\u670D\u52A1\u5668\u9ED8\u8BA4\u4F4D\u7F6E\u3002",
|
|
70
|
+
kind: "path",
|
|
71
|
+
placeholder: "F:\\centos\\.mcp\\memory.json"
|
|
72
|
+
}
|
|
73
|
+
],
|
|
74
|
+
repository: "https://github.com/modelcontextprotocol/servers/tree/main/src/memory",
|
|
75
|
+
tags: ["memory"],
|
|
76
|
+
warning: REFERENCE_WARNING
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
id: "sequential-thinking",
|
|
80
|
+
title: "Sequential Thinking",
|
|
81
|
+
description: "Dynamic and reflective problem-solving through thought sequences.",
|
|
82
|
+
descriptionZh: "\u901A\u8FC7\u9010\u6B65\u601D\u8003\u5E8F\u5217\u8FDB\u884C\u52A8\u6001\u63A8\u7406\u3002",
|
|
83
|
+
source: "official",
|
|
84
|
+
transport: "stdio",
|
|
85
|
+
packageId: "@modelcontextprotocol/server-sequential-thinking",
|
|
86
|
+
command: "npx",
|
|
87
|
+
args: ["-y", "@modelcontextprotocol/server-sequential-thinking"],
|
|
88
|
+
fields: [],
|
|
89
|
+
repository: "https://github.com/modelcontextprotocol/servers/tree/main/src/sequentialthinking",
|
|
90
|
+
tags: ["reasoning"],
|
|
91
|
+
warning: REFERENCE_WARNING
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
id: "time",
|
|
95
|
+
title: "Time",
|
|
96
|
+
description: "Time and timezone conversion capabilities.",
|
|
97
|
+
descriptionZh: "\u65F6\u95F4\u4E0E\u65F6\u533A\u8F6C\u6362\u3002",
|
|
98
|
+
source: "official",
|
|
99
|
+
transport: "stdio",
|
|
100
|
+
packageId: "mcp-server-time",
|
|
101
|
+
command: "uvx",
|
|
102
|
+
args: ["mcp-server-time", "--local-timezone={{tz}}"],
|
|
103
|
+
fields: [
|
|
104
|
+
{
|
|
105
|
+
key: "tz",
|
|
106
|
+
label: "\u672C\u5730\u65F6\u533A\uFF08\u53EF\u9009\uFF09",
|
|
107
|
+
labelEn: "Local timezone (optional)",
|
|
108
|
+
placeholder: "Asia/Shanghai"
|
|
109
|
+
}
|
|
110
|
+
],
|
|
111
|
+
repository: "https://github.com/modelcontextprotocol/servers/tree/main/src/time",
|
|
112
|
+
tags: ["time"],
|
|
113
|
+
warning: REFERENCE_WARNING
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
id: "fetch",
|
|
117
|
+
title: "Fetch",
|
|
118
|
+
description: "Web content fetching and conversion for efficient LLM usage.",
|
|
119
|
+
descriptionZh: "\u6293\u53D6\u7F51\u9875\u5E76\u8F6C\u6210\u9002\u5408 LLM \u4F7F\u7528\u7684\u6587\u672C\u3002",
|
|
120
|
+
source: "official",
|
|
121
|
+
transport: "stdio",
|
|
122
|
+
packageId: "mcp-server-fetch",
|
|
123
|
+
command: "uvx",
|
|
124
|
+
args: ["mcp-server-fetch"],
|
|
125
|
+
fields: [],
|
|
126
|
+
repository: "https://github.com/modelcontextprotocol/servers/tree/main/src/fetch",
|
|
127
|
+
tags: ["web"],
|
|
128
|
+
warning: REFERENCE_WARNING
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
id: "everything",
|
|
132
|
+
title: "Everything",
|
|
133
|
+
description: "Reference / test server with prompts, resources, and tools.",
|
|
134
|
+
descriptionZh: "\u53C2\u8003/\u6D4B\u8BD5\u670D\u52A1\u5668\uFF0C\u8986\u76D6 prompts\u3001resources\u3001tools \u5168\u90E8\u80FD\u529B\u3002",
|
|
135
|
+
source: "official",
|
|
136
|
+
transport: "stdio",
|
|
137
|
+
packageId: "@modelcontextprotocol/server-everything",
|
|
138
|
+
command: "npx",
|
|
139
|
+
args: ["-y", "@modelcontextprotocol/server-everything"],
|
|
140
|
+
fields: [],
|
|
141
|
+
repository: "https://github.com/modelcontextprotocol/servers/tree/main/src/everything",
|
|
142
|
+
tags: ["test"],
|
|
143
|
+
warning: REFERENCE_WARNING
|
|
144
|
+
}
|
|
145
|
+
];
|
|
146
|
+
function expandCatalogSpec(entry, values) {
|
|
147
|
+
const val = (key) => values[key] ?? "";
|
|
148
|
+
const fieldByKey = Object.fromEntries(entry.fields.map((field) => [field.key, field]));
|
|
149
|
+
const placeholders = (text) => [...text.matchAll(/\{\{([\w-]+)\}\}/g)].map((match) => match[1]);
|
|
150
|
+
const expand = (text) => text.replace(/\{\{([\w-]+)\}\}/g, (_, key) => val(key));
|
|
151
|
+
const args = [];
|
|
152
|
+
for (const template of entry.args ?? []) {
|
|
153
|
+
const keys = placeholders(template);
|
|
154
|
+
if (keys.length && keys.every((key) => !val(key).trim())) continue;
|
|
155
|
+
const linesKey = keys.length === 1 && fieldByKey[keys[0]]?.kind === "lines" ? keys[0] : null;
|
|
156
|
+
if (linesKey) {
|
|
157
|
+
for (const line of val(linesKey).split(/\r?\n/).map((item) => item.trim()).filter(Boolean)) args.push(line);
|
|
158
|
+
} else {
|
|
159
|
+
args.push(expand(template));
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
const env = {};
|
|
163
|
+
for (const [key, template] of Object.entries(entry.env ?? {})) {
|
|
164
|
+
const keys = placeholders(template);
|
|
165
|
+
if (keys.length && keys.every((field) => !val(field).trim())) continue;
|
|
166
|
+
env[key] = expand(template);
|
|
167
|
+
}
|
|
168
|
+
const headers = {};
|
|
169
|
+
for (const [key, template] of Object.entries(entry.headers ?? {})) {
|
|
170
|
+
const keys = placeholders(template);
|
|
171
|
+
if (keys.length && keys.every((field) => !val(field).trim())) continue;
|
|
172
|
+
headers[key] = expand(template);
|
|
173
|
+
}
|
|
174
|
+
const spec = {};
|
|
175
|
+
if (entry.command) spec.command = entry.command;
|
|
176
|
+
if (args.length) spec.args = args;
|
|
177
|
+
if (Object.keys(env).length) spec.env = env;
|
|
178
|
+
if (entry.url) spec.url = entry.url;
|
|
179
|
+
if (Object.keys(headers).length) spec.headers = headers;
|
|
180
|
+
if (entry.extra && Object.keys(entry.extra).length) spec.extra = entry.extra;
|
|
181
|
+
return spec;
|
|
182
|
+
}
|
|
183
|
+
function matchesCatalogEntry(entry, name, spec) {
|
|
184
|
+
if (name === entry.id) return true;
|
|
185
|
+
if (entry.url && spec.url === entry.url) return true;
|
|
186
|
+
if (entry.packageId) {
|
|
187
|
+
const needle = entry.packageId;
|
|
188
|
+
if (spec.command === needle) return true;
|
|
189
|
+
if (spec.args?.some((arg) => arg === needle)) return true;
|
|
190
|
+
if (spec.url?.includes(needle)) return true;
|
|
191
|
+
}
|
|
192
|
+
return false;
|
|
193
|
+
}
|
|
194
|
+
export {
|
|
195
|
+
OFFICIAL_CATALOG,
|
|
196
|
+
expandCatalogSpec,
|
|
197
|
+
matchesCatalogEntry
|
|
198
|
+
};
|