dsh-mcp-connectors 0.1.4 → 0.3.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 +22 -1
- package/CHANGELOG.zh-CN.md +22 -1
- package/README.md +9 -4
- package/README.zh-CN.md +10 -5
- package/assets/icon-market.png +0 -0
- package/lib/board-css.js +93 -0
- package/lib/catalog-data.js +198 -0
- package/lib/client.js +108 -11
- package/lib/cordis.js +493 -0
- package/lib/core.js +143 -4
- package/lib/index.js +142 -0
- package/lib/mcpso.js +295 -0
- package/lib/qoder.js +270 -0
- package/lib/registry.js +274 -0
- package/lib/sources.js +20 -4
- package/lib/workbuddy.js +228 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,7 +2,28 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project are documented here. Format follows [Keep a Changelog](https://keepachangelog.com/), versions use [SemVer](https://semver.org/).
|
|
4
4
|
|
|
5
|
-
## [
|
|
5
|
+
## [0.3.0] - 2026-11-24
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- New "Qoder connector marketplace" source: reads 300+ connectors from Qoder's public marketplace API (50 per page, 30-minute cache, falls back to the last snapshot with a stale marker on network failure). OAuth connectors install in one click into `mcpServers` of `~/.qoder-cn/settings.json` or `~/.qoder/settings.json` (`type: "http"`) with the usual pre-write backup and preservation of other settings; the first connection still requires completing OAuth inside Qoder. Gateway-hosted (`mcp.qoder.cn` / `mcp.qoder.com`) and API-key connectors are marked browse-only with a pointer to install inside the Qoder marketplace.
|
|
10
|
+
- Qoder config discovery now also covers `~/.qoder/settings.json` and `~/.qoder-cn/settings.json` (alongside the existing `mcp.json` paths).
|
|
11
|
+
- WorkBuddy connector cards now show connector icons (read locally, no network) and the list keeps the WorkBuddy marketplace's original order instead of re-sorting by name.
|
|
12
|
+
|
|
13
|
+
## [0.2.0] - 2026-11-18
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
|
|
17
|
+
- 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.
|
|
18
|
+
- The previous `~/.dsh/mcp.json` path is still read for backward compatibility.
|
|
19
|
+
- 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.
|
|
20
|
+
- 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.
|
|
21
|
+
- 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.
|
|
22
|
+
- 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.
|
|
23
|
+
- 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.
|
|
24
|
+
- 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.
|
|
25
|
+
- 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.
|
|
26
|
+
- 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.
|
|
6
27
|
|
|
7
28
|
## [0.1.4] - 2026-11-18
|
|
8
29
|
|
package/CHANGELOG.zh-CN.md
CHANGED
|
@@ -2,7 +2,28 @@
|
|
|
2
2
|
|
|
3
3
|
本项目的重要变更都记录在此。格式遵循 [Keep a Changelog](https://keepachangelog.com/),版本号遵循 [SemVer](https://semver.org/)。
|
|
4
4
|
|
|
5
|
-
## [
|
|
5
|
+
## [0.3.0] - 2026-11-24
|
|
6
|
+
|
|
7
|
+
### 新增
|
|
8
|
+
|
|
9
|
+
- 新增「Qoder 连接器市场」来源:通过 Qoder 官网公开接口读取 300+ 连接器(按 50 条/页分页抓取,缓存 30 分钟,网络失败回退上次快照并标注)。OAuth 类型连接器可在目录里一键安装,直接写入 `~/.qoder-cn/settings.json` 或 `~/.qoder/settings.json` 的 `mcpServers`(`type: "http"`),写入前照常备份、保留文件里的其它配置;首次连接需在 Qoder 内完成 OAuth 登录。网关托管(`mcp.qoder.cn` / `mcp.qoder.com`)和需要 API Key 的连接器标为「仅浏览」并提示到 Qoder 市场内安装。
|
|
10
|
+
- Qoder 配置文件识别新增 `~/.qoder/settings.json` 和 `~/.qoder-cn/settings.json`(与原有的 `mcp.json` 并存)。
|
|
11
|
+
- WorkBuddy 连接器来源:卡片显示连接器图标(本地读取,不联网);列表保持 WorkBuddy 市场的原始排序,不再按名称重排。
|
|
12
|
+
|
|
13
|
+
## [0.2.0] - 2026-11-18
|
|
14
|
+
|
|
15
|
+
### 新增
|
|
16
|
+
|
|
17
|
+
- 支持 DSH 真实的 MCP 配置形态:`~/.dsh/profiles/<profile>/cordis.patch.yml`(`@deepseek-ai/dsh-mcp-client` 条目)。每个 profile 在 DSH 分组下单独列出;支持读取、新增、编辑、删除,以及原生 `disabled` 启停。写入只替换目标条目的 `config:` 块,注释与其它插件配置原样保留。
|
|
18
|
+
- 旧的 `~/.dsh/mcp.json` 路径继续兼容读取。
|
|
19
|
+
- 连接器目录:内置 `modelcontextprotocol/servers` 的 7 个官方参考服务器,并可在线搜索官方 MCP Registry。可一次安装到多个 Agent,装好后直接在目录里启停或卸载;必填参数(目录、仓库路径、Token 等)在安装前收集,Windows 上的 DSH 目标会自动包成 `cmd /c npx|uvx`。
|
|
20
|
+
- 连接器详情页:显示仓库 / 官网地址、包名、传输方式、registry 名称、带占位符说明的启动命令、环境变量、安装参数和已安装的 Agent;列表卡片也直接带「仓库地址」链接。Registry 条目不是都来自 GitHub,没有仓库地址时详情页会明确提示。
|
|
21
|
+
- 详情页按需抓取并渲染 GitHub 仓库 README(标题 / 列表 / 代码块 / 链接,长文截断到 600 行并给出 GitHub 链接);抓取只允许 github.com → raw.githubusercontent.com,缓存 30 分钟。
|
|
22
|
+
- 「在线发现」改为默认 Tab,并支持游标分页「加载更多」——官方 `modelcontextprotocol/servers` 仓库本来就只维护少量参考实现,完整目录在 MCP Registry。
|
|
23
|
+
- 新增「mcp.so 热门」来源:只抓取 mcp.so 排行榜 Top 100(遵守 robots.txt,不碰它的 /search),展示排名、作者、简介、月搜、星标和评分;成功结果落盘缓存,网络失败时回退到上次快照并明确标注。
|
|
24
|
+
- mcp.so 支持详情与安装:点「详情 / 安装」时按需抓取该条目详情页,解析其中的 `mcpServers` 配置(含 `${VAR}` / `YOUR_TOKEN` 等凭据占位符),转成安装表单;没有可用配置时退化为跳转 mcp.so。详情结果缓存 30 分钟,失败时回退本地快照。
|
|
25
|
+
- 移除「官方参考」Tab。在线来源都失败且本机没有 WorkBuddy 时,才在空状态里露出内置的 7 个官方参考实现作为断网兜底。
|
|
26
|
+
- 新增「WorkBuddy 连接器」来源:读取本机 WorkBuddy 官方连接器市场缓存(318 条,272 个可安装 MCP,其余为 CLI 类型)。MCP 类型保留 WorkBuddy 的 `${VAR}` 凭据占位符并安装回 `~/.workbuddy/connectors/default/mcp.json`(`connector:<id>` 命名),凭据仍由 WorkBuddy 自己的 key store 保管、不写入配置;CLI 类型只展示不安装;没装 WorkBuddy 时该来源不出现。
|
|
6
27
|
|
|
7
28
|
## [0.1.1] - 2026-11-17
|
|
8
29
|
|
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** — four 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), the local **WorkBuddy official connector marketplace** (MCP connectors install back into WorkBuddy; CLI connectors are browse-only), and the **Qoder official connector marketplace** (300+ connectors via its public API; OAuth connectors install into Qoder / Qoder CN with one click, while gateway-hosted or API-key connectors are marked browse-only with a pointer to install inside Qoder). 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` |
|
|
@@ -50,7 +52,8 @@ This plugin auto-discovers those files, shows them in one panel, and lets you to
|
|
|
50
52
|
| OpenCode | `~/.config/opencode/opencode.json` | JSON `mcp` |
|
|
51
53
|
| Windsurf | `~/.codeium/windsurf/mcp_config.json` | JSON `mcpServers` |
|
|
52
54
|
| Trae / Trae CN | `~/.trae/mcp.json`, `~/.trae-cn/mcp.json` | JSON `mcpServers` |
|
|
53
|
-
| Qoder | `~/.qoder/mcp.json` | JSON `mcpServers` |
|
|
55
|
+
| Qoder | `~/.qoder/settings.json`, `~/.qoder/mcp.json` | JSON `mcpServers` |
|
|
56
|
+
| Qoder CN | `~/.qoder-cn/settings.json`, `~/.qoder-cn/mcp.json` | JSON `mcpServers` |
|
|
54
57
|
| CodeBuddy / CN | `~/.codebuddy/mcp.json` | JSON `mcpServers` |
|
|
55
58
|
| WorkBuddy | `~/.workbuddy/mcp.json`, `~/.workbuddy/connectors/default/mcp.json` | JSON `mcpServers` |
|
|
56
59
|
| VS Code | `%APPDATA%/Code/User/mcp.json` | JSONC |
|
|
@@ -76,7 +79,9 @@ Restart DSH, then open **Settings → Connectors**. Host routes are registered a
|
|
|
76
79
|
|
|
77
80
|
- Every mutating request needs a custom header, `application/json`, and a same-origin `Origin`; the host's `connection.fetch` gate still applies.
|
|
78
81
|
- 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).
|
|
82
|
+
- 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).
|
|
83
|
+
- 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.
|
|
84
|
+
- 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
85
|
|
|
81
86
|
## Development
|
|
82
87
|
|
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 类型仅展示),以及 **Qoder 官方连接器市场**(公开接口读取 300+ 连接器;OAuth 连接器一键写入 Qoder / Qoder CN 配置,网关托管或需要 API Key 的标「仅浏览」并提示到 Qoder 内安装)。勾选目标 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` |
|
|
@@ -49,7 +51,8 @@
|
|
|
49
51
|
| OpenCode | `~/.config/opencode/opencode.json` | JSON `mcp` |
|
|
50
52
|
| Windsurf | `~/.codeium/windsurf/mcp_config.json` | JSON `mcpServers` |
|
|
51
53
|
| Trae / Trae CN | `~/.trae/mcp.json`、`~/.trae-cn/mcp.json` | JSON `mcpServers` |
|
|
52
|
-
| Qoder | `~/.qoder/mcp.json` | JSON `mcpServers` |
|
|
54
|
+
| Qoder | `~/.qoder/settings.json`、`~/.qoder/mcp.json` | JSON `mcpServers` |
|
|
55
|
+
| Qoder CN | `~/.qoder-cn/settings.json`、`~/.qoder-cn/mcp.json` | JSON `mcpServers` |
|
|
53
56
|
| CodeBuddy / 国内版 | `~/.codebuddy/mcp.json` | JSON `mcpServers` |
|
|
54
57
|
| WorkBuddy | `~/.workbuddy/mcp.json`、`~/.workbuddy/connectors/default/mcp.json` | JSON `mcpServers` |
|
|
55
58
|
| VS Code | `%APPDATA%/Code/User/mcp.json` | JSONC |
|
|
@@ -75,7 +78,9 @@ dsh plugin --profile web add https://github.com/elegant01/dsh-mcp-connectors
|
|
|
75
78
|
|
|
76
79
|
- 所有写接口要求自定义头 + `application/json` + 同源 `Origin`,宿主 `connection.fetch` 门禁照常生效;
|
|
77
80
|
- 写操作串行执行,写前必备份;
|
|
78
|
-
- 删除服务器只删目标条目,文件里的其它键原样保留(JSON 重序列化,Codex TOML
|
|
81
|
+
- 删除服务器只删目标条目,文件里的其它键原样保留(JSON 重序列化,Codex TOML 按节区重写,DSH YAML 只替换目标条目的 `config:` 块)。
|
|
82
|
+
- 连接器在线发现只访问固定域名 `registry.modelcontextprotocol.io`(结果缓存 10 分钟);mcp.so 只读取允许抓取的排行榜页与详情页(缓存 30 分钟,遵守 robots.txt,不碰 `/search`);WorkBuddy 连接器只读本机市场缓存。插件不会自动安装或运行任何服务器,必须由你在面板里确认目标 Agent 和参数。
|
|
83
|
+
- WorkBuddy 连接器安装时保留 `${VAR}` 凭据占位符,真实密钥仍由 WorkBuddy 自己的 key store 保管,插件不会写入明文凭据。
|
|
79
84
|
|
|
80
85
|
## 开发
|
|
81
86
|
|
|
Binary file
|
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,98 @@ 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-icon {
|
|
422
|
+
flex:none; width:38px; height:38px; border-radius:9px;
|
|
423
|
+
position:relative; overflow:hidden;
|
|
424
|
+
display:flex; align-items:center; justify-content:center;
|
|
425
|
+
background:var(--bg-secondary-default); border:1px solid var(--border-table);
|
|
426
|
+
color:var(--text-secondary); font-weight:600; font-size:15px;
|
|
427
|
+
}
|
|
428
|
+
.dmm-catalog-icon img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
|
|
429
|
+
.dmm-catalog-title { display:flex; align-items:center; gap:6px; flex-wrap:wrap; font-weight:600; font-size:14px; }
|
|
430
|
+
.dmm-catalog-desc { font-size:13px; line-height:19px; color:var(--text-secondary); margin-top:4px; }
|
|
431
|
+
.dmm-catalog-meta { margin-top:4px; font-size:12px; color:var(--text-tertiary); }
|
|
432
|
+
.dmm-catalog-meta code { font-family:var(--mono); }
|
|
433
|
+
.dmm-catalog-warn {
|
|
434
|
+
margin-top:6px; padding:6px 8px; border-radius:var(--r-chip);
|
|
435
|
+
background:var(--status-yellow-bg); color:var(--status-yellow-text);
|
|
436
|
+
font-size:12px; line-height:17px;
|
|
437
|
+
}
|
|
438
|
+
.dmm-catalog-installs { display:flex; flex-direction:column; gap:6px; margin-top:8px; }
|
|
439
|
+
.dmm-catalog-install {
|
|
440
|
+
display:flex; align-items:center; gap:8px;
|
|
441
|
+
padding:6px 8px; border-radius:var(--r-chip);
|
|
442
|
+
background:var(--bg-secondary-default);
|
|
443
|
+
}
|
|
444
|
+
.dmm-catalog-install-name { font-size:12.5px; color:var(--text-secondary); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
|
|
445
|
+
.dmm-catalog-actions { flex:none; display:flex; flex-direction:row; gap:6px; align-items:flex-start; }
|
|
446
|
+
.dmm-detail-section { margin-top:14px; }
|
|
447
|
+
.dmm-detail-section-title { font-size:12px; font-weight:600; color:var(--text-secondary); text-transform:uppercase; letter-spacing:.04em; margin-bottom:6px; }
|
|
448
|
+
.dmm-detail-grid, .dmm-detail-list { display:flex; flex-direction:column; gap:6px; }
|
|
449
|
+
.dmm-detail-row { display:flex; gap:10px; align-items:flex-start; font-size:13px; line-height:18px; }
|
|
450
|
+
.dmm-detail-label { flex:0 0 124px; color:var(--text-secondary); }
|
|
451
|
+
.dmm-detail-value { flex:1; min-width:0; word-break:break-all; }
|
|
452
|
+
.dmm-code-block {
|
|
453
|
+
margin:0; padding:8px 10px; border-radius:var(--r-chip);
|
|
454
|
+
background:var(--bg-secondary-default); color:var(--text-primary);
|
|
455
|
+
font-family:var(--mono); font-size:12px; line-height:18px;
|
|
456
|
+
white-space:pre-wrap; word-break:break-all;
|
|
457
|
+
}
|
|
458
|
+
.dmm-readme {
|
|
459
|
+
max-height:340px; overflow:auto;
|
|
460
|
+
padding:8px 10px;
|
|
461
|
+
border:1px solid var(--border-table); border-radius:var(--r-chip);
|
|
462
|
+
background:var(--bg-primary-default);
|
|
463
|
+
font-size:13px; line-height:20px;
|
|
464
|
+
}
|
|
465
|
+
.dmm-md-p { margin:4px 0; white-space:pre-wrap; }
|
|
466
|
+
.dmm-md-h1 { font-size:16px; font-weight:600; margin:12px 0 6px; }
|
|
467
|
+
.dmm-md-h2 { font-size:15px; font-weight:600; margin:10px 0 5px; }
|
|
468
|
+
.dmm-md-h3 { font-size:14px; font-weight:600; margin:8px 0 4px; }
|
|
469
|
+
.dmm-md-list { margin:4px 0; padding-left:18px; }
|
|
470
|
+
.dmm-md-list li { margin:2px 0; }
|
|
471
|
+
.dmm-md-code {
|
|
472
|
+
font-family:var(--mono); font-size:12px;
|
|
473
|
+
padding:1px 4px; border-radius:4px;
|
|
474
|
+
background:var(--bg-secondary-default);
|
|
475
|
+
}
|
|
476
|
+
.dmm-catalog-more { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-top:10px; }
|
|
477
|
+
.dmm-modal-head .dmm-segmented { flex-wrap:wrap; }
|
|
478
|
+
.dmm-rank-card {
|
|
479
|
+
display:flex; gap:12px; align-items:flex-start;
|
|
480
|
+
padding:12px; border:1px solid var(--border-table); border-radius:var(--r-ctl);
|
|
481
|
+
background:var(--bg-primary-default);
|
|
482
|
+
}
|
|
483
|
+
.dmm-rank-no {
|
|
484
|
+
flex:none; width:30px; height:30px; border-radius:50%;
|
|
485
|
+
display:flex; align-items:center; justify-content:center;
|
|
486
|
+
font-size:13px; font-weight:600; font-variant-numeric:tabular-nums;
|
|
487
|
+
background:var(--bg-secondary-default); color:var(--text-secondary);
|
|
488
|
+
}
|
|
489
|
+
.dmm-rank-card:nth-child(-n+3) .dmm-rank-no { background:var(--status-yellow-bg); color:var(--status-yellow-text); }
|
|
490
|
+
.dmm-rank-author { font-size:12px; color:var(--text-secondary); }
|
|
491
|
+
.dmm-rank-metrics { display:flex; align-items:center; gap:6px; flex-wrap:wrap; margin-top:6px; }
|
|
492
|
+
.dmm-link { color:var(--accent-600); text-decoration:none; }
|
|
493
|
+
.dmm-link:hover { text-decoration:underline; }
|
|
494
|
+
.dmm[data-theme="dark"] .dmm-link { color:var(--accent-300); }
|
|
495
|
+
.dmm[data-theme="dark"] .dmm-tag.accent { background:var(--accent-700); color:var(--n-50); }
|
|
496
|
+
.dmm-catalog-meta .dmm-link { margin-left:8px; }
|
|
497
|
+
.dmm-check-list { display:flex; flex-direction:column; gap:6px; }
|
|
498
|
+
.dmm-check { display:flex; align-items:center; gap:8px; font-size:13px; cursor:pointer; }
|
|
499
|
+
.dmm-check input { accent-color:var(--accent-500); width:15px; height:15px; }
|
|
500
|
+
.dmm-req { color:var(--text-error); }
|
|
501
|
+
|
|
409
502
|
/* ---------- \u54CD\u5E94\u5F0F ---------- */
|
|
410
503
|
@media (max-width:1080px) { .dmm-kpi-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
|
|
411
504
|
@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
|
+
};
|