FileSystem MCP Server

v0.1.4
io.github.Oncorporation/filesystem-server Checked 2 days ago Published 1 month ago

Secure filesystem access for AI agents with configurable directory and file type restrictions

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

init

Initialize and verify accessibility of allowed directories. Optionally list a directory and/or read a file if parameters are provided. Args: directory: Optional directory path to list contents file_path: Optional file path to read content Returns: A dictionary containing: - message: Status message ("OK" if all directories accessible, error description if not) - isError: Boolean indicating if there was an error - details: Additional information about directory accessibility - directory_contents: Optional list of…

ParameterTypeDescription
directory *string
file_path *string

list_directory

List files and subdirectories in the given directory with optional progress reporting. Args: directory: The absolute or relative path to the directory (supports both / and \ separators). report_progress: Whether to include progress information in the response. batch_size: Number of items to process before reporting progress (default: 100). Returns: If report_progress is False: A list of file and directory names in the directory. If report_progress is True: A dictionary containing: - contents: List of file and directory…

ParameterTypeDescription
directory *string
batch_sizeinteger
report_progressboolean

read_file

Read the content of a file. Args: file_path: The absolute or relative path to the file (supports both / and \ separators). Returns: The text content of the file. Raises: ValueError: If the file is not allowed, does not exist, or has a disallowed extension.

ParameterTypeDescription
file_path *string

list_resources

List all resources (files and directories) in the specified directory (or all allowed_dirs if not specified) in MCP resource format. Supports progress reporting for large workspaces. Args: directory: Directory to start from (optional, defaults to all allowed_dirs) report_progress: If True, returns progress info and batches batch_size: Number of resources per progress batch Returns: If report_progress is False: List of all resource objects If report_progress is True: Dict with contents, progress_info, total_items, processing_time

ParameterTypeDescription
batch_sizeinteger
directory
report_progressboolean

get_resource

Get metadata and actions for a specific file or directory at the given path. Returns a resource object or an error if not found or not allowed.

ParameterTypeDescription
path *string

read_file_binary

Read the content of a file as base64-encoded bytes. Returns a dict with 'content_base64' (base64 string) or an error.

ParameterTypeDescription
file_path *string

write_file

Write text content to a file. Args: file_path: The absolute or relative path to the file (supports both / and \ separators). content: The text content to write. Raises: ValueError: If the file is not allowed, parent directory issues, disallowed extension, or write fails.

ParameterTypeDescription
content *string
file_path *string

write_file_binary

Write binary content to a file from base64-encoded string. Returns a dict with success status or error. Args: file_path: The absolute or relative path to the file (supports both / and \ separators). content_base64: Base64-encoded binary content. Returns: {"success": true, "bytes_written": int, "encoding": "base64", "error": false} on success {"error": true, "error_message": str} on failure

ParameterTypeDescription
content_base64 *string
file_path *string