MCP Server for FTP Access

by alxspiker
Verified

local-only server

The server can only run on the client’s local machine because it depends on local resources.

Integrations

  • Allows interaction with FTP servers to list directory contents, download and upload files, create directories, and delete files/directories remotely.

用于 FTP 访问的 MCP 服务器

该模型上下文协议 (MCP) 服务器提供了与 FTP 服务器交互的工具。它允许 Claude.app 列出目录、下载和上传文件、创建目录以及删除 FTP 服务器上的文件/目录。

特征

  • 列出目录内容:查看 FTP 服务器上的文件和文件夹
  • 下载文件:从 FTP 服务器检索文件内容
  • 上传文件:创建新文件或更新现有文件
  • 创建目录:在 FTP 服务器上创建新文件夹
  • 删除文件/目录:删除文件或目录

安装

通过 Smithery 安装

要通过Smithery自动为 Claude Desktop 安装 mcp-server-ftp:

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

先决条件

  • Node.js 16 或更高版本
  • Claude 桌面版(或其他兼容 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

视窗

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

视窗

编辑%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_HOSTFTP 服务器主机名或 IP 地址本地主机
FTP_PORTFTP 服务器端口21
FTP_USERFTP 用户名匿名的
FTP_PASSWORDFTP 密码(空字符串)
FTP_SECURE使用安全 FTP (FTPS)错误的

用法

配置并重启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 凭证存储在 Claude 配置文件中。请确保此文件具有适当的权限。
  • 如果您的服务器支持,请考虑通过设置FTP_SECURE=true来使用 FTPS(安全 FTP)。
  • 服务器在系统的临时目录中创建用于上传和下载的临时文件。

执照

麻省理工学院

You must be authenticated.

A
security – no known vulnerabilities
F
license - not found
A
quality - confirmed to work

使 Claude 能够通过自然语言命令与 FTP 服务器交互,允许用户列出目录、下载/上传文件、创建目录以及删除 FTP 服务器上的文件/目录。

  1. Features
    1. Installation
      1. Installing via Smithery
      2. Prerequisites
      3. Building from Source
    2. Configuration
      1. MacOS/Linux
      2. Windows
    3. Troubleshooting Windows Build Issues
      1. Configuration Options
        1. Usage
          1. Available Tools
            1. Security Considerations
              1. License
                ID: ff9z4aw2np