Skip to main content
Glama
MCP Server for FTP Access

MCP Server for FTP Access

Servidor MCP para acceso FTP

Este servidor del Protocolo de Contexto de Modelo (MCP) proporciona herramientas para interactuar con servidores FTP. Permite a Claude.app listar directorios, descargar y subir archivos, crear directorios y eliminar archivos/directorios en servidores FTP.

Características

  • Listar contenido del directorio: Ver archivos y carpetas en el servidor FTP

  • Descargar archivos: Recuperar el contenido de archivos desde el servidor FTP

  • Subir archivos: Crear nuevos archivos o actualizar los existentes

  • Crear directorios: Crear nuevas carpetas en el servidor FTP

  • Eliminar archivos/directorios: Eliminar archivos o directorios

Related MCP server: MCP SSH Server

Instalación

Instalación a través de Smithery

Para instalar mcp-server-ftp para Claude Desktop automáticamente a través de Smithery:

npx -y @smithery/cli install @alxspiker/mcp-server-ftp --client claude

Requisitos previos

  • Node.js 16 o superior

  • Claude for Desktop (u otro cliente compatible con MCP)

Construcción desde el código fuente

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 build

Windows

# 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.bat

El script build-windows.bat gestiona la instalación de dependencias y la construcción en sistemas Windows, con opciones de respaldo si el compilador de TypeScript presenta problemas.

Configuración

Para usar este servidor con Claude for Desktop, añádelo a tu archivo de configuración:

MacOS/Linux

Edita ~/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

Edita %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"
      }
    }
  }
}

Solución de problemas de construcción en Windows

Si encuentras problemas de construcción en Windows:

  1. Usa el script build-windows.bat proporcionado, que gestiona los problemas de construcción comunes

  2. Asegúrate de que Node.js y npm estén instalados correctamente

  3. Intenta ejecutar el compilador de TypeScript directamente: npx tsc

  4. Si aún tienes problemas, puedes usar los archivos precompilados en el directorio build ejecutando:

    node path\to\mcp-server-ftp\build\index.js

Opciones de configuración

Variable de entorno

Descripción

Predeterminado

FTP_HOST

Nombre de host o dirección IP del servidor FTP

localhost

FTP_PORT

Puerto del servidor FTP

21

FTP_USER

Nombre de usuario FTP (admite cifrado)

anonymous

FTP_PASSWORD

Contraseña FTP (admite cifrado)

(cadena vacía)

FTP_SECURE

Usar FTP seguro (FTPS), ignorado cuando FTP_PROTOCOL=sftp

false

FTP_PROTOCOL

Protocolo a utilizar: ftp o sftp

ftp

FTP_PRIVATE_KEY_PATH

Ruta a la clave privada SSH para SFTP (ej. ~/.ssh/id_ed25519)

(detección automática)

FTP_PASSPHRASE

Frase de contraseña para la clave privada SSH (admite cifrado)

(cadena vacía)

FTP_ENCRYPTION_KEY

Clave AES-256 hexadecimal de 64 caracteres para descifrar credenciales

(deshabilitado)

Soporte para SSH / SFTP

Además de FTP y FTPS simples, el servidor admite SFTP (Protocolo de transferencia de archivos SSH), que se ejecuta sobre una conexión SSH cifrada y no está relacionado con FTPS.

Establece FTP_PROTOCOL=sftp para cambiar el servidor al modo SFTP. El puerto predeterminado cambia a 22.

Autenticación

SFTP admite dos métodos de autenticación, elegidos automáticamente:

  • Clave privada: si se encuentra una clave (ver más abajo), se utiliza para la autenticación. FTP_PASSPHRASE se utiliza para descifrar la clave si está protegida por una frase de contraseña.

  • Contraseña: si no se encuentra ninguna clave, se utiliza FTP_PASSWORD para la autenticación por contraseña.

Detección de claves

El servidor busca una clave privada en este orden:

  1. La ruta en FTP_PRIVATE_KEY_PATH (si está configurada)

  2. ~/.ssh/id_ed25519

  3. ~/.ssh/id_rsa

  4. ~/.ssh/id_ecdsa

Ejemplo de configuración

{
  "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 y FTP_USER admiten el formato cifrado enc: — ver Cifrado de credenciales.

Cifrado de credenciales

Almacenar contraseñas en texto plano en tu archivo de configuración de Claude es un riesgo de seguridad. El servidor admite el cifrado AES-256-GCM para FTP_USER y FTP_PASSWORD, de modo que la configuración solo contenga texto cifrado.

1. Generar una clave de cifrado

node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"

Mantén esta clave en secreto; trátala como una contraseña maestra.

2. Cifrar un valor de credencial

npm run build
FTP_ENCRYPTION_KEY=<your-64-char-hex-key> npm run encrypt-env -- <plaintext-value>

El resultado es una cadena cifrada autocontenida en el formato enc:<iv_hex>:<tag_hex>:<ciphertext_hex>.

3. Usar los valores cifrados en tu configuración

Establece FTP_ENCRYPTION_KEY junto con las credenciales cifradas. Los valores que no comienzan con enc: se tratan como texto plano, por lo que puedes cifrar de forma selectiva.

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

Uso

Después de configurar y reiniciar Claude for Desktop, puedes usar lenguaje natural para realizar operaciones FTP:

  • "Lista los archivos en el directorio /public en mi servidor FTP"

  • "Descarga el archivo /data/report.txt del servidor FTP"

  • "Sube este texto como un archivo llamado notes.txt al servidor FTP"

  • "Crea un nuevo directorio llamado 'backups' en el servidor FTP"

  • "Elimina el archivo obsolete.txt del servidor FTP"

  • "Elimina el directorio vacío /old-project del servidor FTP"

Herramientas disponibles

Nombre de la herramienta

Descripción

list-directory

Listar el contenido de un directorio FTP

download-file

Descargar un archivo del servidor FTP

upload-file

Subir un archivo al servidor FTP

create-directory

Crear un nuevo directorio en el servidor FTP

delete-file

Eliminar un archivo del servidor FTP

delete-directory

Eliminar un directorio del servidor FTP

Consideraciones de seguridad

  • Utiliza la función de Cifrado de credenciales para evitar almacenar contraseñas en texto plano en tu archivo de configuración.

  • Prefiere SFTP (FTP_PROTOCOL=sftp) sobre FTP o FTPS simples siempre que sea posible; utiliza SSH y no requiere gestión de certificados.

  • Considera usar FTPS (FTP seguro) configurando FTP_SECURE=true si tu servidor lo admite pero SFTP no está disponible.

  • El servidor crea archivos temporales para subidas y descargas en el directorio temporal de tu sistema.

Licencia

MIT

Available Tools

11 tools
append-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 DirectoryB
Idempotent

Create a new directory on the FTP server

Inputs: remotePath (required). Returns: created, remotePath

delete-directoryDelete DirectoryC
DestructiveIdempotent

Delete a directory from the FTP server

Inputs: remotePath (required). Returns: deleted, remotePath

delete-fileDelete FileB
DestructiveIdempotent

Delete a file from the FTP server

Inputs: remotePath (required). Returns: deleted, remotePath

download-fileDownload FileA
Read-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 FileA
DestructiveIdempotent

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 FileA
Destructive

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 DirectoryC
Read-only

List contents of an FTP directory

Inputs: remotePath (required). Returns: path, entries, fileCount, totalCount, +1 more

rename-fileRename / MoveC
Destructive

Rename or move a file or directory on the FTP server

Inputs: toPath (required), fromPath (required). Returns: toPath, renamed, fromPath

upload-fileUpload FileB
DestructiveIdempotent

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 FileA
DestructiveIdempotent

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

    A3.5/5.0

    Scored across 11 tools

    Disambiguation4/5

    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.

    Naming Consistency4/5

    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.

    Tool Count5/5

    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.

    Completeness4/5

    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

    ActivityNo data
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Enables SSH remote access to servers through Claude, allowing users to execute commands, transfer files via SFTP, and manage multiple remote connections using natural language.
      12
      9
      MIT
    • A
      license
      Not graded
      quality
      Not graded
      maintenance
      Connects 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.
      -
    • A
      license
      A
      quality
      D
      maintenance
      Enables FTP file operations such as upload, download, list, and delete directly from Claude Desktop or Claude CLI.
      15
      MIT