LocalFiles Server
БесплатноНе проверенProvides secure access to local files from specified directories. Enables listing files, reading contents, and configurable file size and extension filtering.
Описание
Provides secure access to local files from specified directories. Enables listing files, reading contents, and configurable file size and extension filtering.
README
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,.css
Method 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.py
Available 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 accessed - File 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_DIRECTORIESsetting - Empty ALLOWED_DIRECTORIES - Ensure the value is not empty
- Wrong working directory - The server looks for
.envin the script directory first, then current directory - Environment 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,.log
Requirements
- Python 3.7+
- fastmcp library
- pathlib (built-in)
Installation
pip install fastmcp
Установка LocalFiles Server
У этого сервера нет опубликованного пакета — он собирается из исходников. Открой репозиторий и следуй инструкции в README.
▸ github.com/AliceLynxx/LocalFiles-MCP-ServerFAQ
LocalFiles Server MCP бесплатный?
Да, LocalFiles Server MCP бесплатный — установка в пару кликов через Unyly без оплаты.
Нужен ли API-ключ для LocalFiles Server?
Нет, LocalFiles Server работает без API-ключей и переменных окружения.
LocalFiles Server — hosted или self-hosted?
Self-hosted: сервер запускается локально на твоей машине командой из раздела установки.
Как установить LocalFiles Server в Claude Desktop, Claude Code или Cursor?
Открой LocalFiles Server на unyly.org, выбери вкладку своего клиента (Claude Desktop, Claude Code, Cursor) и нажми Install — конфиг сгенерируется автоматически, без правки JSON.
Похожие MCP
GitHub
PRs, issues, code search, CI status
автор: GitHubFilesystem
Secure file operations with configurable access controls.
Memory
Knowledge graph-based persistent memory system.
Template MCP Server
A CLI tool to create a new Model Context Protocol server project with TypeScript support, dual transport options, and an extensible structure
автор: mcpdotdirectCompare LocalFiles Server with
Не уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории development
