Skip to main content
Glama
MCP Server for FTP Access

MCP Server for FTP Access

FTPアクセス用MCPサーバー

このModel Context Protocol (MCP) サーバーは、FTPサーバーと対話するためのツールを提供します。Claude.appからFTPサーバー上のディレクトリ一覧表示、ファイルのダウンロードとアップロード、ディレクトリ作成、ファイル/ディレクトリの削除が可能になります。

機能

  • ディレクトリ内容の一覧表示: FTPサーバー上のファイルやフォルダーを表示

  • ファイルのダウンロード: FTPサーバーからファイルの内容を取得

  • ファイルのアップロード: 新規ファイルの作成や既存ファイルの更新

  • ディレクトリの作成: FTPサーバー上に新しいフォルダーを作成

  • ファイル/ディレクトリの削除: ファイルやディレクトリを削除

Related MCP server: MCP SSH Server

インストール

Smithery経由でのインストール

Smithery を使用してClaude Desktop用のmcp-server-ftpを自動的にインストールするには:

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

FTPサーバーのホスト名またはIPアドレス

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

SFTP用SSH秘密鍵へのパス (例: ~/.ssh/id_ed25519)

(自動検出)

FTP_PASSPHRASE

SSH秘密鍵のパスフレーズ (暗号化対応)

(空文字)

FTP_ENCRYPTION_KEY

資格情報を復号するための64文字の16進数AES-256キー

(無効)

SSH / SFTPサポート

通常のFTPやFTPSに加え、このサーバーはSFTP(SSH File Transfer Protocol)をサポートしています。これは暗号化されたSSH接続上で実行され、FTPSとは無関係です。

FTP_PROTOCOL=sftp を設定して、サーバーをSFTPモードに切り替えます。デフォルトのポートは 22 に変更されます。

認証

SFTPは、自動的に選択される2つの認証方法をサポートしています:

  • 秘密鍵 — 鍵が見つかった場合(下記参照)、認証に使用されます。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の設定ファイルにプレーンテキストのパスワードを保存することはセキュリティ上のリスクです。このサーバーは FTP_USER と FTP_PASSWORD に対してAES-256-GCM暗号化をサポートしているため、設定ファイルには暗号文のみを含めることができます。

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操作を実行できます:

  • "FTPサーバーの /public ディレクトリにあるファイル一覧を表示して"

  • "FTPサーバーから /data/report.txt ファイルをダウンロードして"

  • "このテキストを notes.txt という名前のファイルとしてFTPサーバーにアップロードして"

  • "FTPサーバー上に 'backups' という新しいディレクトリを作成して"

  • "FTPサーバーから obsolete.txt ファイルを削除して"

  • "FTPサーバーから空のディレクトリ /old-project を削除して"

利用可能なツール

ツール名

説明

list-directory

FTPディレクトリの内容を一覧表示

download-file

FTPサーバーからファイルをダウンロード

upload-file

FTPサーバーにファイルをアップロード

create-directory

FTPサーバー上に新しいディレクトリを作成

delete-file

FTPサーバーからファイルを削除

delete-directory

FTPサーバーからディレクトリを削除

セキュリティ上の考慮事項

  • 設定ファイルにプレーンテキストのパスワードを保存しないよう、資格情報の暗号化 機能を使用してください。

  • 可能であれば、通常のFTPやFTPSよりもSFTP (FTP_PROTOCOL=sftp) を優先してください。これはSSHを使用し、証明書の管理を必要としません。

  • サーバーが対応しているがSFTPが利用できない場合は、FTP_SECURE=true を設定してFTPS(セキュアFTP)の使用を検討してください。

  • サーバーは、アップロードおよびダウンロードのためにシステムのテンポラリディレクトリに一時ファイルを作成します。

ライセンス

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