mcp-read-file-server 1.3.0 → 1.3.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.
Files changed (2) hide show
  1. package/README.md +34 -1
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -57,7 +57,7 @@ mcp-read-file-server/
57
57
  npx -y mcp-read-file-server
58
58
  ```
59
59
 
60
- 首次运行 npx 会自动下载本包及其依赖到临时目录并启动。配置 Agent 时将 `command` 设为 `npx`、`args` 设为 `["-y", "mcp-read-file-server"]` 即可(见下文「配置」)。
60
+ 首次运行 npx 会自动下载本包及其依赖到临时目录并启动(需数秒~十几秒;若 Agent 启动超时,可先在终端手动跑一次 `npx -y mcp-read-file-server` 预热缓存,看到卡住等输入后 `Ctrl+C` 退出)。配置 Agent 时将 `command` 设为 `npx`、`args` 设为 `["-y", "mcp-read-file-server"]` 即可(见下文「配置」;**Windows 下部分 Agent 需用 `npx.cmd`**)。
61
61
 
62
62
  ### 方式二:从源码运行(开发 / 离线场景)
63
63
 
@@ -88,6 +88,21 @@ npm install
88
88
  }
89
89
  ```
90
90
 
91
+ > **⚠️ Windows 用户注意**:部分 Agent(Cursor / Cline / Continue 等)在 Windows 下直接用 `npx` 会启动失败(报 `spawn npx ENOENT` 或连不上),需把 `command` 改成 `npx.cmd`:
92
+ >
93
+ > ```json
94
+ > {
95
+ > "mcpServers": {
96
+ > "read-file-server": {
97
+ > "command": "npx.cmd",
98
+ > "args": ["-y", "mcp-read-file-server"]
99
+ > }
100
+ > }
101
+ > }
102
+ > ```
103
+ >
104
+ > Claude Code 通常能自动识别 `npx`,无需改。若 `npx.cmd` 仍失败,可改用 `"command": "cmd"`、`"args": ["/c", "npx", "-y", "mcp-read-file-server"]`。
105
+
91
106
  ### 本地源码方式
92
107
 
93
108
  若用「方式二」从源码运行,则指向本地 `index.js`:
@@ -312,3 +327,21 @@ cd mcp-read-file-server && npm install
312
327
  # 测试启动
313
328
  echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0.0"}}}' | node index.js
314
329
  ```
330
+
331
+ ### Agent 连不上 MCP Server
332
+
333
+ 包本身正常但 Agent 连不上时,按以下顺序排查:
334
+
335
+ 1. **Windows 下 `npx` 找不到**:部分 Agent(Cursor / Cline / Continue 等)需把 `command` 写成 `npx.cmd`,详见上文「配置 -> npx 方式」的 Windows 注意事项。这是 Windows 上最常见的连不上原因。
336
+ 2. **首次 npx 下载超时**:npx 首次拉取包需数秒~十几秒,某些 Agent 启动超时较短会连不上。先在终端手动跑一次 `npx -y mcp-read-file-server`(看到卡住等输入即启动成功,`Ctrl+C` 退出),让包进入缓存,再让 Agent 连接即可秒启。
337
+ 3. **npx 缓存了旧版 / 损坏**:清缓存重试 ——
338
+ ```bash
339
+ npx clear-npx-cache
340
+ # 或 Windows 下手动删除缓存目录
341
+ rm -rf "C:/Users/你的用户名/AppData/Local/npm-cache/_npx"
342
+ ```
343
+ 4. **确认包本身是否正常**:
344
+ ```bash
345
+ npx -y mcp-read-file-server # 能启动=包没问题,问题在 Agent 配置/环境
346
+ ```
347
+ 能启动并卡住等输入,说明包正常,需检查 Agent 的配置 JSON 格式与 `command` 写法。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mcp-read-file-server",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "加密环境文件操作 MCP 工具。当 Node.js 是加密软件白名单进程时,通过 fs 模块自动解密读写文件明文,替代 AI Agent 内置文件工具,适用于任何支持 MCP 协议的 Agent。",
5
5
  "type": "commonjs",
6
6
  "main": "index.js",