Secure File System MCP Server
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Secure File System MCP Server
A production-grade Model Context Protocol (MCP) server that exposes safe file system operations with comprehensive security guardrails.
Features
File Operations:
read_file,write_file,list_dir,search_filesPath Traversal Protection: Blocks
../attacks and symlink escapesAllowlisted Root Directories: Only configured directories are accessible
File Size Limits: Configurable maximum file sizes for reads and writes
Proper MCP Error Codes: Returns
-32602(invalid params) and-32603(internal error) instead of raw exceptionsStructured Logging: JSON-formatted logs with correlation IDs
Encoding Handling: Safe handling of text encodings with fallback
Comprehensive Tests: Unit tests with mocked FS + integration tests with MCP client
Related MCP server: Local Files MCP Server
Quick Start
Installation
pip install -e ".[dev]"Configuration
Create a .env file or set environment variables:
SECURE_FS_ALLOWED_ROOTS=/path/to/dir1,/path/to/dir2
SECURE_FS_MAX_FILE_SIZE=10485760
SECURE_FS_DEFAULT_ENCODING=utf-8
SECURE_FS_LOG_LEVEL=INFORunning the Server
python -m secure_fs_mcp.serverRunning Tests
pytest
pytest --cov=secure_fs_mcpArchitecture
secure_fs_mcp/
├── __init__.py
├── server.py # MCP server setup and tool registration
├── config.py # Configuration management via env vars
├── fs_operations.py # Core file system operations with safety rails
├── errors.py # MCP error codes and custom exceptions
├── logging_config.py # Structured logging setup
└── validators.py # Input validation and path safety checksMCP Tools
Tool | Description |
| Read file contents with encoding detection |
| Write content to a file (within allowed roots) |
| List directory contents with metadata |
| Search for files by name pattern |
Security
All paths are resolved to absolute paths and validated against allowlisted roots
Symlinks are resolved before validation to prevent symlink-based escapes
Path components are checked for traversal patterns (
..,~)File size is checked before reading to prevent memory exhaustion
Write operations enforce size limits
License
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
Browse and manage files in your Moxt AI workspace from any MCP client.
Hosted remote MCP for protected account access, permissions, activity history and supported undo.
Fail-closed action authorization, MCP risk scanning, x402 checks, and signed receipts.
Persistent file storage for AI agents via MCP and curl. Upload, download, and version files.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables file system operations such as listing, reading, and creating files within a scoped local project directory. It provides a secure way to manage local files through standardized MCP tools built with FastMCP.-
- AlicenseAqualityDmaintenanceProvides safe local file operations through MCP, including reading, writing, searching, organizing, and protected deletion with configurable path restrictions.121ISC
- AlicenseNot gradedqualityDmaintenanceEnables file system operations such as listing directories, reading, writing, creating, and deleting files or directories through MCP.20 npmMIT
- AlicenseNot gradedqualityDmaintenanceExposes file system operations to AI clients via MCP, enabling secure read, write, and management of files and folders.7 npmMIT