LocalFiles MCP 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., "@LocalFiles MCP Serverlist all .txt files in my projects directory"
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.
LocalFiles MCP Server
A Model Context Protocol (MCP) server that provides secure access to local files from specified directories.
Features
List files in configured directories
Read file contents (text and binary)
File size and extension filtering
Secure path validation
Configuration via .env file or environment variables
Configuration
Method 1: .env file (Recommended)
Create a .env file in the same directory as app.py:
# Comma-separated list of allowed directories
ALLOWED_DIRECTORIES=/home/user/documents,/home/user/projects,/path/to/your/files
# Maximum file size in bytes (default: 10MB)
MAX_FILE_SIZE=10485760
# Allowed file extensions (comma-separated)
ALLOWED_EXTENSIONS=.txt,.md,.py,.js,.json,.yaml,.yml,.csv,.xml,.html,.cssMethod 2: Environment Variables
Set environment variables directly:
export ALLOWED_DIRECTORIES="/home/user/documents,/home/user/projects"
export MAX_FILE_SIZE=10485760
export ALLOWED_EXTENSIONS=".txt,.md,.py,.js,.json,.yaml,.yml,.csv,.xml,.html,.css"Usage
Start the server
python app.pyAvailable Tools
lf_list_files - List files in allowed directories
lf_read_file - Read contents of a specific file
lf_get_config - Get current server configuration
Security
Only files within configured
ALLOWED_DIRECTORIEScan be accessedFile size limits prevent reading overly large files
File extension filtering restricts access to specified file types
All paths are resolved and validated to prevent directory traversal attacks
Troubleshooting
"No allowed directories configured" error
This error occurs when:
No .env file exists - Create a
.envfile withALLOWED_DIRECTORIESsettingEmpty ALLOWED_DIRECTORIES - Ensure the value is not empty
Wrong working directory - The server looks for
.envin the script directory first, then current directoryEnvironment variables not set - If not using .env, ensure environment variables are properly set
Debug configuration
Use the lf_get_config tool to check what configuration the server is actually using:
# This will show the current configuration
lf_get_config()Example .env file
# Example configuration for a development environment
ALLOWED_DIRECTORIES=/home/alice/projects,/home/alice/documents,/tmp/safe-files
MAX_FILE_SIZE=52428800
ALLOWED_EXTENSIONS=.txt,.md,.py,.js,.json,.yaml,.yml,.csv,.xml,.html,.css,.logRequirements
Python 3.7+
fastmcp library
pathlib (built-in)
Installation
pip install fastmcpThis server cannot be installed
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
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/AliceLynxx/LocalFiles-MCP-Server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server