@zhin.js/mcp-feature 1.1.0 → 1.1.1
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 -5
- package/lib/provider.js +4 -5
- package/package.json +3 -3
- package/src/provider.ts +4 -5
package/README.md
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
# @zhin.js/mcp-feature
|
|
2
2
|
|
|
3
|
-
下一代 MCP Client Feature。它从 `
|
|
3
|
+
下一代 MCP Client Feature。它从 `mcps/<name>/index.ts` 发现 provider-neutral client definition,并将连接实例的创建、启动、调用和销毁绑定到 Plugin owner 与 generation lease。
|
|
4
4
|
|
|
5
5
|
## 目录约定
|
|
6
6
|
|
|
7
7
|
```text
|
|
8
|
-
|
|
9
|
-
├── filesystem.ts
|
|
10
|
-
└── memory.ts
|
|
8
|
+
mcps/
|
|
9
|
+
├── filesystem/index.ts
|
|
10
|
+
└── memory/index.ts
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
只发现一级命名目录中的 `index.ts`;同目录其他文件都是该连接的 helper。连接参数、URL、command 和 secret 应从 owner config/resource 读取,不写入另一份全局 MCP 配置 registry。
|
|
14
14
|
|
|
15
15
|
## 定义 MCP Client
|
|
16
16
|
|
package/lib/provider.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { featureId } from '@zhin.js/plugin-runtime';
|
|
2
|
-
import { defineFeatureProvider,
|
|
2
|
+
import { capture, captured, defineFeatureProvider, directoryModules } from '@zhin.js/feature-kit';
|
|
3
3
|
import { parseMcpDefinition } from './definition.js';
|
|
4
4
|
import { McpIndex } from './mcp-index.js';
|
|
5
5
|
export const mcpFeatureId = featureId('zhin.mcp');
|
|
@@ -8,10 +8,9 @@ const mcpFeature = defineFeatureProvider({
|
|
|
8
8
|
id: mcpFeatureId,
|
|
9
9
|
authoring: {
|
|
10
10
|
setupMethod: 'addMcp',
|
|
11
|
-
conventions: [
|
|
12
|
-
id: '
|
|
13
|
-
|
|
14
|
-
recursive: false,
|
|
11
|
+
conventions: [directoryModules({
|
|
12
|
+
id: 'mcps-index',
|
|
13
|
+
layouts: [{ segments: ['mcps', capture('name')], localName: (values) => captured(values, 'name') }],
|
|
15
14
|
})],
|
|
16
15
|
validate: parseMcpDefinition,
|
|
17
16
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zhin.js/mcp-feature",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "Convention-based MCP client Feature for Zhin Plugin Runtime",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
"src"
|
|
18
18
|
],
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@zhin.js/feature-kit": "1.1.
|
|
21
|
-
"@zhin.js/plugin-runtime": "1.1.
|
|
20
|
+
"@zhin.js/feature-kit": "1.1.1",
|
|
21
|
+
"@zhin.js/plugin-runtime": "1.1.10"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"@types/node": "^26.1.2",
|
package/src/provider.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { featureId } from '@zhin.js/plugin-runtime';
|
|
2
|
-
import { defineFeatureProvider,
|
|
2
|
+
import { capture, captured, defineFeatureProvider, directoryModules } from '@zhin.js/feature-kit';
|
|
3
3
|
import { parseMcpDefinition } from './definition.js';
|
|
4
4
|
import { McpIndex } from './mcp-index.js';
|
|
5
5
|
|
|
@@ -10,10 +10,9 @@ const mcpFeature = defineFeatureProvider({
|
|
|
10
10
|
id: mcpFeatureId,
|
|
11
11
|
authoring: {
|
|
12
12
|
setupMethod: 'addMcp',
|
|
13
|
-
conventions: [
|
|
14
|
-
id: '
|
|
15
|
-
|
|
16
|
-
recursive: false,
|
|
13
|
+
conventions: [directoryModules({
|
|
14
|
+
id: 'mcps-index',
|
|
15
|
+
layouts: [{ segments: ['mcps', capture('name')], localName: (values) => captured(values, 'name') }],
|
|
17
16
|
})],
|
|
18
17
|
validate: parseMcpDefinition,
|
|
19
18
|
},
|