Prepare the server locally
Run this once before adding it to Claude Code.
npm install
npm run buildRegister it in Claude Code
claude mcp add mcp-file-manager -- node /ABSOLUTE/PATH/TO/mcp-server-test/build/index.jsReplace any placeholder paths in the command with the real path on your machine.
Make your agent remember this setup
mcp-file-manager's config, env vars, and the gotchas you hit — recalled in every future Claude Code, Cursor, and Codex session.
npx conare@latestFree · one command · indexes the sessions already on disk. Set up in the browser instead →
What it does
- Secure file creation within a dedicated workspace
- Safe file deletion capabilities
- Directory listing for workspace management
- Path traversal attack prevention
Tools 3
create_fileCreate a new file within the workspace directory.delete_fileDelete a specific file from the workspace directory.list_filesList all files currently stored in the workspace directory.Try it
Original README from jantoebes/mcp-server-test
MCP File Manager
Een Model Context Protocol server voor bestandsbeheer in een veilige workspace directory.
Installatie
npm install
npm run build
OpenCode Configuratie
Voeg toe aan ~/.config/opencode/mcp.json:
{
"mcpServers": {
"file-manager": {
"command": "node",
"args": ["/ABSOLUTE/PATH/TO/mcp-server-test/build/index.js"]
}
}
}
Vervang /ABSOLUTE/PATH/TO/mcp-server-test met het volledige pad naar deze directory.
Herstart OpenCode.
Tools
- create_file - Maak een bestand aan
- delete_file - Verwijder een bestand
- list_files - Toon alle bestanden
Voorbeelden
In OpenCode:
- "Maak een bestand test.txt aan met de tekst 'Hello World'"
- "Toon me alle bestanden in de workspace"
- "Verwijder test.txt"
Alle bestanden worden opgeslagen in workspace/.
Veiligheid
Alle operaties zijn beperkt tot de workspace/ directory. Path traversal attacks worden voorkomen.
Communicatie
De server gebruikt STDIO transport (niet HTTP):
- OpenCode start de server als subprocess
- JSON-RPC messages via stdin/stdout
- Logs via stderr
Development
npm run build # Compile TypeScript
npm run watch # Watch mode
Structuur
src/
├── index.ts # MCP server setup & handlers
└── tools.ts # File operation implementations