Labsco
gabrielmaialva33 logo

Secure MCP Filesystem Server

β˜… 7

from gabrielmaialva33

A secure MCP server for accessing the local filesystem within predefined directories.

πŸ”₯πŸ”₯πŸ”₯βœ“ VerifiedFreeAdvanced setup
<h1 align="center"> <br> <img src="https://raw.githubusercontent.com/gabrielmaialva33/mcp-filesystem/master/.github/assets/mcp.png" alt="MCP Filesystem" width="200"> <br> Secure <a href="https://modelcontextprotocol.io/introduction">MCP</a> Filesystem Server <br> </h1> <p align="center"> <strong>A secure Model Context Protocol (MCP) server providing filesystem access within predefined directories</strong> </p> <p align="center"> <img src="https://img.shields.io/github/license/gabrielmaialva33/mcp-filesystem?color=00b8d3?style=flat&logo=appveyor" alt="License" /> <img src="https://img.shields.io/github/languages/top/gabrielmaialva33/mcp-filesystem?style=flat&logo=appveyor" alt="GitHub top language" > <img src="https://img.shields.io/github/languages/count/gabrielmaialva33/mcp-filesystem?style=flat&logo=appveyor" alt="GitHub language count" > <img src="https://img.shields.io/github/repo-size/gabrielmaialva33/mcp-filesystem?style=flat&logo=appveyor" alt="Repository size" > <a href="https://github.com/gabrielmaialva33/mcp-filesystem/commits/master"> <img src="https://img.shields.io/github/last-commit/gabrielmaialva33/mcp-filesystem?style=flat&logo=appveyor" alt="GitHub last commit" > <img src="https://img.shields.io/badge/made%20by-Maia-15c3d6?style=flat&logo=appveyor" alt="Maia" > </a> </p> <br> <p align="center"> <a href="#bookmark-about">About</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp; <a href="#computer-technologies">Technologies</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp; <a href="#wrench-tools">Tools</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp; <a href="#package-installation">Installation</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp; <a href="#gear-usage">Usage</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp; <a href="#memo-license">License</a> </p> <br>

:bookmark: About

MCP Filesystem Server provides secure filesystem access for AI models through the Model Context Protocol. It enforces strict path validation and only allows access to predefined directories.

<br>

:computer: Technologies

<br>

:wrench: Tools

<br>

:sparkles: Features

Core Features

  • Secure Access: Strict path validation prevents unauthorized access
  • File Operations: Read, write, edit, and move files
  • Directory Operations: Create, list, get tree views, and search directories
  • Metadata Access: View file and directory information
  • Command Execution: Securely execute system commands with strict validation
  • Docker Support: Easy deployment with Docker and Docker Compose

New Features in v0.3.0

  • Structured Logging: Detailed logging with different levels (debug, info, warn, error)
  • Performance Metrics: Track operation counts, errors, and execution times
  • Configuration Management: Support for JSON configuration files
  • Path Caching: Improved performance for frequently accessed paths
  • Improved Error Handling: Specialized error types with structured information
  • File Size Validation: Prevent loading excessively large files
  • CLI Improvements: Help command, version info, and config generation

Configuration Options

You can create a configuration file using:

Copy & paste β€” that's it
$ mcp-filesystem --create-config=config.json

Example configuration:

Copy & paste β€” that's it
{
  "allowedDirectories": ["/path/to/allowed/dir1", "/path/to/allowed/dir2"],
  "logLevel": "info",
  "logFile": "/path/to/logs/mcp-filesystem.log",
  "serverName": "secure-filesystem-server",
  "serverVersion": "0.3.0",
  "cache": {
    "enabled": true,
    "maxSize": 1000,
    "ttlMs": 60000
  },
  "metrics": {
    "enabled": true,
    "reportIntervalMs": 60000
  },
  "security": {
    "maxFileSize": 10485760,
    "allowSymlinks": true,
    "validateRealPath": true
  }
}
<br>

:writing_hand: Author

License

MIT License

<p align="center"><img src="https://raw.githubusercontent.com/gabrielmaialva33/gabrielmaialva33/master/assets/gray0_ctp_on_line.svg?sanitize=true" /></p> <p align="center">&copy; 2024-present <a href="https://github.com/gabrielmaialva33/" target="_blank">Maia</a> </p>