Get the FREE Ultimate OpenClaw Setup Guide →

filesystem

A Model Context Protocol (MCP) server that provides filesystem operations for Claude AI

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
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:

  1. Clone the repository:
git clone https://github.com/ai-yliu-filesystem-mcp-server.git
cd ai-yliu-filesystem-mcp-server
  1. Install dependencies:
npm install
  1. Build the project (if applicable):
npm run build
  1. Prepare allowed directories you want the server to access. Create or identify directories you will pass as arguments when starting the server.
  2. 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

Sponsor this space

Reach thousands of developers