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., "@LocalFS MCP Serversearch for all Python files in my projects 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.
LocalFS MCP Server
A comprehensive filesystem management MCP (Model Context Protocol) server that provides sandboxed access to local filesystem operations. Built with Smithery CLI.
Features
16 Filesystem Tools
Directory Operations (5 tools)
list_directories- List subdirectories in a pathcreate_directory- Create new directories (with parent creation)delete_directory- Delete directories (recursive option)move_directory- Move or rename directoriesget_directory_metadata- Get directory statistics and info
File Operations (6 tools)
list_files- List files in a directoryread_file- Read file content with chunking supportwrite_file- Write or overwrite files (text and binary)append_file- Append content to existing filesdelete_file- Delete filesmove_file- Move or rename filesget_file_metadata- Get file stats (size, mime type, timestamps)
Search Operations (5 tools)
search_by_name- Exact filename matchsearch_by_glob- Glob pattern matching (.txt, **/.py)search_by_filename_regex- Regex pattern on filenamessearch_by_content_text- Plain text search in file contentsearch_by_content_regex- Regex search in file content
Binary File Support
Automatic detection of binary vs text files
Base64 encoding for binary content
UTF-8 text handling with error recovery
Performance & Safety
Chunked file reads for large files (offset/limit support)
Configurable file size limits
Configurable search depth limits
Lazy directory traversal with generators
Prerequisites
Python >= 3.10
Smithery API key: Get yours at smithery.ai/account/api-keys
Getting Started
Install dependencies:
uv syncRun the development server:
uv run devTest interactively with the playground:
uv run playground
Configuration
Each session requires a root_directory parameter and supports optional configuration:
Example Connection URL
Usage Examples
Read a file
Search for files
Directory operations
Development
Project Structure
Your server code is organized in src/local_filesystem/:
server.py- Main server setupcore/- Core utilities and exceptionssafety.py- Path validation and sandboxingexceptions.py- Custom exception classesconstants.py- Configuration constants
api/- API route handlersdirectory_routes.py- Directory operation endpointsfile_routes.py- File operation endpointssearch_routes.py- Search operation endpoints
services/- Business logic servicesdirectory_service.py- Directory managementfile_service.py- File managementsearch_service.py- Search capabilities
schemas/- Pydantic models and validation
Code Quality Tools
The project uses pre-commit hooks to maintain code quality:
Black - Code formatting (line length: 100)
Flake8 - Linting and style checking
Mypy - Static type checking
Setup Pre-commit Hooks
The hooks will automatically run on git commit to ensure code quality.
Security Features
Sandboxed Operations: All paths validated against root directory
Size Limits: Configurable limits prevent resource exhaustion
Depth Limits: Recursive operations bounded by max_search_depth
Path Traversal Protection: Prevents access outside sandbox root
Testing
Run the test suite:
Deploy
Ready to deploy? Push your code to GitHub and deploy to Smithery:
Create a new repository at github.com/new
Initialize git and push to GitHub:
git add . git commit -m "LocalFS MCP server" git remote add origin https://github.com/YOUR_USERNAME/YOUR_REPO.git git push -u origin mainDeploy your server to Smithery at smithery.ai/new
Resources
Documentation: smithery.ai/docs
MCP Protocol: modelcontextprotocol.io
Community: Discord