MCP Filesystem Server
Click on "Install 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 Serverlist 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.
MCP Filesystem Server
An MCP (Model Context Protocol) server for filesystem operations with built-in security features.
Features
File Reading: Read text file contents
File Writing: Create or overwrite files
Directory Listing: List contents with details (name, type, size, modified date)
File Search: Search for files using regex patterns
File Information: Get detailed metadata for files/directories
Directory Creation: Create new directories
File Deletion: Delete files and directories (Downloads folder only for safety)
Related MCP server: File System MCP Server
Security
The server implements the following security measures:
Allowed Directories: Only allows access to specific directories:
~/Documents~/Downloads
Delete Restrictions: Delete operations are only allowed in
~/Downloadsfolder for safetyPath Validation: Prevents path traversal attacks
Size Limits: Files limited to 10MB for read operations
Depth Limits: Searches limited to 5 levels deep by default
Installation
# Install dependencies
npm install
# Compile TypeScript
npm run buildUsage
As a standalone MCP server
npm startIntegration with Claude Desktop
Build the project:
npm run buildUpdate your Claude Desktop configuration at:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.jsonLinux:
~/.config/Claude/claude_desktop_config.json
Add the server configuration:
{
"mcpServers": {
"filesystem": {
"command": "node",
"args": ["/absolute/path/to/MCP-test/dist/index.js"]
}
}
}Restart Claude Desktop
Available Tools
read_file
Reads the contents of a file.
Parameters:
path(string): Path to the file to read
Example:
{
"path": "~/Documents/test.txt"
}write_file
Writes content to a file.
Parameters:
path(string): Path to the filecontent(string): Content to write
Example:
{
"path": "~/Documents/test.txt",
"content": "Hello, World!"
}list_directory
Lists directory contents with details.
Parameters:
path(string): Path to the directory
Example:
{
"path": "~/Documents"
}search_files
Searches for files matching a regex pattern.
Parameters:
directory(string): Directory to search in (must be within allowed directories)pattern(string): Regex pattern to match file namesmaxDepth(number, optional): Maximum search depth (default: 5)
Example:
{
"directory": "~/Documents",
"pattern": "\\.txt$",
"maxDepth": 3
}get_file_info
Gets detailed information about a file or directory.
Parameters:
path(string): Path to the file or directory
Example:
{
"path": "~/Documents/test.txt"
}create_directory
Creates a new directory.
Parameters:
path(string): Path to the directory to create
Example:
{
"path": "~/Documents/new-folder"
}delete_file
Deletes a file or directory. Only works in Downloads folder for safety.
Parameters:
path(string): Path to the file or directory to delete (must be in Downloads)recursive(boolean, optional): If true, delete directories and their contents recursively (default: false)
Examples:
Delete a file:
{
"path": "~/Downloads/old-file.txt"
}Delete a directory and its contents:
{
"path": "~/Downloads/temp-folder",
"recursive": true
}Important Notes:
Delete operations are only allowed in the Downloads folder
Attempting to delete files in Documents or other locations will be denied
Directories require
recursive: trueparameter to be deletedDeleted files cannot be recovered
Development
# Compile in watch mode
npm run watch
# Compile once
npm run build
# Run after compiling
npm startProject Structure
MCP-test/
├── src/
│ └── index.ts # Main MCP server
├── dist/ # Compiled files (generated)
├── package.json
├── tsconfig.json
├── config.example.json # Configuration example
└── README.mdCustomization
To change allowed directories, edit the ALLOWED_DIRECTORIES constant in src/index.ts:
const ALLOWED_DIRECTORIES = [
path.join(os.homedir(), "Documents"),
path.join(os.homedir(), "Downloads"),
// Add more directories here
];To change the file size limit:
const MAX_FILE_SIZE = 10 * 1024 * 1024; // 10MBTroubleshooting
Server doesn't start
Verify you've compiled the project with
npm run buildVerify the path in the configuration is absolute and correct
"Access denied" when trying to access a file
Verify the file is within
~/Documentsor~/DownloadsCheck file permissions
"File too large"
Files are limited to 10MB by default
Modify
MAX_FILE_SIZEif you need larger files
License
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/pocho23/MCP-test'
If you have feedback or need assistance with the MCP directory API, please join our Discord server