Filesystem MCP Server (@sylphlab/filesystem-mcp)
Installation
- Clone: `git clone https://github.com/sylphlab/filesystem-mcp.git`
- Install: `cd filesystem-mcp && pnpm install` (Using pnpm now)
- Build: `pnpm run build`
- Configure MCP Host: ```json { "mcpServers": { "filesystem-mcp": { "command": "node", "args": ["/path/to/cloned/repo/filesystem-mcp/dist/index.js"], // Updated build dir "name": "Filesystem (Local Build)" } } } ``` **Note:** Launch the `node` command from the directory you intend as the project root.
Quick Start
Why Choose This Project?
- ** Secure & Convenient Project Root Focus:** Operations confined to the project root (`cwd` at launch).
- ** Optimized & Consolidated Tools:** Batch operations reduce AI-server round trips, saving tokens and latency. Reliable results for each item in a batch.
- ** Easy Integration:** Quick setup via `npx`/`bunx`.
- ** Containerized Option:** Available as a Docker image.
- ** Comprehensive Functionality:** Covers a wide range of filesystem tasks.
- ** Robust Validation:** Uses Zod schemas for argument validation.
Performance Advantages
- **Batch Operations:** Significantly reduces overhead compared to single operations.
- **Direct API Usage:** More efficient than spawning shell processes for each command.
- _(Add specific benchmark data when available)_
Features
- **Explore & Inspect (`list_files`, `stat_items`):** List files/directories (recursive, stats), get detailed status for multiple items.
- **Read & Write Content (`read_content`, `write_content`):** Read/write/append multiple files, creates parent directories.
- **Precision Editing & Searching (`edit_file`, `search_files`, `replace_content`):** Surgical edits (insert, replace, delete) across multiple files with indentation preservation and diff output; regex search with context; multi-file search/replace.
- **Manage Directories (`create_directories`):** Create multiple directories including intermediate parents.
- **Delete Safely (`delete_items`):** Remove multiple files/directories recursively.
- **Move & Copy (`move_items`, `copy_items`):** Move/rename/copy multiple files/directories.
- **Control Permissions (`chmod_items`, `chown_items`):** Change POSIX permissions and ownership for multiple items.
Design Philosophy
- **Security First:** Prioritize preventing access outside the project root.
- **Efficiency:** Minimize communication overhead and token usage for AI interactions.
- **Robustness:** Provide detailed results and error reporting for batch operations.
- **Simplicity:** Offer a clear and consistent API via MCP.
- **Standard Compliance:** Adhere strictly to the Model Context Protocol.
Comparison with Other Solutions
[object Object] | [object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] | [object Object] |
Future Plans
- Explore file watching capabilities.
- Investigate streaming support for very large files.
- Enhance performance for specific operations.
- Add more advanced filtering options for `list_files`.
Documentation
Contributing
License
Development
- Clone: `git clone https://github.com/sylphlab/filesystem-mcp.git`
- Install: `cd filesystem-mcp && pnpm install`
- Build: `pnpm run build` (compiles TypeScript to `dist/`)
- Watch: `pnpm run dev` (optional, recompiles on save)