Skip to main content
Glama
gabrielmaialva33

MCP Filesystem Server

:bookmark: Über

Der MCP Filesystem Server bietet sicheren Dateisystemzugriff für KI-Modelle über das Model Context Protocol. Er erzwingt eine strikte Pfadvalidierung und erlaubt nur den Zugriff auf vordefinierte Verzeichnisse.

Related MCP server: MCP Filesystem Server

:computer: Technologien

:Schraubenschlüssel: Werkzeuge

:Paket: Installation

:heavy_check_mark: Voraussetzungen

Folgende Software muss installiert sein:

:arrow_down: Das Repository wird geklont

  $ git clone https://github.com/gabrielmaialva33/mcp-filesystem.git
  $ cd mcp-filesystem

:arrow_forward: Ausführen der Anwendung

Lokale Entwicklung

  # Install dependencies
  $ pnpm install

  # Build the application
  $ pnpm build

  # Run the server (specify directory to allow access to)
  $ pnpm start /path/to/allowed/directory

  # Or use configuration file
  $ pnpm start --config=config.json

Verwenden des NPM-Pakets

  # Install globally
  $ npm install -g @gabrielmaialva33/mcp-filesystem

  # Run the server
  $ mcp-filesystem /path/to/allowed/directory

  # Or use with npx (no installation needed)
  $ npx @gabrielmaialva33/mcp-filesystem /path/to/allowed/directory

  # Create a sample configuration file
  $ npx @gabrielmaialva33/mcp-filesystem --create-config=config.json

Verwenden von Docker

  # Build the Docker image
  $ docker build -t gabrielmaialva33/mcp-filesystem .

  # Run using Docker
  $ docker run -i --rm -v /path/to/data:/data:ro gabrielmaialva33/mcp-filesystem /data

  # Use with config file
  $ docker run -i --rm -v /path/to/config.json:/app/config.json -v /path/to/data:/data gabrielmaialva33/mcp-filesystem --config=/app/config.json

Verwenden von Docker Compose

  # Create a data directory
  $ mkdir -p data

  # Start the server
  $ docker-compose up -d

:gear: Verwendung

Verwendung mit Claude Desktop

Claude Desktop kann so konfiguriert werden, dass dieser MCP-Server für den Dateisystemzugriff verwendet wird. Fügen Sie Ihrer claude_desktop_config.json Folgendes hinzu:

Lokale Installation verwenden (empfohlen)

{
  "mcpServers": {
    "filesystem": {
      "command": "mcp-filesystem",
      "args": [
        "/Users/gabrielmaia/Documents",
        "/Users/gabrielmaia/Desktop",
        "/Users/gabrielmaia/Downloads"
      ]
    }
  }
}

Stellen Sie sicher, dass die ausführbare Datei global verfügbar ist:

# Make the binary executable
chmod +x /Users/gabrielmaia/.nvm/versions/node/v22.14.0/bin/mcp-filesystem

Verwenden von NPX

{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": [
        "-y",
        "@gabrielmaialva33/mcp-filesystem",
        "/Users/username/Desktop",
        "/path/to/other/allowed/dir"
      ]
    }
  }
}

Verwenden von Docker

Hinweis: Bei Verwendung von Docker müssen alle Verzeichnisse standardmäßig in /projects eingebunden sein. Durch Hinzufügen des Flags ro wird das Verzeichnis schreibgeschützt.

{
  "mcpServers": {
    "filesystem": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "--mount",
        "type=bind,src=/Users/username/Desktop,dst=/projects/Desktop",
        "--mount",
        "type=bind,src=/path/to/other/allowed/dir,dst=/projects/other/allowed/dir,ro",
        "--mount",
        "type=bind,src=/path/to/file.txt,dst=/projects/path/to/file.txt",
        "gabrielmaialva33/mcp-filesystem",
        "/projects"
      ]
    }
  }
}

Verfügbare Tools

Der MCP-Dateisystemserver bietet diese Tools:

Dateisystemvorgänge

  • read_file : Liest den Inhalt einer Datei

  • read_multiple_files : Mehrere Dateien gleichzeitig lesen

  • write_file : Erstellen oder überschreiben Sie eine Datei

  • edit_file : Nehmen Sie präzise Änderungen mit der Diff-Vorschau vor

  • create_directory : Verzeichnisse rekursiv erstellen

  • list_directory : Verzeichnisinhalte auflisten

  • directory_tree : Holen Sie sich eine rekursive Baumansicht

  • move_file : Dateien verschieben oder umbenennen

  • search_files : Findet Dateien, die Mustern entsprechen

  • get_file_info : Dateimetadaten abrufen

  • list_allowed_directories : Zugängliche Verzeichnisse anzeigen

System- und Netzwerkbetrieb

  • get_metrics : Server-Leistungsmetriken anzeigen (v0.3.0+)

  • execute_command : Systembefehle sicher ausführen (v0.3.1+)

  • curl_request : Führt HTTP-Anfragen an externe APIs aus (kommt in v1.2.0)

Verwenden des curl_request-Tools (kommt in v1.2.0)

Mit dem Tool curl_request können Sie HTTP-Anfragen an externe APIs stellen:

// Example: Making a GET request with authentication
curl_request({
  url: 'https://api.example.com/data',
  method: 'GET',
  headers: {
    Authorization: 'Bearer your_token_here',
  },
})

// Example: POST request with JSON data
curl_request({
  url: 'https://api.example.com/create',
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
  },
  data: '{"name":"Example","value":123}',
})

Ausführlichere Beispiele finden Sie in der Datei docs/curl-tool-examples.md .

:sparkles: Funktionen

Kernfunktionen

  • Sicherer Zugriff : Strenge Pfadvalidierung verhindert unbefugten Zugriff

  • Dateioperationen : Dateien lesen, schreiben, bearbeiten und verschieben

  • Verzeichnisoperationen : Erstellen, Auflisten, Abrufen von Baumansichten und Durchsuchen von Verzeichnissen

  • Metadatenzugriff : Datei- und Verzeichnisinformationen anzeigen

  • Befehlsausführung : Sichere Ausführung von Systembefehlen mit strenger Validierung

  • Docker-Unterstützung : Einfache Bereitstellung mit Docker und Docker Compose

Neue Funktionen in v0.3.0

  • Strukturiertes Logging : Detailliertes Logging mit verschiedenen Ebenen (Debug, Info, Warnung, Fehler)

  • Leistungsmetriken : Verfolgen Sie die Anzahl der Vorgänge, Fehler und Ausführungszeiten

  • Konfigurationsverwaltung : Unterstützung für JSON-Konfigurationsdateien

  • Pfad-Caching : Verbesserte Leistung für häufig aufgerufene Pfade

  • Verbesserte Fehlerbehandlung : Spezialisierte Fehlertypen mit strukturierten Informationen

  • Validierung der Dateigröße : Verhindern Sie das Laden übermäßig großer Dateien

  • CLI-Verbesserungen : Hilfebefehl, Versionsinformationen und Konfigurationsgenerierung

Konfigurationsoptionen

Sie können eine Konfigurationsdatei erstellen mit:

$ mcp-filesystem --create-config=config.json

Beispielkonfiguration:

{
  "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
  }
}

:writing_hand: Autor

Lizenz

MIT-Lizenz

Install Server
A
license - permissive license
A
quality
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    -
    quality
    D
    maintenance
    A Model Context Protocol (MCP) server that allows AI models to safely access and interact with local file systems, enabling reading file contents, listing directories, and retrieving file metadata.
    10
    10
    MIT
  • A
    license
    A
    quality
    F
    maintenance
    A Model Context Protocol server that provides secure and intelligent interaction with files and filesystems, offering smart context management and token-efficient operations for working with large files and complex directory structures.
    21
    66
    MIT
  • A
    license
    C
    quality
    D
    maintenance
    A server implementing the Model Context Protocol that provides filesystem operations (read/write, directory management, file movement) through a standardized interface with security controls for allowed directories.
    9
    4
    MIT

View all related MCP servers

Related MCP Connectors

  • A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…

  • A Model Context Protocol server for Wix AI tools

  • Securely search and manage workspace context files for AI agents and teams.

View all MCP Connectors

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/gabrielmaialva33/mcp-filesystem'

If you have feedback or need assistance with the MCP directory API, please join our Discord server