@civilization/deepseek-harness-skill-mcp 0.1.8 → 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/README.md +5 -1
- package/package.json +2 -1
- package/skills/extension-management/SKILL.md +78 -0
- package/src/index.js +14 -0
package/README.md
CHANGED
|
@@ -114,7 +114,11 @@ MCP 工具是提供给模型的工具 schema,不是用户 `/` 命令,因此
|
|
|
114
114
|
|
|
115
115
|
MCP 对端离线、命令启动失败或首次工具发现失败不会阻止 DSH 启动。stdio 与 Streamable HTTP 使用 Harness MCP client 的后台重连策略;旧版 SSE 当前依赖连接自身,在断线后可通过刷新配置重新加载。设置页在连接恢复并发现工具后更新状态。插件加载时也会把旧版本写入的严格启动配置迁移为非致命启动策略。
|
|
116
116
|
|
|
117
|
-
## Agent
|
|
117
|
+
## Agent 工具与 Skill
|
|
118
|
+
|
|
119
|
+
插件向 DSH 注册了 `extension-management` Skill 以及 7 个模型专属管理工具:
|
|
120
|
+
|
|
121
|
+
- **`extension-management` Skill**:引导模型掌握受管 Skill 路径与 stdio / streamable-http / sse 模式 MCP 服务器的标准配置结构与安全规约。
|
|
118
122
|
|
|
119
123
|
| 工具 | 作用 |
|
|
120
124
|
|---|---|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@civilization/deepseek-harness-skill-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Skill path and MCP server management for DeepSeek Harness Web",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
"files": [
|
|
25
25
|
"src",
|
|
26
26
|
"lib",
|
|
27
|
+
"skills",
|
|
27
28
|
"cordis.patch.yml",
|
|
28
29
|
"README.md",
|
|
29
30
|
"LICENSE"
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: extension-management
|
|
3
|
+
description: Manage custom Skill directories and Model Context Protocol (MCP) server configurations (stdio, streamable-http, sse) in DeepSeek Harness.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Extension management (Skills & MCP)
|
|
7
|
+
|
|
8
|
+
The `dsh-skill-mcp` plugin manages custom Skill directories and external Model Context Protocol (MCP) servers in DeepSeek Harness (DSH).
|
|
9
|
+
|
|
10
|
+
When the user asks how to configure MCP servers or add custom Skill roots, describe the available tools and configuration schemas directly without probing the workspace.
|
|
11
|
+
|
|
12
|
+
## Core Management Tools
|
|
13
|
+
|
|
14
|
+
1. **`extensions_list`**:
|
|
15
|
+
- Lists all managed Skill sources and MCP configurations along with their enabled/disabled state and transport type.
|
|
16
|
+
- Note: An enabled state indicates authorization in configuration, not necessarily active connection health.
|
|
17
|
+
|
|
18
|
+
2. **`extensions_inspect`**:
|
|
19
|
+
- Inspects the actual Skill catalog currently snapshot for the caller and all visible MCP tools (`mcp__*`).
|
|
20
|
+
- Requires `cwd`. Zero discovered tools does not automatically mean connection failure (servers may still be discovering or starting).
|
|
21
|
+
|
|
22
|
+
3. **`extensions_add_skill`**:
|
|
23
|
+
- Adds an existing directory containing skill folders (each containing a `SKILL.md`).
|
|
24
|
+
- Parameters: `id` (unique internal identifier) and `directory` (absolute local path).
|
|
25
|
+
- Added sources are created disabled by default; call `extensions_set_enabled` to activate.
|
|
26
|
+
|
|
27
|
+
4. **`extensions_add_mcp`**:
|
|
28
|
+
- Adds a new MCP server configuration (created disabled by default).
|
|
29
|
+
- Parameters: `id` and `configuration` (JSON string).
|
|
30
|
+
- Supported transport configurations:
|
|
31
|
+
- **`stdio`**:
|
|
32
|
+
```json
|
|
33
|
+
{
|
|
34
|
+
"transport": "stdio",
|
|
35
|
+
"command": "node",
|
|
36
|
+
"args": ["D:/path/to/server.js"],
|
|
37
|
+
"cwd": "D:/path/to"
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
- **`streamable-http`**:
|
|
41
|
+
```json
|
|
42
|
+
{
|
|
43
|
+
"transport": "streamable-http",
|
|
44
|
+
"url": "http://127.0.0.1:9000/mcp"
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
- **`sse`** (legacy SSE transport):
|
|
48
|
+
```json
|
|
49
|
+
{
|
|
50
|
+
"transport": "sse",
|
|
51
|
+
"url": "http://127.0.0.1:9000/sse"
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
- **Security rules**:
|
|
55
|
+
- Never supply plain-text API secrets, passwords, or authentication tokens in parameters or URLs.
|
|
56
|
+
- URLs with user credentials or access tokens are strictly rejected.
|
|
57
|
+
|
|
58
|
+
5. **`extensions_set_enabled`**:
|
|
59
|
+
- Toggles an extension (`id` and `enabled: true|false`).
|
|
60
|
+
- Enabling a stdio server authorizes its executable to run when the DSH profile reloads.
|
|
61
|
+
|
|
62
|
+
6. **`extensions_update_skill`** & **`extensions_update_mcp`**:
|
|
63
|
+
- Modifies existing Skill directory paths or updates MCP connection configurations while preserving the existing ID and enabled status.
|
|
64
|
+
|
|
65
|
+
7. **`extensions_remove`**:
|
|
66
|
+
- Removes a managed configuration. Removing a Skill source removes its registration in DSH; it does NOT delete any files from the disk.
|
|
67
|
+
|
|
68
|
+
## Recommended Workflows
|
|
69
|
+
|
|
70
|
+
- **Adding a new MCP server**:
|
|
71
|
+
1. Call `extensions_list` to check existing IDs and prevent duplicate names.
|
|
72
|
+
2. Call `extensions_add_mcp` with a descriptive ID and valid JSON configuration.
|
|
73
|
+
3. Call `extensions_set_enabled` with `enabled: true`.
|
|
74
|
+
4. Inform the user that the configuration has been saved to the profile patch and tools will become available upon reload.
|
|
75
|
+
- **Mounting custom skills**:
|
|
76
|
+
1. Verify the target directory contains valid Skill folders with `SKILL.md`.
|
|
77
|
+
2. Call `extensions_add_skill` with an explicit ID.
|
|
78
|
+
3. Call `extensions_set_enabled` to activate.
|
package/src/index.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import Schema from '@deepseek-ai/schemastery'
|
|
3
3
|
import { homedir } from 'node:os'
|
|
4
4
|
import { join } from 'node:path'
|
|
5
|
+
import { readFile } from 'node:fs/promises'
|
|
5
6
|
import { defineTool } from '@deepseek-ai/dsh-tools'
|
|
6
7
|
import { ExtensionStore } from './store.js'
|
|
7
8
|
import { createWebHandler, createWebHttpHandler } from './web.js'
|
|
@@ -18,6 +19,19 @@ const output = {
|
|
|
18
19
|
|
|
19
20
|
/** Register management operations. MCP processes are started only by the profile loader. */
|
|
20
21
|
export async function apply(ctx, config) {
|
|
22
|
+
try {
|
|
23
|
+
const skillPath = new URL('../skills/extension-management/SKILL.md', import.meta.url)
|
|
24
|
+
const skillText = await readFile(skillPath, 'utf8')
|
|
25
|
+
const content = skillText.replace(/^---\r?\n[\s\S]*?\r?\n---\r?\n/, '').trim()
|
|
26
|
+
ctx.effect(() => ctx.skills?.register({
|
|
27
|
+
name: 'extension-management',
|
|
28
|
+
description: 'Manage custom Skill directories and Model Context Protocol (MCP) server configurations.',
|
|
29
|
+
whenToUse: 'Use when configuring, inspecting, adding, or modifying external skills and MCP servers.',
|
|
30
|
+
source: 'bundled',
|
|
31
|
+
content,
|
|
32
|
+
}))
|
|
33
|
+
} catch {}
|
|
34
|
+
|
|
21
35
|
const home = process.env.DSH_HOME || join(homedir(), '.dsh')
|
|
22
36
|
const store = new ExtensionStore(config.patchPath || join(home, 'profiles', 'web', 'cordis.patch.yml'))
|
|
23
37
|
await store.ensureNonFatalMcpStartup()
|