@epoch-agent/plugin-mcp 0.1.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/LICENSE ADDED
@@ -0,0 +1,219 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
203
+
204
+ --------------------------------------------------------------------------------
205
+
206
+ epoch-agent
207
+ Copyright 2024-2026 bowen
208
+
209
+ Portions of this software are derived from the Gemini CLI
210
+ (https://github.com/google-gemini/gemini-cli), Copyright 2025 Google LLC,
211
+ licensed under the Apache License, Version 2.0. Those files have been modified;
212
+ each one retains its original copyright notice and SPDX-License-Identifier
213
+ header. See the NOTICE file in the project source repository for the complete
214
+ list of derived files.
215
+
216
+ This software also quotes, with attribution, two lines of prose from OpenAI
217
+ Codex (https://github.com/openai/codex), Copyright 2025 OpenAI, licensed under
218
+ the Apache License, Version 2.0. No source file is a derived work of Codex.
219
+ See the NOTICE file for details.
package/README.md ADDED
@@ -0,0 +1,197 @@
1
+ # @epoch-agent/plugin-mcp
2
+
3
+ MCP (Model Context Protocol) 客户端插件。连接外部 MCP server 扩展工具集。
4
+
5
+ 配置文件位置由 `@epoch-agent/infra` 的 `mcpConfigPath()` 决定
6
+ (认 `EPOCH_HOME` / `EPOCH_PROFILE`),默认 `~/.epoch/mcp.json`。
7
+
8
+ ## 支持 Transport
9
+
10
+ | Transport | 配置 | 场景 |
11
+ | --------------- | ---------------------------------------------- | -------------------- |
12
+ | Stdio | `command` + `args` | 本地 MCP server 进程 |
13
+ | SSE | `url` | 远程 MCP server |
14
+ | Streamable HTTP | `url` + `transport: "http"`(或 `streamable`) | 远程 HTTP 流式 |
15
+
16
+ > ⚠️ **stdio 那档要机器上有 Node。** `command` 是从 **PATH** 解析的
17
+ > (SDK 用 cross-spawn、`shell: false`),而官方配置几乎都是
18
+ > `npx -y @modelcontextprotocol/server-xxx` —— PATH 上没有 `npx` / `node` 就是 ENOENT,
19
+ > 那台 server 起不来(stderr 里那行会进日志)。
20
+ > CLI 用户天然有 Node;**嵌入宿主的用户没有**,那边要宿主自己把 ship 的 node 目录
21
+ > prepend 到 `process.env.PATH`,见 [EMBEDDING.md](../../../docs/EMBEDDING.md) 的
22
+ > 「用户机器上没装 Node」一节。HTTP / SSE 那两档不起子进程,不受这条影响。
23
+
24
+ `transport` 不写时按 `url` 有无推断:有 `url` 走 SSE,没有走 stdio。
25
+ **`type` 是 `transport` 的别名**(MCP 生态里多数客户端的 mcp.json 用的是 `type`),
26
+ 两个都写时听 `transport` 的。收它不是为了顺手:不收的话 `{"type":"http","url":…}`
27
+ 会掉进上面那条「按 `url` 推断」的路,一个 Streamable HTTP server 被**静默连成 SSE**。
28
+
29
+ ## 配置示例
30
+
31
+ `servers` 是**以 server 名为键的对象**,不是数组:
32
+
33
+ > **这份文件现在有两条写法:手写,或者 `epoch web` 的连接器页那枚「添加 server」**
34
+ > (2026-08-18,`POST /api/mcp`)。
35
+ >
36
+ > 界面那条只收三样(传输类型 / 命令或 URL / 环境变量)—— 下面那几格
37
+ > (`timeout` / `oauth` / `headers` …)**仍然只能手写**,所以它加完会把
38
+ > 「写进了哪个文件」印出来,让你接着去补。
39
+ >
40
+ > ⚠️ 界面那条**往原文里插一段**,你的注释、键序、缩进、以及 `connect_timeout` /
41
+ > `type` 这类别名一个字节都不动(它不是「读进来 → 改 → 整份写回」)。
42
+ > 判据全文在 [runtime/src/mcp-config-write.ts](../../runtime/src/mcp-config-write.ts)。
43
+ >
44
+ > ⚠️ 界面那条给的 server 名**收得比这份文件严**(只许字母数字和 `_` `-`)——
45
+ > 手写的不受这条管。理由同下面「插件带的名字为什么更严」:名字会原样进工具名。
46
+
47
+ ```json
48
+ {
49
+ "servers": {
50
+ "filesystem": {
51
+ "command": "npx",
52
+ "args": ["-y", "@modelcontextprotocol/server-filesystem", "/tmp"],
53
+ "env": { "LOG_LEVEL": "warn" }
54
+ },
55
+ "remote": {
56
+ "transport": "http",
57
+ "url": "https://mcp.example.com/mcp",
58
+ "headers": { "Authorization": "Bearer xxx" }
59
+ }
60
+ }
61
+ }
62
+ ```
63
+
64
+ ### 字段
65
+
66
+ | 字段 | 类型 | 说明 |
67
+ | ---------------------- | ----------------------- | ------------------------------- |
68
+ | `transport` / `type` | `stdio\|sse\|http` | 不写按 `url` 推断;互为别名 |
69
+ | `command` / `args` | `string` / `string[]` | stdio 必填 |
70
+ | `url` | `string` | sse / http 必填 |
71
+ | `streamable` | `boolean` | 远程用 Streamable HTTP 而非 SSE |
72
+ | `headers` | `Record<string,string>` | 远程请求头(如 auth) |
73
+ | `env` | `Record<string,string>` | 子进程环境变量 |
74
+ | `timeout` | 秒 | 单次请求超时,默认 300 |
75
+ | `connect_timeout` | 秒 | 建连(含握手)超时,默认 60 |
76
+ | `keepalive_interval` | 秒 | 心跳间隔,默认 180 |
77
+ | `idle_timeout_seconds` | 秒 | 空闲自动断开,0 表示不断 |
78
+ | `max_lifetime_seconds` | 秒 | 连接最大寿命,0 表示不限 |
79
+ | `supports_parallel` | `boolean` | 是否允许并行调用 |
80
+ | `skip_preflight` | `boolean` | 跳过启动预检 |
81
+
82
+ snake_case 和 camelCase 两种写法都收。**未知字段会进启动诊断**(多半是拼错了),
83
+ 配置写错不再静默变成「没有 MCP」—— 每条问题都带文件名 + 字段路径。
84
+
85
+ ⚠️ **`source` 不是这张表里的字段,写在 `mcp.json` 里不生效。** 那一格在
86
+ `McpServerStatus` 上(不在配置上),由**调用方**在 `connectAll(configs, source)`
87
+ 那一下填死。分开是刻意的:来源要是配置的一个字段,用户就能给自己那台贴上
88
+ 「宿主注入」的标 —— 同角色那条「命名空间由装配层拼,宿主自己写的不算数」。
89
+
90
+ ## server 是从哪儿来的:`McpServerStatus.source`
91
+
92
+ 三档:
93
+
94
+ | `source` | 谁带来的 | 名字长什么样 |
95
+ | -------- | --------------------------------------------------------- | ----------------------- |
96
+ | `user` | 上面那份 `~/.epoch/mcp.json` | 你自己写的那个 |
97
+ | `host` | 嵌入宿主 `buildRuntime({hostCapabilities: {mcpServers}})` | `<namespace>__<server>` |
98
+ | `plugin` | 已装插件根下那份 `mcp.json`(方案 44 PR-3) | `<插件名>__<server>` |
99
+
100
+ 前两档一个字节都不落盘 / 落在插件目录里,能力页的连接器那一栏就是按这一格分组的。
101
+
102
+ ⚠️ **加一档要连着改能力页那张 `MCP_GROUPS` 数组**(`web/src/capability/connectors.tsx`)
103
+ —— 那是 `satisfies readonly {…}[]`,多一格**不会**编译红,而页面按组过滤后渲染,
104
+ 漏改的表现是那一档一行都不显示、也没有任何报错。PR-2 实测复现过一次。
105
+
106
+ **后两档的名字都由装配层拼**,用**两个下划线**,而不是专家 / 技能那条路上的
107
+ `<namespace>:`。这不是两套风格:
108
+
109
+ - server 名会原样变成工具名的一部分(`prefixedName()` 拼的
110
+ `mcp__<server>__<tool>`),而工具名是**真的发给 provider** 的;
111
+ - 2026-08-17 实测:带 `:` 的工具名被硬拒 ——
112
+ `tools.0.custom.name: String should match pattern '^[a-zA-Z0-9_-]{1,128}$'`,
113
+ 同一发换成 `mcp__gh__search_issues` 就 200 正常回;
114
+ - 角色名 / 技能名**不上网线进 provider**,所以那边拼 `:` 一直没事。
115
+
116
+ 判据全文(含「为什么这两批的名字收得比 `mcp.json` 严」、两个前缀的**来路差别**
117
+ (宿主那个是 `buildRuntime` 的参数、装配时校验;插件那个是插件名、**安装时**就被
118
+ `PLUGIN_NAME_PATTERN` 卡过了)、以及为什么这一格是必填)在
119
+ [types.ts](src/types.ts) 的 `McpServerStatus.source` 上。
120
+
121
+ ## 功能
122
+
123
+ - 三 transport(stdio / SSE / Streamable HTTP)
124
+ - 工具名前缀 `mcp__<server>__<tool>`,撞名交 `ToolRegistry` 处理
125
+ - 配置校验:语法错误 / 类型错误 / 缺必填字段都进诊断,逐 server 隔离
126
+ - `tools/list` annotations + title 透传到 `EpochTool.annotations`(权限系统消费)
127
+ - schema 缓存:内存优先,磁盘(0600)作降级;按连接配置指纹失效
128
+ - 看门狗式重连:断连**不阻塞**工具调用,重连在后台按 1s/2s/4s 退避
129
+ - keepalive 心跳、idle 超时断开、最大生命周期
130
+ - **OAuth**(`oauth/`):`epoch mcp login` / `logout` 的后端,本机回调 server +
131
+ token 刷新(带 skew)+ 0600 存储。认证过不去时置 `needsLogin`——重连解决不了
132
+ 这个问题,只有重新登录能
133
+ - **resources**:包成每个 server 一对工具
134
+ `mcp__<server>__list_resources` / `mcp__<server>__read_resource`
135
+ - **prompts**:`McpRegistry.listPrompts()` / `getPrompt()`
136
+ - **一台一台地断 / 问它此刻按的哪份配置**(2026-08-18):
137
+ `McpRegistry.disconnect(name)` / `configOf(name)`。在这之前只有 `disconnectAll()`
138
+ —— 而「让**一台** server 在这个进程里消失」是装配层那条「应用 `mcp.json` 的改动」
139
+ 必须做到的事(runtime 的 `applyMcpConfig`):全断再全连会把宿主注入的和插件带来的
140
+ 那两批也连带断掉,而它们一个字节都不在那份文件里。
141
+ ⚠️ `disconnect()` **连带失效 schema 缓存**(同 `reconnect()`),但**不碰工具表**
142
+ —— 把 `mcp:<名字>` 那一组工具从 `ToolRegistry` 里摘掉是装配层的事
143
+
144
+ resources 和 prompts 都**先看 capability 再问**(server 没声明就别问,问了多半得到
145
+ `-32601 Method not found`),都**翻页**(`nextCursor`,上限 50 页),都把
146
+ method-not-found **当空**处理——有些 server 声明了 capability 却没实现,
147
+ 「没有 resources」比「MCP 初始化失败」更贴近事实。
148
+
149
+ resources 包成工具而不是注入上下文:一个 server 挂几十份文档是常态,全量注入等于
150
+ 每一轮都为「模型多半用不到的东西」付 token;而工具是按需调用的,天然懒加载。
151
+
152
+ ## 还没做
153
+
154
+ `notifications/tools/list_changed` 收得到,但**不是热更新**:`AgentLoop` 的工具集是
155
+ 构造参数,本进程内换不掉。registry 只把「工具表已经不是启动时那份了」冒泡给宿主,
156
+ 真正换掉要重启。
157
+
158
+ ## 明确不做的三条(**带判据,不是「以后再说」**)
159
+
160
+ - **sampling / elicitation**(server 反过来请求 client:帮我调一次模型 / 帮我问用户
161
+ 一句)。它要一个新的 `AgentEvent` 变体加一道权限闸门 —— 也就是**动 protocol**,
162
+ 而那是全仓最贵的改动面。硬门槛在权限那一侧而不是协议那一侧:一个 server 能让我们
163
+ 代它调模型,等于它能花我们的钱、并且把内容塞进我们的上下文,那需要先有一套
164
+ 「这次反向请求要不要问用户」的语义。**要做就先定那套语义**,别从 SDK 那头往回接。
165
+ - **MCP server 的目录 / 市场**(对标 hermes 的 `mcp_catalog.py` + `mcp_picker.py`)。
166
+ ⚠️ **别和[方案 32](../../../docs/verify/VERIFY_RECORD-32-runtime-plugins.md) 的插件市场
167
+ 混为一谈**:32 管的是**我们自己的插件**(`~/.epoch/plugins/`),这一条管的是
168
+ 「上哪儿找第三方 MCP server」。两件事,两套来源,两套信任模型。
169
+ - **MCP server 模式**(把 epoch 自己暴露成 MCP server 给别的 agent 用)。
170
+ hermes 有 `mcp_serve.py`、codex 有整个 `codex-mcp/` crate,但那是「被集成」
171
+ 而不是「集成」。更强的版本连同一条**永久红线**(真做也只暴露 `epoch_run`,
172
+ 不把内置工具逐个转出去 —— 那等于让对方绕过我们的权限层)写在
173
+ [方案 28 验收记录第五章](../../../docs/verify/VERIFY_RECORD-28-headless-protocol.md)(那一版
174
+ `epoch mcp serve` 已经砍掉,红线连同重开的条件一起记在那儿)。
175
+
176
+ ## 依赖
177
+
178
+ - `@modelcontextprotocol/sdk`
179
+ - `zod`(配置校验,走 infra 的 `parseLenient`)
180
+ - [protocol](../../protocol) 和 [infra](../../infra) 是 peer
181
+
182
+ ## 开发
183
+
184
+ ```bash
185
+ pnpm --filter @epoch-agent/plugin-mcp test
186
+ ```
187
+
188
+ `__tests__/orphan-reap.test.ts` 真起 server、真查残留,钉的是
189
+ `closeTransportAndReap()` 那三步(拍快照 → 优雅关 → 清扫快照)。**Windows 和 macOS
190
+ 都跑**,改 disconnect 路径必须跑它。
191
+
192
+ ⚠️ 用例里那个「启动器」中间层**必须是 shell**(Windows 生成一个 `.cmd`,POSIX 用
193
+ `/bin/sh -c`),换成 node 写的启动器用例就是空的:Windows 上 node 起的非 detached
194
+ 子进程会被 libuv 的全局 Job Object 连坐收掉,父进程一死孙进程自动没,把清扫整段
195
+ 删掉照样全绿。shell 也更接近真实形态——`npx -y mcp-remote …` 在 Windows 上就是被
196
+ cross-spawn 改写成 `cmd.exe /c npx.cmd …` 的。细节记在
197
+ [验收记录](../../../docs/verify/VERIFY_RECORD-16-process-tree.md) 的「追加二」。