bash_execute
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.
Read, write and diff-edit files inside allowed directories, search a tree by name, and run bash commands, pipelines or curl requests from the same server.
LABSCO SUMMARY
list_allowed_directories is the call to make first, because every file operation is confined to what it returns. Editing is line-based and hands back a git-style diff, with a dry run available, which makes a change reviewable before it is written. The execution side is wider than the file side — a checked command runner, direct bash with environment and timeout, piped sequences, and curl with method, headers and data — and the vendor describes those as carrying security restrictions rather than the same directory confinement.
A filesystem server scoped to allowed directories, with command execution and an HTTP request tool alongside it.
Directories explicitly allowed on the server, since every file operation is confined to them, plus bash and curl on the host for the execution tools.
One command — npx -y @gabrielmaialva33/mcp-filesystem <YOUR_PATH_TO_ALLOWED_DIRECTORY>
USE CASES
Line-based edits return a git-style diff, and the dry run shows that diff without writing anything.
What the server may touch comes first, then the shape of the tree, then one level in detail.
Search finds candidates by name, reading several at once compares them, and the metadata says which are worth opening at all.
Commands run with an environment and a timeout, and a piped sequence returns both streams, which is where build failures usually live.
Method, headers and body are all parameters, so a request to an external service is one call rather than a script.
Counted once with only startup setup. Other versions, modes or optional credentials may expose a different list.
bash_executeExecute a Bash command directly with output capture. More flexible than execute_command but still with security restrictions. Allows for direct access to Bash functionality.
bash_pipeExecute a sequence of Bash commands piped together. Allows for powerful command combinations with pipes. Results include both stdout and stderr.
create_directoryCreate 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.
curl_requestExecute a curl request to an external HTTP API. Allows specifying URL, method, headers, and data. Useful for integrating with external services via HTTP.
directory_treeGet 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.
edit_fileMake 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.
execute_commandExecute a system command with security restrictions. Validates commands for safety and provides detailed output. Limited to basic system operations with security checks.
get_file_infoRetrieve 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.
get_metricsReturns performance metrics about server operations. Useful for monitoring and debugging.
list_allowed_directoriesReturns the list of directories that this server is allowed to access. Use this to understand which directories are available before trying to access files.
list_directoryGet 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.
move_fileMove 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.
read_fileRead 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.
read_multiple_filesRead 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.
search_filesRecursively 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.
write_fileCreate 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.
BEFORE YOU INSTALL
16 tools when we connected.
npx on PATH
CONTEXT COST
Rated by the size of the 16 tool definitions that ride along on every turn, not by how many there are
INSTALLATION
{
"mcpServers": {
"mcp-filesystem": {
"command": "npx",
"args": [
"-y",
"@gabrielmaialva33/mcp-filesystem",
"<YOUR_PATH_TO_ALLOWED_DIRECTORY>"
]
}
}
}<YOUR_PATH_TO_ALLOWED_DIRECTORY> is the directory the server may work in. List more directories as further arguments. Every file operation is confined to them.
npx -y @gabrielmaialva33/mcp-filesystem <YOUR_PATH_TO_ALLOWED_DIRECTORY>