MCP Server for FTP Access
MCP-Server für FTP-Zugriff
Dieser Model Context Protocol (MCP)-Server stellt Werkzeuge für die Interaktion mit FTP-Servern bereit. Er ermöglicht es Claude.app, Verzeichnisse auf FTP-Servern aufzulisten, Dateien herunter- und hochzuladen, Verzeichnisse zu erstellen sowie Dateien/Verzeichnisse zu löschen.
Funktionen
Verzeichnisinhalt auflisten: Dateien und Ordner auf dem FTP-Server anzeigen
Dateien herunterladen: Dateiinhalte vom FTP-Server abrufen
Dateien hochladen: Neue Dateien erstellen oder bestehende aktualisieren
Verzeichnisse erstellen: Neue Ordner auf dem FTP-Server anlegen
Dateien/Verzeichnisse löschen: Dateien oder Verzeichnisse entfernen
Related MCP server: MCP SSH Server
Installation
Installation über Smithery
Um mcp-server-ftp für Claude Desktop automatisch über Smithery zu installieren:
npx -y @smithery/cli install @alxspiker/mcp-server-ftp --client claudeVoraussetzungen
Node.js 16 oder höher
Claude for Desktop (oder ein anderer MCP-kompatibler Client)
Erstellen aus dem Quellcode
Linux/macOS
# Clone the repository
git clone https://github.com/alxspiker/mcp-server-ftp.git
cd mcp-server-ftp
# Install dependencies
npm install
# Build the project
npm run buildWindows
# Clone the repository
git clone https://github.com/alxspiker/mcp-server-ftp.git
cd mcp-server-ftp
# Run the Windows build helper script
build-windows.batDas Skript build-windows.bat übernimmt die Installation der Abhängigkeiten und den Build-Prozess auf Windows-Systemen, mit Fallback-Optionen, falls der TypeScript-Compiler Probleme bereitet.
Konfiguration
Um diesen Server mit Claude for Desktop zu verwenden, fügen Sie ihn Ihrer Konfigurationsdatei hinzu:
MacOS/Linux
Bearbeiten Sie ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"ftp-server": {
"command": "node",
"args": ["/absolute/path/to/mcp-server-ftp/build/index.js"],
"env": {
"FTP_HOST": "ftp.example.com",
"FTP_PORT": "21",
"FTP_USER": "your-username",
"FTP_PASSWORD": "your-password",
"FTP_SECURE": "false"
}
}
}
}Windows
Bearbeiten Sie %APPDATA%\Claude\claude_desktop_config.json:
{
"mcpServers": {
"ftp-server": {
"command": "node",
"args": ["C:\\path\\to\\mcp-server-ftp\\build\\index.js"],
"env": {
"FTP_HOST": "ftp.example.com",
"FTP_PORT": "21",
"FTP_USER": "your-username",
"FTP_PASSWORD": "your-password",
"FTP_SECURE": "false"
}
}
}
}Fehlerbehebung bei Windows-Build-Problemen
Falls beim Build unter Windows Probleme auftreten:
Verwenden Sie das bereitgestellte Skript
build-windows.bat, das häufige Build-Probleme behandeltStellen Sie sicher, dass Node.js und npm korrekt installiert sind
Versuchen Sie, den TypeScript-Compiler direkt auszuführen:
npx tscWenn weiterhin Probleme bestehen, können Sie die vorkompilierten Dateien im Verzeichnis
buildverwenden, indem Sie Folgendes ausführen:node path\to\mcp-server-ftp\build\index.js
Konfigurationsoptionen
Umgebungsvariable | Beschreibung | Standardwert |
| FTP-Server-Hostname oder IP-Adresse | localhost |
| FTP-Server-Port | 21 |
| FTP-Benutzername (unterstützt Verschlüsselung) | anonymous |
| FTP-Passwort (unterstützt Verschlüsselung) | (leerer String) |
| Sicheres FTP (FTPS) verwenden, wird ignoriert, wenn | false |
| Zu verwendendes Protokoll: | ftp |
| Pfad zum privaten SSH-Schlüssel für SFTP (z. B. | (automatische Erkennung) |
| Passphrase für den privaten SSH-Schlüssel (unterstützt Verschlüsselung) | (leerer String) |
| 64-stelliger Hex-AES-256-Schlüssel zur Entschlüsselung von Anmeldedaten | (deaktiviert) |
SSH / SFTP-Unterstützung
Zusätzlich zu einfachem FTP und FTPS unterstützt der Server SFTP – das SSH File Transfer Protocol –, das über eine verschlüsselte SSH-Verbindung läuft und nicht mit FTPS verwandt ist.
Setzen Sie FTP_PROTOCOL=sftp, um den Server in den SFTP-Modus zu schalten. Der Standardport ändert sich dann auf 22.
Authentifizierung
SFTP unterstützt zwei Authentifizierungsmethoden, die automatisch ausgewählt werden:
Privater Schlüssel – wenn ein Schlüssel gefunden wird (siehe unten), wird dieser zur Authentifizierung verwendet.
FTP_PASSPHRASEwird verwendet, um den Schlüssel zu entschlüsseln, falls er passwortgeschützt ist.Passwort – wenn kein Schlüssel gefunden wird, wird
FTP_PASSWORDfür die Passwortauthentifizierung verwendet.
Schlüsselerkennung
Der Server sucht in dieser Reihenfolge nach einem privaten Schlüssel:
Der Pfad in
FTP_PRIVATE_KEY_PATH(falls gesetzt)~/.ssh/id_ed25519~/.ssh/id_rsa~/.ssh/id_ecdsa
Konfigurationsbeispiel
{
"mcpServers": {
"ftp-server": {
"command": "node",
"args": ["/absolute/path/to/mcp-server-ftp/build/index.js"],
"env": {
"FTP_HOST": "sftp.example.com",
"FTP_PORT": "22",
"FTP_PROTOCOL": "sftp",
"FTP_USER": "your-username",
"FTP_PRIVATE_KEY_PATH": "~/.ssh/id_ed25519",
"FTP_PASSPHRASE": "your-key-passphrase"
}
}
}
}FTP_PASSPHRASE und FTP_USER unterstützen beide das verschlüsselte Format enc: – siehe Anmeldedaten-Verschlüsselung.
Anmeldedaten-Verschlüsselung
Das Speichern von Passwörtern im Klartext in Ihrer Claude-Konfigurationsdatei ist ein Sicherheitsrisiko. Der Server unterstützt AES-256-GCM-Verschlüsselung für FTP_USER und FTP_PASSWORD, sodass die Konfiguration nur noch Geheimtext enthält.
1. Einen Verschlüsselungsschlüssel generieren
node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"Halten Sie diesen Schlüssel geheim – behandeln Sie ihn wie ein Master-Passwort.
2. Einen Anmeldedatenwert verschlüsseln
npm run build
FTP_ENCRYPTION_KEY=<your-64-char-hex-key> npm run encrypt-env -- <plaintext-value>Die Ausgabe ist ein in sich geschlossener verschlüsselter String im Format enc:<iv_hex>:<tag_hex>:<ciphertext_hex>.
3. Die verschlüsselten Werte in Ihrer Konfiguration verwenden
Setzen Sie FTP_ENCRYPTION_KEY zusammen mit den verschlüsselten Anmeldedaten. Werte, die nicht mit enc: beginnen, werden als Klartext behandelt, sodass Sie selektiv verschlüsseln können.
{
"mcpServers": {
"ftp-server": {
"command": "node",
"args": ["/absolute/path/to/mcp-server-ftp/build/index.js"],
"env": {
"FTP_HOST": "ftp.example.com",
"FTP_PORT": "21",
"FTP_USER": "enc:aabbcc...:ddeeff...:112233...",
"FTP_PASSWORD": "enc:aabbcc...:ddeeff...:112233...",
"FTP_SECURE": "false",
"FTP_ENCRYPTION_KEY": "<your-64-char-hex-key>"
}
}
}
}Verwendung
Nachdem Sie Claude for Desktop konfiguriert und neu gestartet haben, können Sie natürlichsprachliche Befehle verwenden, um FTP-Operationen durchzuführen:
"List the files in the /public directory on my FTP server"
"Download the file /data/report.txt from the FTP server"
"Upload this text as a file called notes.txt to the FTP server"
"Create a new directory called 'backups' on the FTP server"
"Delete the file obsolete.txt from the FTP server"
"Remove the empty directory /old-project from the FTP server"
Verfügbare Werkzeuge
Werkzeugname | Beschreibung |
| Inhalt eines FTP-Verzeichnisses auflisten |
| Datei vom FTP-Server herunterladen |
| Datei auf den FTP-Server hochladen |
| Neues Verzeichnis auf dem FTP-Server erstellen |
| Datei vom FTP-Server löschen |
| Verzeichnis vom FTP-Server löschen |
Sicherheitshinweise
Verwenden Sie die Funktion Anmeldedaten-Verschlüsselung, um das Speichern von Passwörtern im Klartext in Ihrer Konfigurationsdatei zu vermeiden.
Bevorzugen Sie SFTP (
FTP_PROTOCOL=sftp) gegenüber einfachem FTP oder FTPS, wo immer möglich – es verwendet SSH und erfordert keine Zertifikatsverwaltung.Erwägen Sie die Verwendung von FTPS (sicheres FTP), indem Sie
FTP_SECURE=truesetzen, falls Ihr Server dies unterstützt, aber SFTP nicht verfügbar ist.Der Server erstellt temporäre Dateien für Uploads und Downloads im temporären Verzeichnis Ihres Systems.
Lizenz
MIT
Available Tools
11 toolsappend-fileAppend to FileA
Append content to the end of a file on the FTP server (creates the file if it does not exist). Pass encoding "base64" for binary content.
Inputs: content (required), remotePath (required), encoding. Returns: remotePath, appendedBytes
create-directoryCreate DirectoryBIdempotent
Create a new directory on the FTP server
Inputs: remotePath (required). Returns: created, remotePath
delete-directoryDelete DirectoryCDestructiveIdempotent
Delete a directory from the FTP server
Inputs: remotePath (required). Returns: deleted, remotePath
delete-fileDelete FileBDestructiveIdempotent
Delete a file from the FTP server
Inputs: remotePath (required). Returns: deleted, remotePath
download-fileDownload FileARead-only
Download a file from the FTP server. Text files are returned as-is; binary files are returned base64-encoded.
Inputs: remotePath (required). Returns: content, encoding, remotePath
download-to-localDownload To Local FileADestructiveIdempotent
Download a file from the FTP server straight to a path on this computer, streamed, without returning its contents. Only paths inside the directories listed in FTP_LOCAL_ROOTS can be written.
Inputs: localPath (required), remotePath (required), overwrite. Returns: bytes, sha256, localPath, remotePath
edit-fileEdit FileADestructive
Edit a text file on the FTP server by replacing an exact string, without re-uploading the whole file content. oldText must match exactly (including whitespace) and be unique in the file unless replaceAll is set.
Inputs: newText (required), oldText (required), remotePath (required), replaceAll. Returns: fileSize, remotePath, replacements
list-directoryList DirectoryCRead-only
List contents of an FTP directory
Inputs: remotePath (required). Returns: path, entries, fileCount, totalCount, +1 more
rename-fileRename / MoveCDestructive
Rename or move a file or directory on the FTP server
Inputs: toPath (required), fromPath (required). Returns: toPath, renamed, fromPath
upload-fileUpload FileBDestructiveIdempotent
Upload a file to the FTP server. Pass encoding "base64" to upload binary content.
Inputs: content (required), remotePath (required), encoding. Returns: remotePath, bytesWritten
upload-local-fileUpload Local FileADestructiveIdempotent
Upload a file from this computer to the FTP server by path, streamed, so file size is not limited by the request. Only files inside the directories listed in FTP_LOCAL_ROOTS can be uploaded.
Inputs: localPath (required), remotePath (required). Returns: sha256, localPath, remotePath, remoteSize, +1 more
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 11 tools
Most tools target a distinct resource+action combination (create vs delete vs list vs rename). The only real overlap is between the content-based and local-path-based transfer pairs (upload-file/upload-local-file, download-file/download-to-local), but the descriptions explicitly clarify the streamed-vs-in-memory distinction. An agent should be able to choose correctly with a careful read.
Nine of eleven tools follow a clean verb_noun hyphenated pattern (delete-file, list-directory, rename-file, create-directory, edit-file, append-file). The two local-path transfer tools (upload-local-file, download-to-local) deviate with extra qualifiers, but the convention remains readable and predictable overall.
Eleven tools is well-scoped for an FTP server, and each earns its place: directory CRUD, file transfer both in-memory and streamed, plus targeted edit/append operations. Nothing feels redundant or padded.
The surface covers the core FTP lifecycle: create/delete/list directories, upload/download (both content and streamed), rename/move, edit and append. Gaps are minor but real: no stat/metadata or existence-check tool, no permission/chmod handling, and no recursive directory listing or search, which agents may need to verify operations.
Maintenance
Related MCP Connectors
Give Claude only the Google Drive files you choose. Every action logged.
Use your Mac, Windows or Linux computer from ChatGPT, Claude or Codex: files, commands, documents.
Connect Claude to your Platform7n workspaces: chat, links, work and decks. One-click OAuth.
Connect Claude to your Platform7n workspaces: chat, links, work and decks. One-click OAuth.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables SSH remote access to servers through Claude, allowing users to execute commands, transfer files via SFTP, and manage multiple remote connections using natural language.129MIT
- AlicenseNot gradedqualityNot gradedmaintenanceConnects Claude to remote servers via SSH to execute commands, manage files, and browse directories. It allows users to add, edit, and switch between multiple server configurations through natural language conversations.-
- AlicenseAqualityDmaintenanceEnables Claude to connect to servers via SSH, execute commands, transfer files, and manage connections through natural language.921 npm1MIT
- AlicenseAqualityDmaintenanceEnables FTP file operations such as upload, download, list, and delete directly from Claude Desktop or Claude CLI.15MIT