record_safer_pro_mcp 1.0.31 → 1.0.33

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.
Files changed (2) hide show
  1. package/README.md +506 -174
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,136 +1,448 @@
1
- # Record Safer Pro MCP Server
1
+ # Record Safer Pro MCP
2
2
 
3
- [Record Safer Pro](https://www.dadaoaudio.com) AI 接口服务,基于 [Model Context Protocol (MCP)](https://modelcontextprotocol.io) 标准。它让 Claude Desktop、Kiro、Cursor、OpenCode 等客户端能够直接协助你的专业多通道录音工作流。
3
+ Language: [中文](#zh-cn) | [English](#english)
4
4
 
5
- **DADAO 大道声学(北京大道创响科技有限公司)** 开发。
5
+ <a id="zh-cn"></a>
6
+ ## 中文
6
7
 
7
- ## 快速结论
8
+ Record Safer Pro 的官方 MCP Server。它让具备本机执行能力的 AI 客户端,可以直接接入专业多通道录音工作流,完成设备发现、录音准备、开始/停止录音、通道调整、标记管理等核心操作。
8
9
 
9
- - 当前真实 npm 包名和 CLI 命令名都是 `record_safer_pro_mcp`。
10
- - 标准本地接入方式是 `stdio`,推荐命令统一为 `npx -y record_safer_pro_mcp`。
11
- - 本地默认会自动发现 `~/.record_safer` 下的端口和授权 token,不需要手动填写端口。
12
- - 本地开发、解压包调试或未发布场景,再使用 `node /absolute/path/to/dist/index.js`。
10
+ **DADAO 大道声学(北京大道创响科技有限公司)** 开发。
11
+ 官网:[www.dadaoaudio.com](https://www.dadaoaudio.com)
13
12
 
14
- ## 安装与接入
13
+ > **推荐安装方式:AI Direct Install**
14
+ >
15
+ > 把 [`INSTALL_AI.md`](./INSTALL_AI.md) 的全文直接发送给你的 AI Agent,并补充一句:
16
+ >
17
+ > `请按这份说明为我安装 Record Safer Pro MCP,只配置我当前正在使用的客户端,完成后执行 doctor 验证并告诉我结果。`
18
+ >
19
+ > 对大多数用户,这就是最快、最稳妥、最接近“零配置”的安装方式。
15
20
 
16
- ### 1. 安装 Node.js
21
+ ### 为什么优先用 `INSTALL_AI.md`
17
22
 
18
- 需要 Node.js `>= 18`。
23
+ `INSTALL_AI.md` 不是一份给人手动照着点的普通说明书,而是一份为 AI Agent 编写的可执行安装指令。它的设计目标很明确:让 AI 在尽量少打扰用户的前提下,完成一次可靠、选择性、可验证的 MCP 接入。
19
24
 
20
- 安装完成后在终端验证:
25
+ 它会指导 AI:
21
26
 
22
- ```bash
23
- node -v
24
- npx -v
27
+ - 先识别你当前正在使用的客户端,而不是对所有平台一股脑写配置
28
+ - 统一使用 `npx -y record_safer_pro_mcp@latest`,避免全局安装、PATH、缓存版本不一致等常见问题
29
+ - 对 JSON 配置做结构化合并,尽量不破坏现有配置
30
+ - 在安装完成后执行 `--doctor` 做有效性验证,而不是只停留在“看起来写进去了”
31
+
32
+ 如果你的 AI 具备本机命令执行和文件写入能力,这种方式通常比人工逐项配置更快,也更不容易出错。
33
+
34
+ ### 适用对象
35
+
36
+ 这种 AI 直装方式适用于:
37
+
38
+ - Claude Desktop
39
+ - Cursor
40
+ - Gemini CLI
41
+ - OpenCode
42
+ - Kiro
43
+ - Windsurf
44
+
45
+ 前提条件:
46
+
47
+ - 已安装 Node.js `>= 18`
48
+ - 已安装并可启动 Record Safer Pro 桌面应用
49
+ - 你使用的 AI Agent 具备本机终端执行和本地配置文件修改能力
50
+
51
+ ### 标准使用方式
52
+
53
+ 最推荐的做法只有两步:
54
+
55
+ #### 1. 把安装说明直接喂给 AI
56
+
57
+ 打开 [`INSTALL_AI.md`](./INSTALL_AI.md),将全文粘贴给你的 AI Agent。
58
+
59
+ #### 2. 追加一句明确指令
60
+
61
+ 可以直接使用下面这段话:
62
+
63
+ ```text
64
+ 请按这份 INSTALL_AI.md 为我安装 Record Safer Pro MCP。
65
+ 要求:
66
+ 1. 只配置我当前正在使用或已经安装的 AI 客户端。
67
+ 2. 不要修改我未使用的平台配置。
68
+ 3. 统一使用 npx -y record_safer_pro_mcp@latest。
69
+ 4. 修改 JSON 时保持原文件合法。
70
+ 5. 安装完成后执行 --doctor,并告诉我结果。
25
71
  ```
26
72
 
27
- ### 2. 启动 Record Safer Pro
73
+ 这套方式的核心价值不是“让用户少看文档”,而是把安装本身变成一项可以交付给 AI 的标准化动作。
28
74
 
29
- 先启动 Record Safer Pro 桌面应用,再重启你的 AI 客户端。
75
+ ### AI 安装完成后应有的结果
30
76
 
31
- 本地默认会自动发现后端地址与授权 token,无需手动配置端口。对于多数非只读控制操作,如果后端暂时不可达,macOS 上 MCP 也会尝试自动拉起桌面应用;只读查询工具仍建议你先手动打开应用。
77
+ 一个合格的安装结果,通常会同时满足以下几点:
32
78
 
33
- ### 3. 添加客户端配置
79
+ - AI 只修改了与你当前环境相关的 MCP 配置文件
80
+ - MCP 启动命令统一为 `npx -y record_safer_pro_mcp@latest`
81
+ - 需要重启或 reload 的客户端,AI 已明确提示你执行
82
+ - `npx -y record_safer_pro_mcp@latest --doctor` 返回成功结果
83
+ - Record Safer Pro 桌面应用可以被正常发现,且无需手动填写本地端口
34
84
 
35
- 以下示例都基于当前实际代码,统一使用 `record_safer_pro_mcp`。
85
+ ### 手动配置
36
86
 
37
- #### Claude Desktop
87
+ 只有在你的 AI 无法直接改本机文件,或者你明确希望人工接入时,才建议使用手动方式。
38
88
 
39
- 编辑 `~/Library/Application Support/Claude/claude_desktop_config.json`:
89
+ 当前实际 npm 包名和 CLI 命令名都是:
90
+
91
+ ```bash
92
+ record_safer_pro_mcp
93
+ ```
94
+
95
+ 推荐统一命令:
96
+
97
+ ```bash
98
+ npx -y record_safer_pro_mcp@latest
99
+ ```
100
+
101
+ 各客户端的常见接入位置如下:
102
+
103
+ | 客户端 | 常见配置位置 | 配置方式 |
104
+ | --- | --- | --- |
105
+ | Gemini CLI | 命令行 | `gemini mcp add record-safer-pro --scope user npx -y record_safer_pro_mcp@latest` |
106
+ | Claude Desktop | `~/Library/Application Support/Claude/claude_desktop_config.json` | 在 `mcpServers` 中加入 `record-safer-pro` |
107
+ | Cursor | `~/.cursor/mcp.json` 或项目内 `.cursor/mcp.json` | 在 `mcpServers` 中加入 `record-safer-pro` |
108
+ | Windsurf | `~/.codeium/windsurf/mcp_config.json` | 在 `mcpServers` 中加入 `record-safer-pro` |
109
+ | Kiro | `~/.kiro/settings/mcp.json` 或项目内 `.kiro/settings/mcp.json` | 在 `mcpServers` 中加入 `record-safer-pro` |
110
+ | OpenCode | `~/.config/opencode/opencode.json(.jsonc)`、项目内 `opencode.json` 或 `.mcp.json` | 在 `mcp` 中加入 `record-safer-pro` |
111
+
112
+ 通用 `stdio` 配置形态如下:
40
113
 
41
114
  ```json
42
115
  {
43
116
  "mcpServers": {
44
117
  "record-safer-pro": {
45
118
  "command": "npx",
46
- "args": ["-y", "record_safer_pro_mcp"]
119
+ "args": ["-y", "record_safer_pro_mcp@latest"]
47
120
  }
48
121
  }
49
122
  }
50
123
  ```
51
124
 
52
- #### Kiro
53
-
54
- 编辑项目目录下的 `.kiro/settings/mcp.json`:
125
+ OpenCode 使用的结构略有不同:
55
126
 
56
127
  ```json
57
128
  {
58
- "mcpServers": {
129
+ "$schema": "https://opencode.ai/config.json",
130
+ "mcp": {
59
131
  "record-safer-pro": {
60
- "command": "npx",
61
- "args": ["-y", "record_safer_pro_mcp"]
132
+ "type": "local",
133
+ "command": ["npx", "-y", "record_safer_pro_mcp@latest"],
134
+ "enabled": true
62
135
  }
63
136
  }
64
137
  }
65
138
  ```
66
139
 
67
- #### Cursor
140
+ 更完整的平台级安装细节,直接参考 [`INSTALL_AI.md`](./INSTALL_AI.md)。
141
+
142
+ ### 安装验证
143
+
144
+ 不要把终端里运行 `npx -y record_safer_pro_mcp@latest` 后“没有输出”误判为失败。
145
+
146
+ 默认模式会启动 `stdio` MCP Server 并持续等待客户端接管,因此终端看起来像“卡住”是正常行为。正确的验证方式是:
147
+
148
+ ```bash
149
+ npx -y record_safer_pro_mcp@latest --version
150
+ npx -y record_safer_pro_mcp@latest --doctor
151
+ ```
152
+
153
+ 预期结果:
154
+
155
+ - `--version` 输出当前安装版本
156
+ - `--doctor` 输出诊断结果 JSON
157
+
158
+ 如果这两个命令正常,说明安装链路和启动链路基本可用。
159
+
160
+ ### 运行机制
161
+
162
+ 当前默认接入方式是本地 `stdio`。
163
+
164
+ 服务端会自动发现本机 Record Safer Pro 后端地址和授权 token,默认无需手动填写端口。对多数本地用户而言,安装完成后只需要:
165
+
166
+ - 启动 Record Safer Pro 桌面应用
167
+ - 重启或 reload 你的 AI 客户端
168
+ - 直接开始使用自然语言调用录音能力
169
+
170
+ 当前实际行为:
171
+
172
+ - 本地默认自动发现 `~/.record_safer` 下的端口和授权 token
173
+ - macOS 下,部分非只读控制操作在后端暂时不可达时,会尝试自动拉起桌面应用
174
+ - 只读查询工具更适合在桌面应用已打开的前提下使用
175
+
176
+ ### 能力范围
177
+
178
+ 当前 MCP Server 聚焦高频核心录音能力,适合在实际录音现场由 AI 协助完成以下工作:
179
+
180
+ | 类别 | 能力 |
181
+ | --- | --- |
182
+ | 录音前准备 | 预览设置、确认设置、打开录音界面 |
183
+ | 设备发现 | 列出当前可用音频输入设备 |
184
+ | 录音控制 | 开始录音、停止录音、定时开始、定时停止、取消定时 |
185
+ | 录音状态 | 获取通道、混音、健康状态、最小录音状态 |
186
+ | 通道操作 | 重命名通道、调颜色、音量、声像、solo、mute、反相 |
187
+ | 录音中管理 | 添加标记、列出轨道、列出标记、重命名标记 |
188
+
189
+ 当前仅暴露 24 个高频核心工具,不通过 MCP 暴露以下能力:
190
+
191
+ - 系统设置
192
+ - 更新
193
+ - 激活
194
+ - 存储管理
195
+ - 文件分割等扩展功能
196
+
197
+ ### 关键行为边界
198
+
199
+ 为了让 AI 在录音流程中表现稳定,以下语义边界很重要:
200
+
201
+ - `start_record_mcp` 的职责是打开录音界面并准备本次会话,不等于真正开始录音
202
+ - 真正开始录音需要后续显式调用 `start_recording`
203
+ - 如果 `get_status` 已返回 `ready=true`,应优先沿用当前已准备好的会话,而不是重复初始化
204
+ - 如果你没有指定声卡,AI 应先调用 `list_audio_devices`,再让你选择
205
+ - 如果你没有指定通道,默认使用所选声卡的全部输入通道
206
+
207
+ 默认录音设置为:
208
+
209
+ - 所选声卡当前或默认采样率
210
+ - `24-bit`
211
+ - `wav`
212
+ - 安全模式
213
+ - `~/Desktop`
214
+
215
+ ### 使用示例
216
+
217
+ 安装完成后,可以直接让 AI 这样操作:
68
218
 
69
- Settings -> MCP 中添加,或编辑 `.cursor/mcp.json`:
219
+ - “用 RME Babyface,通道 1-4,WAV,默认 48k/24bit 和桌面路径,帮我打开录音界面并准备录音”
220
+ - “先列出当前可用声卡,我来选一个,然后按默认参数准备录音”
221
+ - “5 分钟后开始录音,并在开始后 30 分钟自动停止”
222
+ - “帮我看一下当前录音健康状态”
223
+ - “我已经在录音界面,把 3 号通道静音”
224
+ - “在当前位置添加一个标记,命名为‘第二段’”
225
+ - “停止录音”
226
+
227
+ ### 本地开发与离线模式
228
+
229
+ 如果你在本地开发 `record_safer_mcp`,或者所处环境无法使用 npm 在线拉取包,可以直接指向本地 `dist/index.js`:
230
+
231
+ ```bash
232
+ node /absolute/path/to/record_safer_mcp/dist/index.js
233
+ ```
234
+
235
+ 例如 Claude Desktop:
70
236
 
71
237
  ```json
72
238
  {
73
239
  "mcpServers": {
74
240
  "record-safer-pro": {
75
- "command": "npx",
76
- "args": ["-y", "record_safer_pro_mcp"]
241
+ "command": "node",
242
+ "args": ["/absolute/path/to/record_safer_mcp/dist/index.js"]
77
243
  }
78
244
  }
79
245
  }
80
246
  ```
81
247
 
82
- #### OpenCode
83
-
84
- 编辑 `opencode.json`:
248
+ 如果你明确要覆盖目标后端地址,再额外设置环境变量,例如:
85
249
 
86
250
  ```json
87
251
  {
88
- "$schema": "https://opencode.ai/config.json",
89
- "mcp": {
252
+ "mcpServers": {
90
253
  "record-safer-pro": {
91
- "type": "local",
92
- "command": ["npx", "-y", "record_safer_pro_mcp"],
93
- "enabled": true,
94
- "timeout": 30000
254
+ "command": "node",
255
+ "args": ["/absolute/path/to/record_safer_mcp/dist/index.js"],
256
+ "env": {
257
+ "RECORD_SAFER_URL": "http://127.0.0.1:你的端口号"
258
+ }
95
259
  }
96
260
  }
97
261
  }
98
262
  ```
99
263
 
100
- ## 验证安装是否成功
264
+ ### Streamable HTTP 远程模式
101
265
 
102
- 不要只看 `npx -y record_safer_pro_mcp` 是否“卡住”。默认模式会启动 `stdio` MCP Server 并持续等待客户端接管,所以终端看起来像“没有输出”是正常现象。
266
+ 当前代码也支持可选的 `streamable-http` 传输,适用于 OpenAI Developer Mode 或需要远程暴露 MCP 的场景。
103
267
 
104
- 请用下面两个命令做一次性验证:
268
+ 默认环境变量:
269
+
270
+ - `RECORD_SAFER_MCP_TRANSPORT=stdio`
271
+ - `RECORD_SAFER_MCP_HTTP_HOST=127.0.0.1`
272
+ - `RECORD_SAFER_MCP_HTTP_PORT=3010`
273
+ - `RECORD_SAFER_MCP_HTTP_PATH=/mcp`
274
+
275
+ 示例:
105
276
 
106
277
  ```bash
107
- npx -y record_safer_pro_mcp --version
108
- npx -y record_safer_pro_mcp --doctor
278
+ RECORD_SAFER_MCP_TRANSPORT=streamable-http \
279
+ RECORD_SAFER_MCP_HTTP_HOST=127.0.0.1 \
280
+ RECORD_SAFER_MCP_HTTP_PORT=3010 \
281
+ npx -y record_safer_pro_mcp@latest
109
282
  ```
110
283
 
111
- 预期结果:
284
+ 启动后默认端点:
285
+
286
+ - MCP: `http://127.0.0.1:3010/mcp`
287
+ - Health: `http://127.0.0.1:3010/healthz`
288
+
289
+ 安全约束:
290
+
291
+ - 当 `RECORD_SAFER_MCP_HTTP_HOST` 为非回环地址,例如 `0.0.0.0`,必须同时设置 `RECORD_SAFER_MCP_HTTP_BEARER_TOKEN`
292
+ - 可选使用 `RECORD_SAFER_MCP_HTTP_ALLOWED_HOSTS` 限制允许的 Host
293
+ - 对公网客户端暴露时,必须通过 HTTPS 反向代理对外提供服务
294
+ - 如果 `RECORD_SAFER_URL` 指向非回环地址,默认不会把本机 `~/.record_safer/auth_token` 自动发送到远端
295
+
296
+ ### 常见问题
112
297
 
113
- - `--version` 会输出当前已发布版本。
114
- - `--doctor` 会输出 JSON,并包含当前实际代码返回的这些字段:`ok`、`packageName`、`version`、`nodeVersion`、`transport`。
298
+ **Q: AI 提示无法连接 Record Safer Pro?**
299
+
300
+ 先确认 Record Safer Pro 桌面应用已经启动并完成初始化。MCP 依赖本机录音服务和授权 token。若仍失败,重启 AI 客户端后再重试。
301
+
302
+ **Q: 提示找不到 `npx` 命令?**
303
+
304
+ 需要先安装 Node.js `>= 18`。安装完成后确认:
115
305
 
116
- ## 本地 dist / 解压包配置
306
+ ```bash
307
+ node -v
308
+ npx -v
309
+ ```
117
310
 
118
- 如果你在本地开发 `record_safer_mcp`,或者正在使用解压后的 `dist/index.js`,改用下面这种配置。
311
+ **Q: 我在终端运行 `npx -y record_safer_pro_mcp@latest` 后没有任何输出,是不是安装失败了?**
312
+
313
+ 不是。默认行为就是等待客户端接管的 `stdio` Server。请使用 `--version` 和 `--doctor` 验证,而不是直接通过“是否卡住”来判断。
314
+
315
+ **Q: 正常情况下需要手动配置端口吗?**
316
+
317
+ 不需要。默认会自动发现本机端口和 token。只有在你明确覆盖目标后端时,才需要设置 `RECORD_SAFER_URL`。
318
+
319
+ **Q: 为什么 README 反复强调把 `INSTALL_AI.md` 直接发给 AI?**
320
+
321
+ 因为这是目前最贴近真实用户路径的安装方式。相比人工阅读后再逐步配置,它更标准化、更可复制,也更适合产品交付和团队支持。
322
+
323
+ ---
119
324
 
120
- Claude Desktop 示例:
325
+ <a id="english"></a>
326
+ ## English
327
+
328
+ The official MCP server for Record Safer Pro. It allows AI clients with local execution capability to connect directly to a professional multichannel recording workflow and handle core tasks such as device discovery, recording preparation, start/stop recording, channel control, and marker management.
329
+
330
+ Built by **DADAO Audio (Beijing Dadao Chuangxiang Technology Co., Ltd.)**.
331
+ Website: [www.dadaoaudio.com](https://www.dadaoaudio.com)
332
+
333
+ > **Recommended installation path: AI Direct Install**
334
+ >
335
+ > Send the full contents of [`INSTALL_AI.md`](./INSTALL_AI.md) directly to your AI agent, then add this instruction:
336
+ >
337
+ > `Please install Record Safer Pro MCP based on this guide, configure only the client I currently use, run doctor after setup, and tell me the result.`
338
+ >
339
+ > For most users, this is the fastest, safest, and closest-to-zero-config installation path.
340
+
341
+ ### Why `INSTALL_AI.md` Comes First
342
+
343
+ `INSTALL_AI.md` is not a conventional step-by-step document written for manual setup. It is an executable installation brief written for AI agents. Its purpose is clear: let AI complete a reliable, selective, and verifiable MCP setup with minimal user interruption.
344
+
345
+ It tells the AI to:
346
+
347
+ - detect the client you actually use instead of writing configuration for every platform
348
+ - standardize on `npx -y record_safer_pro_mcp@latest` to avoid global install issues, PATH problems, and stale cached versions
349
+ - merge JSON configuration safely instead of overwriting or breaking existing files
350
+ - run `--doctor` after setup so installation is verified, not just "apparently written"
351
+
352
+ If your AI can run local commands and edit local files, this approach is usually faster and more reliable than manual configuration.
353
+
354
+ ### Who This Is For
355
+
356
+ This AI-driven installation flow is designed for:
357
+
358
+ - Claude Code
359
+ - Cursor
360
+ - Gemini CLI
361
+ - OpenCode
362
+ - Kiro
363
+ - Windsurf
364
+
365
+ Prerequisites:
366
+
367
+ - Node.js `>= 18` is installed
368
+ - The Record Safer Pro desktop application is installed and can be launched
369
+ - Your AI agent has permission to run local terminal commands and edit local configuration files
370
+
371
+ ### Recommended Workflow
372
+
373
+ The recommended setup has only two steps.
374
+
375
+ #### 1. Feed the installation guide directly to AI
376
+
377
+ Open [`INSTALL_AI.md`](./INSTALL_AI.md) and paste the full file into your AI agent.
378
+
379
+ #### 2. Add an explicit execution instruction
380
+
381
+ You can use this exact prompt:
382
+
383
+ ```text
384
+ Please install Record Safer Pro MCP based on this INSTALL_AI.md.
385
+ Requirements:
386
+ 1. Configure only the AI client I currently use or already have installed.
387
+ 2. Do not modify configuration for platforms I do not use.
388
+ 3. Use npx -y record_safer_pro_mcp@latest consistently.
389
+ 4. Keep all edited JSON files valid.
390
+ 5. Run --doctor after installation and tell me the result.
391
+ ```
392
+
393
+ The value of this workflow is not merely that the user reads less documentation. The real value is that installation becomes a standardized task that can be delegated to AI and executed consistently.
394
+
395
+ ### What a Successful AI Installation Looks Like
396
+
397
+ A good installation outcome should usually meet all of the following:
398
+
399
+ - the AI edits only MCP configuration files relevant to your actual environment
400
+ - the launch command is standardized as `npx -y record_safer_pro_mcp@latest`
401
+ - any required restart or reload step is clearly communicated
402
+ - `npx -y record_safer_pro_mcp@latest --doctor` completes successfully
403
+ - the Record Safer Pro desktop app is discovered automatically without manual port configuration
404
+
405
+ ### Manual Setup
406
+
407
+ Manual setup is recommended only when your AI cannot modify local files directly or when you explicitly want to wire it by hand.
408
+
409
+ The current npm package name and CLI command are:
410
+
411
+ ```bash
412
+ record_safer_pro_mcp
413
+ ```
414
+
415
+ Recommended standard command:
416
+
417
+ ```bash
418
+ npx -y record_safer_pro_mcp@latest
419
+ ```
420
+
421
+ Common integration points:
422
+
423
+ | Client | Common config location | Integration method |
424
+ | --- | --- | --- |
425
+ | Gemini CLI | command line | `gemini mcp add record-safer-pro --scope user npx -y record_safer_pro_mcp@latest` |
426
+ | Claude Desktop | `~/Library/Application Support/Claude/claude_desktop_config.json` | add `record-safer-pro` under `mcpServers` |
427
+ | Cursor | `~/.cursor/mcp.json` or project `.cursor/mcp.json` | add `record-safer-pro` under `mcpServers` |
428
+ | Windsurf | `~/.codeium/windsurf/mcp_config.json` | add `record-safer-pro` under `mcpServers` |
429
+ | Kiro | `~/.kiro/settings/mcp.json` or project `.kiro/settings/mcp.json` | add `record-safer-pro` under `mcpServers` |
430
+ | OpenCode | `~/.config/opencode/opencode.json(.jsonc)`, project `opencode.json`, or `.mcp.json` | add `record-safer-pro` under `mcp` |
431
+
432
+ Standard `stdio` shape:
121
433
 
122
434
  ```json
123
435
  {
124
436
  "mcpServers": {
125
437
  "record-safer-pro": {
126
- "command": "node",
127
- "args": ["/absolute/path/to/record_safer_mcp/dist/index.js"]
438
+ "command": "npx",
439
+ "args": ["-y", "record_safer_pro_mcp@latest"]
128
440
  }
129
441
  }
130
442
  }
131
443
  ```
132
444
 
133
- OpenCode 示例:
445
+ OpenCode uses a slightly different structure:
134
446
 
135
447
  ```json
136
448
  {
@@ -138,15 +450,122 @@ OpenCode 示例:
138
450
  "mcp": {
139
451
  "record-safer-pro": {
140
452
  "type": "local",
141
- "command": ["node", "/absolute/path/to/record_safer_mcp/dist/index.js"],
142
- "enabled": true,
143
- "timeout": 30000
453
+ "command": ["npx", "-y", "record_safer_pro_mcp@latest"],
454
+ "enabled": true
144
455
  }
145
456
  }
146
457
  }
147
458
  ```
148
459
 
149
- 本地默认同样会自动发现端口和 token。只有在你明确覆盖目标后端时,才需要额外设置环境变量,例如:
460
+ For full platform-specific installation details, refer to [`INSTALL_AI.md`](./INSTALL_AI.md).
461
+
462
+ ### Installation Verification
463
+
464
+ Do not treat "no output" from `npx -y record_safer_pro_mcp@latest` as an installation failure.
465
+
466
+ By default, the server starts in `stdio` mode and waits for the client to attach, so the terminal may appear to hang. The correct way to validate installation is:
467
+
468
+ ```bash
469
+ npx -y record_safer_pro_mcp@latest --version
470
+ npx -y record_safer_pro_mcp@latest --doctor
471
+ ```
472
+
473
+ Expected behavior:
474
+
475
+ - `--version` prints the installed version
476
+ - `--doctor` prints diagnostic JSON
477
+
478
+ If both commands succeed, the install and startup path is generally working.
479
+
480
+ ### How It Works
481
+
482
+ The default integration mode is local `stdio`.
483
+
484
+ The server automatically discovers the local Record Safer Pro backend address and auth token, so manual port input is not required in the normal local workflow. For most users, installation is followed by only three actions:
485
+
486
+ - launch the Record Safer Pro desktop app
487
+ - restart or reload your AI client
488
+ - start using natural-language recording commands
489
+
490
+ Current runtime behavior:
491
+
492
+ - local port and auth token are discovered automatically from `~/.record_safer`
493
+ - on macOS, some non-read-only control actions may attempt to auto-launch the desktop app if the backend is temporarily unavailable
494
+ - read-only inspection tools work best when the desktop app is already running
495
+
496
+ ### Capability Scope
497
+
498
+ The current MCP server is intentionally focused on high-frequency recording tasks that are practical during real sessions:
499
+
500
+ | Category | Capability |
501
+ | --- | --- |
502
+ | Pre-record setup | preview setup, confirm setup, open recording screen |
503
+ | Device discovery | list currently available audio input devices |
504
+ | Recording control | start recording, stop recording, scheduled start, scheduled stop, cancel schedule |
505
+ | Recording status | retrieve channels, mix, health, and minimal status |
506
+ | Channel operations | rename channel, set color, volume, pan, solo, mute, phase invert |
507
+ | In-session management | add markers, list tracks, list markers, rename markers |
508
+
509
+ Only 24 high-frequency core tools are exposed at this time. The following capabilities are intentionally not exposed through MCP:
510
+
511
+ - system settings
512
+ - updates
513
+ - activation
514
+ - storage management
515
+ - extended features such as file splitting
516
+
517
+ ### Important Behavioral Boundaries
518
+
519
+ To keep AI behavior stable in real recording workflows, these semantics matter:
520
+
521
+ - `start_record_mcp` prepares the recording session and opens the recording screen; it does not actually start recording
522
+ - actual recording still requires an explicit `start_recording` step
523
+ - if `get_status` already returns `ready=true`, the existing prepared session should be reused rather than reinitialized
524
+ - if no audio device is specified, the AI should call `list_audio_devices` first and let the user choose
525
+ - if no channels are specified, the default is all input channels of the selected device
526
+
527
+ Default recording settings:
528
+
529
+ - the selected interface's current or default sample rate
530
+ - `24-bit`
531
+ - `wav`
532
+ - safe mode
533
+ - `~/Desktop`
534
+
535
+ ### Example Prompts
536
+
537
+ After setup, you can instruct AI with prompts like:
538
+
539
+ - "Use RME Babyface on channels 1-4, WAV, default 48k/24-bit, Desktop path, and prepare the recording screen for me."
540
+ - "List the currently available audio devices first. I'll choose one, then prepare recording with the default settings."
541
+ - "Start recording in 5 minutes and stop automatically 30 minutes later."
542
+ - "Check the current recording health status."
543
+ - "I'm already on the recording screen. Mute channel 3."
544
+ - "Add a marker here and name it Second Segment."
545
+ - "Stop recording."
546
+
547
+ ### Local Development and Offline Mode
548
+
549
+ If you are developing `record_safer_mcp` locally, or if your environment cannot fetch the npm package online, point the client directly to the local `dist/index.js`:
550
+
551
+ ```bash
552
+ node /absolute/path/to/record_safer_mcp/dist/index.js
553
+ ```
554
+
555
+ Claude Desktop example:
556
+
557
+ ```json
558
+ {
559
+ "mcpServers": {
560
+ "record-safer-pro": {
561
+ "command": "node",
562
+ "args": ["/absolute/path/to/record_safer_mcp/dist/index.js"]
563
+ }
564
+ }
565
+ }
566
+ ```
567
+
568
+ If you explicitly want to override the backend target, add environment variables such as:
150
569
 
151
570
  ```json
152
571
  {
@@ -155,159 +574,72 @@ OpenCode 示例:
155
574
  "command": "node",
156
575
  "args": ["/absolute/path/to/record_safer_mcp/dist/index.js"],
157
576
  "env": {
158
- "RECORD_SAFER_URL": "http://127.0.0.1:你的端口号"
577
+ "RECORD_SAFER_URL": "http://127.0.0.1:your-port"
159
578
  }
160
579
  }
161
580
  }
162
581
  }
163
582
  ```
164
583
 
165
- ## 功能一览
166
-
167
- 安装后,AI 助手可以帮你完成这些高频操作:
168
-
169
- | 类别 | 能力 |
170
- |------|------|
171
- | 录音前准备 | 预览设置、确认设置、打开录音界面 |
172
- | 设备发现 | 列出当前可用音频输入设备 |
173
- | 录音控制 | 显式开始/停止录音,或定时开始/定时停止/取消定时 |
174
- | 录音状态 | 获取通道、混音、健康状态、最小录音状态 |
175
- | 通道调整 | 重命名通道、调整颜色、调音量、调声像、solo、mute、切换反相 |
176
- | 录音中操作 | 添加标记、查看轨道、查看标记、重命名标记 |
177
-
178
- 当前 MCP Server 只保留高频核心工具,共 24 个:
179
-
180
- - `list_audio_devices`
181
- - `preview_record_mcp_setup`
182
- - `confirm_record_mcp_setup`
183
- - `start_record_mcp`
184
- - `start_recording`
185
- - `schedule_start_recording`
186
- - `schedule_stop_recording`
187
- - `cancel_scheduled_recording`
188
- - `get_channels`
189
- - `get_mix`
190
- - `get_health`
191
- - `get_status`
192
- - `stop_recording`
193
- - `list_tracks`
194
- - `list_markers`
195
- - `add_marker`
196
- - `rename_marker`
197
- - `rename_channel`
198
- - `set_channel_color`
199
- - `set_channel_volume`
200
- - `set_channel_pan`
201
- - `set_channel_solo`
202
- - `set_channel_mute`
203
- - `set_channel_phase_invert`
204
-
205
- 以下能力当前不通过 MCP 暴露,必须在 GUI 中手动完成:
206
-
207
- - 系统设置
208
- - 更新
209
- - 激活
210
- - 存储管理
211
- - 文件分割等扩展功能
212
-
213
- ## 当前实际行为约束
584
+ ### Streamable HTTP Remote Mode
214
585
 
215
- - `start_record_mcp` 的职责是“在你确认完整配置后,打开录音界面并准备本次会话”,不是“开始录音”。
216
- - `start_recording` 仍然是后续单独动作,必须在录音界面已经准备好后再显式确认。
217
- - 如果 `get_status` 已经返回 `ready=true`,MCP 应直接沿用当前准备好的录音会话,而不是强制重新走一遍初始化。
218
- - 如果你没有指定声卡,AI 应先调用 `list_audio_devices`,把这次返回的所有输入设备完整展示给你选择。
219
- - 如果你没有指定通道,默认会使用所选声卡的全部输入通道;确认清单里显示的通道数必须是实际会录进去的通道数。
220
- - 默认录音设置是:所选声卡当前或默认采样率、`24-bit`、`wav`、安全模式、`~/Desktop`。
586
+ The current codebase also supports optional `streamable-http` transport for OpenAI Developer Mode and other remote MCP deployment scenarios.
221
587
 
222
- ## Streamable HTTP 远程模式
223
-
224
- 为了兼容 OpenAI Developer Mode / remote MCP 场景,当前实际代码也支持可选的 `Streamable HTTP` 传输。
225
-
226
- 默认环境变量:
588
+ Default environment variables:
227
589
 
228
590
  - `RECORD_SAFER_MCP_TRANSPORT=stdio`
229
591
  - `RECORD_SAFER_MCP_HTTP_HOST=127.0.0.1`
230
592
  - `RECORD_SAFER_MCP_HTTP_PORT=3010`
231
593
  - `RECORD_SAFER_MCP_HTTP_PATH=/mcp`
232
594
 
233
- 切到远程模式:
595
+ Example:
234
596
 
235
597
  ```bash
236
598
  RECORD_SAFER_MCP_TRANSPORT=streamable-http \
237
599
  RECORD_SAFER_MCP_HTTP_HOST=127.0.0.1 \
238
600
  RECORD_SAFER_MCP_HTTP_PORT=3010 \
239
- npx -y record_safer_pro_mcp
601
+ npx -y record_safer_pro_mcp@latest
240
602
  ```
241
603
 
242
- 启动后默认端点:
604
+ Default endpoints after launch:
243
605
 
244
606
  - MCP: `http://127.0.0.1:3010/mcp`
245
607
  - Health: `http://127.0.0.1:3010/healthz`
246
608
 
247
- 安全约束:
248
-
249
- - 当 `RECORD_SAFER_MCP_HTTP_HOST` 是非回环地址,例如 `0.0.0.0`,必须同时设置 `RECORD_SAFER_MCP_HTTP_BEARER_TOKEN`。
250
- - 可选设置 `RECORD_SAFER_MCP_HTTP_ALLOWED_HOSTS=your-domain.com,localhost` 来限制允许的 Host 头。
251
- - 如果要给公网客户端或 OpenAI Developer Mode 使用,必须通过 HTTPS 对外暴露,建议放在 HTTPS 反向代理之后。
252
- - 如果你把 `RECORD_SAFER_URL` 指向非回环地址,当前代码默认会拒绝把本机 `~/.record_safer/auth_token` 发给远端;这时请显式设置 `RECORD_SAFER_TOKEN`,或使用远端 token 白名单环境变量。
253
-
254
- 带鉴权的示例:
255
-
256
- ```bash
257
- RECORD_SAFER_MCP_TRANSPORT=streamable-http \
258
- RECORD_SAFER_MCP_HTTP_HOST=0.0.0.0 \
259
- RECORD_SAFER_MCP_HTTP_PORT=3010 \
260
- RECORD_SAFER_MCP_HTTP_BEARER_TOKEN=replace-with-a-long-random-token \
261
- RECORD_SAFER_MCP_HTTP_ALLOWED_HOSTS=your-domain.com \
262
- npx -y record_safer_pro_mcp
263
- ```
609
+ Security constraints:
264
610
 
265
- ## 使用示例
611
+ - if `RECORD_SAFER_MCP_HTTP_HOST` is set to a non-loopback address such as `0.0.0.0`, you must also set `RECORD_SAFER_MCP_HTTP_BEARER_TOKEN`
612
+ - you may optionally restrict allowed hosts with `RECORD_SAFER_MCP_HTTP_ALLOWED_HOSTS`
613
+ - if exposed publicly, the service should be placed behind HTTPS reverse proxying
614
+ - if `RECORD_SAFER_URL` points to a non-loopback target, the local `~/.record_safer/auth_token` is not forwarded automatically by default
266
615
 
267
- 配置完成后,你可以直接用自然语言让 AI 操作 Record Safer Pro:
616
+ ### FAQ
268
617
 
269
- - "用 RME Babyface,通道 1-4,WAV,默认 48k/24bit 和桌面路径,帮我打开录音界面并准备录音"
270
- - "帮我开始一个录音,先列出当前可用声卡让我选择;如果我没特别说明,就按 wav、24-bit、安全模式和桌面路径准备"
271
- - "5 分钟后开始录音,并在开始后 30 分钟自动停止"
272
- - "帮我列出当前所有音频输入设备"
273
- - "现在有哪些通道?"
274
- - "帮我看一下当前录音健康状态"
275
- - "我已经在录音控制台了,直接帮我开始录音"
276
- - "我已经进了录音界面,把 3 号通道静音"
277
- - "在当前位置添加一个标记,命名为'第二段'"
278
- - "把 3 号通道改名为 Vocal"
279
- - "列出当前所有标记"
280
- - "停止录音"
618
+ **Q: The AI says it cannot connect to Record Safer Pro. What should I check?**
281
619
 
282
- ## 常见问题
620
+ First make sure the Record Safer Pro desktop app is already running and fully initialized. MCP depends on the local recording service and auth token. If the issue persists, restart the AI client and try again.
283
621
 
284
- **Q: AI 提示无法连接 Record Safer Pro?**
622
+ **Q: `npx` is not found. What does that mean?**
285
623
 
286
- 先确认 Record Safer Pro 桌面应用已经启动并完成初始化。MCP 依赖本机录音服务和授权 token。若仍失败,再重启 AI 客户端后重试。
287
-
288
- **Q: 提示找不到 npx 命令?**
289
-
290
- 需要安装 Node.js `>= 18`。访问 [nodejs.org](https://nodejs.org) 下载安装。
291
-
292
- **Q: 我在终端里运行 `npx -y record_safer_pro_mcp` 后没有任何输出,是不是安装失败了?**
293
-
294
- 不是。默认模式就是等待客户端接管的 `stdio` Server。请改用:
624
+ You need Node.js `>= 18`. After installation, confirm:
295
625
 
296
626
  ```bash
297
- npx -y record_safer_pro_mcp --version
298
- npx -y record_safer_pro_mcp --doctor
627
+ node -v
628
+ npx -v
299
629
  ```
300
630
 
301
- 如果这两个命令能正常输出,说明 npm 包安装和启动链路是正常的。
631
+ **Q: I ran `npx -y record_safer_pro_mcp@latest` in a terminal and it produced no output. Did installation fail?**
632
+
633
+ No. The default behavior is to start a waiting `stdio` server for the MCP client. Use `--version` and `--doctor` for validation instead of assuming a hang means failure.
302
634
 
303
- **Q: 端口不是 8080 怎么办?**
635
+ **Q: Do I normally need to configure ports manually?**
304
636
 
305
- 正常情况下不需要手动处理,应用会自动写入端口文件并自动发现。如果你确实要覆盖目标后端,再设置 `RECORD_SAFER_URL`。
637
+ No. Local ports and tokens are discovered automatically in the normal setup. You only need `RECORD_SAFER_URL` if you intentionally override the backend target.
306
638
 
307
- **Q: 版本不兼容时会怎样?**
639
+ **Q: Why does this README keep emphasizing sending `INSTALL_AI.md` directly to AI?**
308
640
 
309
- 当前代码会先做 MCP compatibility handshake。如果桌面端过旧、协议版本不匹配、缺少必需 capability,MCP 会直接报出升级或兼容性错误,而不是静默失败。
641
+ Because that is the most realistic user path for this product. Compared with manual configuration, it is more standardized, more repeatable, and better suited to product delivery and support.
310
642
 
311
643
  ---
312
644
 
313
- Copyright © DADAO 大道声学(北京大道创响科技有限公司)
645
+ Copyright © DADAO Audio (Beijing Dadao Chuangxiang Technology Co., Ltd.)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "record_safer_pro_mcp",
3
- "version": "1.0.31",
3
+ "version": "1.0.33",
4
4
  "description": "Record Safer Pro MCP Server — 专业多通道录音工作流 AI 控制接口 / AI control interface for professional multichannel recording workflows",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",