MCP Filesystem Server
This MCP server provides secure access to the local filesystem via the Model Context Protocol (MCP).
Components
Tools
File Operations
- read_file
- Read the complete contents of a file from the file system
- Parameters:
path
(required): Path to the file to read
- read_multiple_files
- Read the contents of multiple files in a single operation
- Parameters:
paths
(required): List of file paths to read
- write_file
- Create a new file or overwrite an existing file with new content
- Parameters:
path
(required): Path where to write the file,content
(required): Content to write to the file
- copy_file
- Copy files and directories
- Parameters:
source
(required): Source path of the file or directory,destination
(required): Destination path
- move_file
- Move or rename files and directories
- Parameters:
source
(required): Source path of the file or directory,destination
(required): Destination path
- delete_file
- Delete a file or directory from the file system
- Parameters:
path
(required): Path to the file or directory to delete,recursive
(optional): Whether to recursively delete directories (default: false)
Directory Operations
- list_directory
- Get a detailed listing of all files and directories in a specified path
- Parameters:
path
(required): Path of the directory to list
- create_directory
- Create a new directory or ensure a directory exists
- Parameters:
path
(required): Path of the directory to create
- tree
- Returns a hierarchical JSON representation of a directory structure
- Parameters:
path
(required): Path of the directory to traverse,depth
(optional): Maximum depth to traverse (default: 3),follow_symlinks
(optional): Whether to follow symbolic links (default: false)
Search and Information
- search_files
- Recursively search for files and directories matching a pattern
- Parameters:
path
(required): Starting path for the search,pattern
(required): Search pattern to match against file names
- get_file_info
- Retrieve detailed metadata about a file or directory
- Parameters:
path
(required): Path to the file or directory
- list_allowed_directories
- Returns the list of directories that this server is allowed to access
- Parameters: None
Features
- Secure access to specified directories
- Path validation to prevent directory traversal attacks
- Symlink resolution with security checks
- MIME type detection
- Support for text, binary, and image files
- Size limits for inline content and base64 encoding
Getting Started
Installation
Using Go Install
Usage
As a standalone server
Start the MCP server with allowed directories:
As a library in your Go project
Usage with Model Context Protocol
To integrate this server with apps that support MCP:
Docker
Running with Docker
You can run the Filesystem MCP server using Docker:
Docker Configuration with MCP
To integrate the Docker image with apps that support MCP:
License
See the LICENSE file for details.
This server cannot be installed
local-only server
The server can only run on the client's local machine because it depends on local resources.
Go server implementing Model Context Protocol (MCP) for filesystem operations.
Related MCP Servers
- -securityAlicense-qualityNode.js server implementing Model Context Protocol (MCP) for filesystem operations.Last updated -44,19054,281JavaScriptMIT License
- -securityAlicense-qualitygodoc-mcp is a Model Context Protocol (MCP) server that provides efficient access to Go documentation. It helps LLMs understand Go projects by providing direct access to package documentation without needing to read entire source files.Last updated -24GoMIT License
- -securityAlicense-qualitywhat is go-mcp-postgres? go-mcp-postgres is a Model Context Protocol (MCP) server designed for interacting with Postgres databases, allowing for easy CRUD operations and automation without the need for a Node.js or Python environment.Last updated -4GoMIT License
- -securityAlicense-qualityThis is a Model Context Protocol (MCP) server implemented in Go, providing a tool to analyze Go pprof performance profiles.Last updated -4GoMIT License