filesystem
A Model Context Protocol (MCP) server that provides filesystem operations for Claude AI
claude mcp add --transport stdio ai-yliu-filesystem-mcp-server node /path/to/filesystem-server/build/index.js /path/to/allowed/dir1 /path/to/allowed/dir2
How to use
The filesystem MCP server exposes a set of filesystem operations that let you read, write, list, move, and search files and directories within a restricted set of allowed base directories. It provides read_file for reading a file's UTF-8 contents, read_multiple_files to read several files in parallel, and write_file to create or overwrite files. You can also manage directory structures with create_directory and list_directory, move files with move_file, recursively search for matches with search_files, and retrieve metadata via get_file_info. For discovery and safety, list_allowed_directories returns all directories the server is permitted to access. The server enforces that all operations occur only within the configured allowed roots, helping to prevent unintended access to the broader filesystem.
To use it, supply the operations and their required inputs to your MCP client as documented by your integration. For example, to read a file, provide the path as input to read_file; to search for files matching a pattern, call search_files with a starting path and pattern. The server will return results such as file contents, lists of paths, or metadata, depending on the operation requested.
How to install
Prerequisites:
- Node.js (and npm) installed on your system
- Access to the repository containing the filesystem MCP server
Installation steps:
- Clone the repository:
git clone https://github.com/ai-yliu-filesystem-mcp-server.git
cd ai-yliu-filesystem-mcp-server
- Install dependencies:
npm install
- Build the project (if applicable):
npm run build
- Prepare allowed directories you want the server to access. Create or identify directories you will pass as arguments when starting the server.
- Run the server with one or more allowed directories (see usage):
node build/index.js /path/to/allowed/dir1 /path/to/allowed/dir2
Notes:
- Ensure the process has file system permissions for the configured allowed directories.
- If you modify the allowed paths, restart the server so changes take effect.
Additional notes
Tips and notes:
- All operations are constrained to the configured base directories. Attempts to access paths outside these roots will be rejected.
- When using read_multiple_files, failures on individual files will not abort the entire operation; successful reads will still be returned.
- In list_directory, entries are returned with a [FILE] or [DIR] prefix to distinguish type quickly.
- get_file_info returns size, creation/modification/access times, type (file/directory), and permissions; use this to audit or display rich metadata.
- If you encounter permission errors, verify that the process user has read/write access to the allowed directories and that the server restart includes updated paths.
- For production, consider wrapping MCP calls with retries for transient I/O errors and ensure your environment enforces the intended access boundaries.
Related MCP Servers
zen
Selfhosted notes app. Single golang binary, notes stored as markdown within SQLite, full-text search, very low resource usage
MCP -Deepseek_R1
A Model Context Protocol (MCP) server implementation connecting Claude Desktop with DeepSeek's language models (R1/V3)
mcp-fhir
A Model Context Protocol implementation for FHIR
mcp
Inkdrop Model Context Protocol Server
mcp-appium-gestures
This is a Model Context Protocol (MCP) server providing resources and tools for Appium mobile gestures using Actions API..
dubco -npm
The (Unofficial) dubco-mcp-server enables AI assistants to manage Dub.co short links via the Model Context Protocol. It provides three MCP tools: create_link for generating new short URLs, update_link for modifying existing links, and delete_link for removing short links.