MCP Filesystem Server
Enables HTTP requests to external APIs with support for various methods, headers, and authentication (coming in v1.2.0)
Provides secure filesystem access with tools for reading, writing, editing files, managing directories, searching files, and executing system commands within predefined allowed directories
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP Filesystem Server list files in my Documents folder"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
:bookmark: About
MCP Filesystem Server provides secure filesystem access for AI models through the Model Context Protocol. It enforces strict path validation and only allows access to predefined directories.
Related MCP server: MCP Filesystem Server
:computer: Technologies
:wrench: Tools
:package: Installation
:heavy_check_mark: Prerequisites
The following software must be installed:
Node.js (>=18.0.0)
pnpm (>=8.0.0)
Docker (optional)
Docker Compose (optional)
:arrow_down: Cloning the repository
$ git clone https://github.com/gabrielmaialva33/mcp-filesystem.git
$ cd mcp-filesystem:arrow_forward: Running the application
Local Development
# Install dependencies
$ pnpm install
# Build the application
$ pnpm build
# Run the server (specify directory to allow access to)
$ pnpm start /path/to/allowed/directory
# Or use configuration file
$ pnpm start --config=config.jsonUsing NPM Package
# Install globally
$ npm install -g @gabrielmaialva33/mcp-filesystem
# Run the server
$ mcp-filesystem /path/to/allowed/directory
# Or use with npx (no installation needed)
$ npx @gabrielmaialva33/mcp-filesystem /path/to/allowed/directory
# Create a sample configuration file
$ npx @gabrielmaialva33/mcp-filesystem --create-config=config.jsonUsing Docker
# Build the Docker image
$ docker build -t gabrielmaialva33/mcp-filesystem .
# Run using Docker
$ docker run -i --rm -v /path/to/data:/data:ro gabrielmaialva33/mcp-filesystem /data
# Use with config file
$ docker run -i --rm -v /path/to/config.json:/app/config.json -v /path/to/data:/data gabrielmaialva33/mcp-filesystem --config=/app/config.jsonUsing Docker Compose
# Create a data directory
$ mkdir -p data
# Start the server
$ docker-compose up -d:gear: Usage
Using with Claude Desktop
Claude Desktop can be configured to use this MCP server for filesystem access. Add the following to your
claude_desktop_config.json:
Using Local Installation (Recommended)
{
"mcpServers": {
"filesystem": {
"command": "mcp-filesystem",
"args": [
"/Users/gabrielmaia/Documents",
"/Users/gabrielmaia/Desktop",
"/Users/gabrielmaia/Downloads"
]
}
}
}Make sure to make the executable available globally:
# Make the binary executable
chmod +x /Users/gabrielmaia/.nvm/versions/node/v22.14.0/bin/mcp-filesystemUsing NPX
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@gabrielmaialva33/mcp-filesystem",
"/Users/username/Desktop",
"/path/to/other/allowed/dir"
]
}
}
}Using Docker
Note: When using Docker, all directories must be mounted to /projects by default. Adding the ro flag will make the
directory read-only.
{
"mcpServers": {
"filesystem": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"--mount",
"type=bind,src=/Users/username/Desktop,dst=/projects/Desktop",
"--mount",
"type=bind,src=/path/to/other/allowed/dir,dst=/projects/other/allowed/dir,ro",
"--mount",
"type=bind,src=/path/to/file.txt,dst=/projects/path/to/file.txt",
"gabrielmaialva33/mcp-filesystem",
"/projects"
]
}
}
}Available Tools
The MCP Filesystem Server provides these tools:
File System Operations
read_file: Read a file's content
read_multiple_files: Read multiple files at once
write_file: Create or overwrite a file
edit_file: Make precise edits with diff preview
create_directory: Create directories recursively
list_directory: List directory contents
directory_tree: Get a recursive tree view
move_file: Move or rename files
search_files: Find files matching patterns
get_file_info: Get file metadata
list_allowed_directories: See accessible directories
System & Network Operations
get_metrics: View server performance metrics (v0.3.0+)
execute_command: Execute system commands securely (v0.3.1+)
curl_request: Execute HTTP requests to external APIs (coming in v1.2.0)
Using curl_request Tool (Coming in v1.2.0)
The curl_request tool will allow you to make HTTP requests to external APIs:
// Example: Making a GET request with authentication
curl_request({
url: 'https://api.example.com/data',
method: 'GET',
headers: {
Authorization: 'Bearer your_token_here',
},
})
// Example: POST request with JSON data
curl_request({
url: 'https://api.example.com/create',
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: '{"name":"Example","value":123}',
})See the docs/curl-tool-examples.md file for more detailed examples.
:sparkles: Features
Core Features
Secure Access: Strict path validation prevents unauthorized access
File Operations: Read, write, edit, and move files
Directory Operations: Create, list, get tree views, and search directories
Metadata Access: View file and directory information
Command Execution: Securely execute system commands with strict validation
Docker Support: Easy deployment with Docker and Docker Compose
New Features in v0.3.0
Structured Logging: Detailed logging with different levels (debug, info, warn, error)
Performance Metrics: Track operation counts, errors, and execution times
Configuration Management: Support for JSON configuration files
Path Caching: Improved performance for frequently accessed paths
Improved Error Handling: Specialized error types with structured information
File Size Validation: Prevent loading excessively large files
CLI Improvements: Help command, version info, and config generation
Configuration Options
You can create a configuration file using:
$ mcp-filesystem --create-config=config.jsonExample configuration:
{
"allowedDirectories": ["/path/to/allowed/dir1", "/path/to/allowed/dir2"],
"logLevel": "info",
"logFile": "/path/to/logs/mcp-filesystem.log",
"serverName": "secure-filesystem-server",
"serverVersion": "0.3.0",
"cache": {
"enabled": true,
"maxSize": 1000,
"ttlMs": 60000
},
"metrics": {
"enabled": true,
"reportIntervalMs": 60000
},
"security": {
"maxFileSize": 10485760,
"allowSymlinks": true,
"validateRealPath": true
}
}:writing_hand: Author
License
Available Tools
16 toolsbash_executeB
Execute a Bash command directly with output capture. More flexible than execute_command but still with security restrictions. Allows for direct access to Bash functionality.
Inputs: command (required), workingDir, timeout, env.
bash_pipeB
Execute a sequence of Bash commands piped together. Allows for powerful command combinations with pipes. Results include both stdout and stderr.
Inputs: commands (required), workingDir, timeout, env.
create_directoryA
Create a new directory or ensure a directory exists. Can create multiple nested directories in one operation. If the directory already exists, this operation will succeed silently. Perfect for setting up directory structures for projects or ensuring required paths exist. Only works within allowed directories.
Inputs: path (required).
curl_requestB
Execute a curl request to an external HTTP API. Allows specifying URL, method, headers, and data. Useful for integrating with external services via HTTP.
Inputs: url (required), method, headers, data, +3 more.
directory_treeA
Get a recursive tree view of files and directories as a JSON structure. Each entry includes 'name', 'type' (file/directory), and 'children' for directories. Files have no children array, while directories always have a children array (which may be empty). The output is formatted with 2-space indentation for readability. Only works within allowed directories.
Inputs: path (required).
edit_fileA
Make line-based edits to a text file. Each edit replaces exact line sequences with new content. Returns a git-style diff showing the changes made. Only works within allowed directories.
Inputs: path (required), edits (required), dryRun.
execute_commandB
Execute a system command with security restrictions. Validates commands for safety and provides detailed output. Limited to basic system operations with security checks.
Inputs: command (required), workingDir, timeout, captureOutput.
get_file_infoA
Retrieve detailed metadata about a file or directory. Returns comprehensive information including size, creation time, last modified time, permissions, and type. This tool is perfect for understanding file characteristics without reading the actual content. Only works within allowed directories.
Inputs: path (required).
get_metricsB
Returns performance metrics about server operations. Useful for monitoring and debugging.
Inputs: no named parameters.
list_allowed_directoriesA
Returns the list of directories that this server is allowed to access. Use this to understand which directories are available before trying to access files.
Inputs: no named parameters.
list_directoryA
Get a detailed listing of all files and directories in a specified path. Results clearly distinguish between files and directories with [FILE] and [DIR] prefixes. This tool is essential for understanding directory structure and finding specific files within a directory. Only works within allowed directories.
Inputs: path (required).
move_fileA
Move or rename files and directories. Can move files between directories and rename them in a single operation. If the destination exists, the operation will fail. Works across different directories and can be used for simple renaming within the same directory. Both source and destination must be within allowed directories.
Inputs: source (required), destination (required).
read_fileA
Read the complete contents of a file from the file system. Handles various text encodings and provides detailed error messages if the file cannot be read. Use this tool when you need to examine the contents of a single file. Only works within allowed directories.
Inputs: path (required), encoding.
read_multiple_filesA
Read the contents of multiple files simultaneously. This is more efficient than reading files one by one when you need to analyze or compare multiple files. Each file's content is returned with its path as a reference. Failed reads for individual files won't stop the entire operation. Only works within allowed directories.
Inputs: paths (required), encoding.
search_filesA
Recursively search for files and directories matching a pattern. Searches through all subdirectories from the starting path. The search is case-insensitive and matches partial names. Returns full paths to all matching items. Great for finding files when you don't know their exact location. Only searches within allowed directories.
Inputs: path (required), pattern (required), excludePatterns.
write_fileA
Create a new file or completely overwrite an existing file with new content. Use with caution as it will overwrite existing files without warning. Handles text content with proper encoding. Only works within allowed directories.
Inputs: path (required), content (required), encoding.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 16 tools
Most tools have distinct purposes, but there is some overlap between bash_execute, bash_pipe, and execute_command, which could cause confusion as they all execute commands with varying flexibility and restrictions. The other tools are well-differentiated, such as directory_tree for recursive views versus list_directory for flat listings, and read_file versus read_multiple_files for single versus batch operations.
All tool names follow a consistent snake_case pattern with clear verb_noun structures, such as create_directory, edit_file, and search_files. There are no deviations in naming conventions, making the set predictable and easy to understand at a glance.
With 16 tools, the count is slightly high but reasonable for a filesystem server covering a broad range of operations from basic file handling to command execution and metrics. It might feel heavy, but each tool serves a specific function, avoiding redundancy except in the command execution area.
The tool set provides comprehensive coverage for filesystem operations, including CRUD (create_directory, read_file, edit_file, move_file, write_file), metadata retrieval (get_file_info), listing and searching (list_directory, directory_tree, search_files), and utility functions (curl_request, get_metrics). There are no obvious gaps, and tools like list_allowed_directories help agents navigate restrictions effectively.
Maintenance
Related MCP Connectors
Securely search and manage workspace context files for AI agents and teams.
Safe folder access for ChatGPT and Claude: read, write and search files, risky tools opt-in.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Run commands, code and file operations for AI agents in Cloud Hypervisor microVM sandboxes.
Related MCP Servers
- AlicenseDqualityDmaintenanceEnables AI models to perform file system operations (reading, creating, and listing files) on a local file system through a standardized Model Context Protocol interface.3ISC
- AlicenseAqualityDmaintenanceA secure Model Context Protocol server that provides controlled filesystem access within predefined directories, enabling AI models to perform file and directory operations with strict path validation.1623 npm7MIT
- AlicenseAqualityDmaintenanceA Model Context Protocol server that provides AI agents with secure access to local filesystem operations, enabling reading, writing, and managing files through a standardized interface.1077 npm55Apache 2.0
- FlicenseNot gradedqualityNot gradedmaintenanceProvides remote filesystem operations, git repository management, and process execution capabilities for AI agents through the Model Context Protocol.-