Skip to main content
Glama
MCP Server for FTP Access

MCP Server for FTP Access

MCP-сервер для доступа по FTP

Этот сервер протокола контекста модели (MCP) предоставляет инструменты для взаимодействия с FTP-серверами. Он позволяет Claude.app просматривать содержимое директорий, скачивать и загружать файлы, создавать директории и удалять файлы/директории на FTP-серверах.

Возможности

  • Просмотр содержимого директорий: Просмотр файлов и папок на FTP-сервере

  • Скачивание файлов: Получение содержимого файлов с FTP-сервера

  • Загрузка файлов: Создание новых файлов или обновление существующих

  • Создание директорий: Создание новых папок на FTP-сервере

  • Удаление файлов/директорий: Удаление файлов или директорий

Related MCP server: MCP SSH Server

Установка

Установка через Smithery

Чтобы автоматически установить mcp-server-ftp для Claude Desktop через Smithery:

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

Предварительные требования

  • Node.js 16 или выше

  • Claude for Desktop (или другой клиент, поддерживающий MCP)

Сборка из исходного кода

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

Скрипт build-windows.bat выполняет установку зависимостей и сборку в системах Windows, с резервными вариантами на случай проблем с компилятором TypeScript.

Конфигурация

Чтобы использовать этот сервер с Claude for Desktop, добавьте его в свой файл конфигурации:

MacOS/Linux

Отредактируйте ~/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

Отредактируйте %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"
      }
    }
  }
}

Устранение неполадок при сборке в Windows

Если вы столкнулись с проблемами при сборке в Windows:

  1. Используйте предоставленный скрипт build-windows.bat, который обрабатывает распространенные ошибки сборки

  2. Убедитесь, что Node.js и npm установлены правильно

  3. Попробуйте запустить компилятор TypeScript напрямую: npx tsc

  4. Если проблемы сохраняются, вы можете использовать предварительно скомпилированные файлы в директории build, выполнив:

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

Параметры конфигурации

Переменная окружения

Описание

По умолчанию

FTP_HOST

Имя хоста или IP-адрес FTP-сервера

localhost

FTP_PORT

Порт FTP-сервера

21

FTP_USER

Имя пользователя FTP (поддерживает шифрование)

anonymous

FTP_PASSWORD

Пароль FTP (поддерживает шифрование)

(пустая строка)

FTP_SECURE

Использовать защищенный FTP (FTPS), игнорируется, если FTP_PROTOCOL=sftp

false

FTP_PROTOCOL

Используемый протокол: ftp или sftp

ftp

FTP_PRIVATE_KEY_PATH

Путь к закрытому SSH-ключу для SFTP (например, ~/.ssh/id_ed25519)

(автоопределение)

FTP_PASSPHRASE

Парольная фраза для закрытого SSH-ключа (поддерживает шифрование)

(пустая строка)

FTP_ENCRYPTION_KEY

64-символьный шестнадцатеричный ключ AES-256 для расшифровки учетных данных

(отключено)

Поддержка SSH / SFTP

Помимо обычного FTP и FTPS, сервер поддерживает SFTP — протокол передачи файлов SSH, который работает через зашифрованное SSH-соединение и не связан с FTPS.

Установите FTP_PROTOCOL=sftp, чтобы переключить сервер в режим SFTP. Порт по умолчанию изменится на 22.

Аутентификация

SFTP поддерживает два метода аутентификации, выбираемых автоматически:

  • Закрытый ключ — если ключ найден (см. ниже), он используется для аутентификации. FTP_PASSPHRASE используется для расшифровки ключа, если он защищен парольной фразой.

  • Пароль — если ключ не найден, для аутентификации используется FTP_PASSWORD.

Поиск ключа

Сервер ищет закрытый ключ в следующем порядке:

  1. Путь в FTP_PRIVATE_KEY_PATH (если задан)

  2. ~/.ssh/id_ed25519

  3. ~/.ssh/id_rsa

  4. ~/.ssh/id_ecdsa

Пример конфигурации

{
  "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 и FTP_USER поддерживают зашифрованный формат enc: — см. Шифрование учетных данных.

Шифрование учетных данных

Хранение паролей в открытом виде в файле конфигурации Claude является риском для безопасности. Сервер поддерживает шифрование AES-256-GCM для FTP_USER и FTP_PASSWORD, поэтому конфигурация содержит только зашифрованный текст.

1. Генерация ключа шифрования

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

Храните этот ключ в секрете — относитесь к нему как к мастер-паролю.

2. Шифрование значения учетных данных

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

Результатом является автономная зашифрованная строка в формате enc:<iv_hex>:<tag_hex>:<ciphertext_hex>.

3. Использование зашифрованных значений в конфигурации

Установите FTP_ENCRYPTION_KEY вместе с зашифрованными учетными данными. Значения, которые не начинаются с enc:, рассматриваются как открытый текст, поэтому вы можете шифровать данные выборочно.

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

Использование

После настройки и перезапуска Claude for Desktop вы можете использовать естественный язык для выполнения операций FTP:

  • "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"

Доступные инструменты

Имя инструмента

Описание

list-directory

Просмотр содержимого FTP-директории

download-file

Скачивание файла с FTP-сервера

upload-file

Загрузка файла на FTP-сервер

create-directory

Создание новой директории на FTP-сервере

delete-file

Удаление файла с FTP-сервера

delete-directory

Удаление директории с FTP-сервера

Вопросы безопасности

  • Используйте функцию шифрования учетных данных, чтобы избежать хранения паролей в открытом виде в файле конфигурации.

  • По возможности отдавайте предпочтение SFTP (FTP_PROTOCOL=sftp) вместо обычного FTP или FTPS — он использует SSH и не требует управления сертификатами.

  • Рассмотрите возможность использования FTPS (защищенного FTP), установив FTP_SECURE=true, если ваш сервер поддерживает его, но SFTP недоступен.

  • Сервер создает временные файлы для загрузки и скачивания в системной временной директории.

Лицензия

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
      C
      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