fs-ops-server

sabiz/fs-ops-server

3.2

If you are the rightful owner of fs-ops-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

FS Ops Server is a secure Model Context Protocol (MCP) server designed for file system operations.

Tools
14
Resources
0
Prompts
0

FS Ops Server

A Model Context Protocol (MCP) server that provides secure file system operations.

Features

  • Read, write, and manipulate files and directories
  • Search files by name pattern or content using regex
  • Get file metadata
  • Apply changes or diff patches to files
  • Secure access control with configurable allowed directories

Security

This server restricts file system access to specified directories only. Access is controlled via:

  • Command-line arguments: --allowed-dirs /path/to/dir1,/path/to/dir2
  • Environment variable: FS_OPS_ALLOWED_DIRS=/path/to/dir1,/path/to/dir2

If both are provided, they are merged. If no restrictions are set, all directories are allowed (not recommended for production).

Installation

  1. Ensure you have Rust installed (https://rustup.rs/)
  2. Clone this repository
  3. Build the project:
cargo build --release
  1. Run tests to ensure everything is working:
cargo test

Usage

Basic Usage

./target/release/fs-ops-server

With Allowed Directories

./target/release/fs-ops-server --allowed-dirs /home/user/documents,/tmp

Or using environment variable:

FS_OPS_ALLOWED_DIRS=/home/user/documents,/tmp ./target/release/fs-ops-server

Combined

FS_OPS_ALLOWED_DIRS=/home/user/documents ./target/release/fs-ops-server --allowed-dirs /tmp

MCP Integration

This server implements the Model Context Protocol and can be used with MCP-compatible clients.

Available Tools

  • read_file: Read file contents
  • read_file_with_lines: Read file with line range
  • write_file: Write content to file
  • patch_file: Patch file by replacing lines
  • apply_changes: Apply a list of text changes to a file
  • copy_file: Copy files or directories
  • move_file: Move or rename files/directories
  • delete_file: Delete files or directories
  • list_dir: List directory contents
  • list_dir_recursive: List directory contents recursively
  • create_dir_recursive: Create directories recursively
  • search_files: Search files by name pattern
  • grep_search: Search file contents using regex
  • get_metadata: Get file/directory metadata
  • replace_in_file: Replace text in file

License

MIT License