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:
Node.js (>=18.0.0)
pnpm (>=8.0.0)
Docker (optional)
Docker Compose (optional)
: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.jsonVerwenden 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.jsonVerwenden 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.jsonVerwenden 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-filesystemVerwenden 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.jsonBeispielkonfiguration:
{
"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
Maintenance
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
- Alicense-qualityDmaintenanceA 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.1010MIT
- AlicenseAqualityFmaintenanceA 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.2166MIT
- AlicenseCqualityDmaintenanceA 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.94MIT
- AlicenseAqualityFmaintenanceA Model Context Protocol server that provides AI agents with secure access to local filesystem operations, enabling reading, writing, and managing files through a standardized interface.1010246Apache 2.0
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.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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