Content
-read-file-server
encrypted environment with MCP Server..js is in the whitelist of encryption software, automatically decrypt and file plaintext through the `fs, replacing the built-in file Agent to solve the problem of in encrypted environment.
Applicable AI Agent that supports MCP protocol.
---
## Applicable Scenarios
The computer has file encryption software installed (such as Topsec, IP-Guard, etc.), and the files on the disk are ciphertext. AI Agent (such as Claude Code, Cursor,, Cline, etc.) is an, and its file tools are not in the whitelist, so it can only read ciphertext the Node.js process is in the whitelist, and the alternative tools provided by MCP Server can be used to read and write plaintext normally.
**Prerequisites: Node.js process has been added to the whitelist (trusted process encryption software.**
## Architecture
```
AI Agent --(Mstdio)--> Node.js MCP Server --(fs.read)--> Read plaintext
Structure
```
mcp-server/
├── README.md #
├── SKILL.md Supporting Skill (optional AI learn to use this tool├── index.js # MCP program (source code)
├── package.json # Project configuration ()
└── node_modules/ Dependencies
```
## Installation
### Preconditions
- Node.js v18+ (recommended v20+)
- Node.js has been added to the whitelist by encryption software
### Install Dependencies
```bash
cd mcp-read-file-server
npm install
```
## Configure MCP Server
All Agent configurations of MCP Server core information are the same, only the configuration file location and format are slightly different:
```json
{
"mcpServers": {
"read-file {
"command": "node",
"args": ["/path/to/mcp-read-file-server/index.js"]
}
}
}
```
> **Path description**: The path in `args` should be replaced with the actual absolute path of `index.js` on your machine. recommended to use an absolute path to avoid ambiguity.
### Configuration Methods for Each Agent
| Agent | Configuration Method |
|-------|---------|
|aude Code CLI** | Project level: create `.mcp.json the project root directory; User `claude mcp add read-file-server -s user -- node "/path/to/index.js"`; edit `~/.claude.json` |
| **OpenClaw** | `openclaw mcp set read-file-server '{"command":"node","args":["/path/to/index.js"]}'`, or directly edit `mcp.servers` in `openclaw.json` |
| **Cursor** | Settings → MCP → Add Server, paste the above JSON |
| **Windsurf** | Add the above JSON in MCP configuration |
| **Cline / Roo Code** | Add the above settings |
Continue.dev** | Configure MCP in `config.json` |
| **Zed** | Configure MCP in `settings.json` |
| **Other tools that support MCP** | Configure MCP Server according to their documentation |
### Verify Configurationbash
# Claude Code
mcp list
#aw
openclaw mcp list
```
You should see `read-file-server` in the list.
## Provided Tools
| Tool Name-in | Function ||--------|--------------------|----------|------|
| `read_file` | Read single file plaintext |`: file path |
| ` | Multiple Read | multiple file plaintexts | `paths`: comma-separated paths |
| `write_file` | Write | (automatically encrypt andpath`, `content` `edit_file`ultiEdit | Prec/regular replacement and write backpath`, `oldString`, `newString`, `usereplaceAll`, `` |
| `search_files Grep | Recursively content | `pattern`,`, `include`, `ignore `onlyMatching`, `max |
| `create | - | Recursively create directorypath` |
|_info` | - | Query file/directory information | ` |
| `check_status` | Check tool running status | None |
> **Note**: have different naming conventions for. For example, in Open the tool name is `read-file-server_file`, while other Agents mayread_file`. Please target Agent's MCP convention.
## Usage
After directly say the requirement Agent. The Agent will automatically call the MCP tool to read and plaintext.
Usage examples:
Read the content of `.js`"
- "Change `host` in `config.jsonlocalhost`"
- for all files containing ` in `src/`"
- "Create a `dist/assets/` me"
## Supporting Skill)
This tool comes with a Skill: `SKILL.md the root directory of this directory. Its function is to AI Agent to actively use this encrypted environments and avoid Read/Write/Edit/Grep**.
| Item | Description |
|----|------|
| Function | Let AI Agent actively use this tool in encrypted environments and avoid built-in file operations |
| Current Status | `SKILL.md` is in the tool root directory, **not installed**, needs to be copied to the corresponding position to take effect |
| Trigger Keywords | Topsec, green shield, TSD, IP file encryption, whitelist, cannot read file, etc. to Claude Code
| Scope | Installation Location |
||
| Project level (only for this project) | `<>/.claude/skills-file-ops/SK |
| User level) | `~aude/skills/encryption-file-ops/SKILL.md```bash
mkdir -p ~/.claude/skills/encryption-file-ops
cp SKILL.md ~/.claude/skills-ops/SKILL.md
```
Restart Claude Code take effect.
### OpenClaw
```bashp ~/.openclaw/encryption-file- SKILL.md ~/./workspace/skills/encryption/SKILL.md
```
Restart OpenClaw session to take effect.
### Install to Other Agents
Place `SKILL.md` in the target Agent's Skill loading directory (format requirements are `skill-name/SKILL.md` subdirectory structure), refer to each Agent's Skill documentation.
### Verify Installation
After installation and restart, enter trigger keywords to test, for example:
> "There is file encryption in this project, and the file is read as ciphertext should I do?"
Observe whether the MCP operation of this tool is automatically used instead of built-in Read/Grep.
## Using on a New Computer
Copy 4 files:
```
mcp-read-file-server/
├── README.md
ILL.md (optional index.js
└──
```
Run `npm to install dependencies on the new computer, and then configure MCP according target Agent.
## Troubleshooting
| Phenomenon | | Solution |
|------|----------|----------|
| Still reading ciphertext code | Node.js is the whitelist of encryption Contact encryption software administrator tonode.exe` to the| MCP tool is not visible | MCP Server is not configured or Check Agent's MCP list command (such as `claude mcp list`) |
| `edit_file` reports "no matching content found" | `old spelling, indentation, line break is incorrect | Re `` copy the original text, don't write by memory |
| `edit_file` reports "matched" | File has duplicate Add longer/more uniqueString` to uniquely locate `replaceAll=true` `search_files` reports "regular expression is invalid" | Regular syntax error | Check if `pattern` needs to escape special characters |
| `write_file` reports permission error | File is occupied or directory has no write permission | Close occupying process / check directory permission |
| Tool call timeout | File is too large | Use `search_files` to locate and then only `read_file` key segment |
### Test Server Can be Startedbash
echo '{"json2.0","id":1,"method":"params":{"protocolVersion":"-11-05","capabilities":{},"clientInfotest","version":".0