返回 MCP 目录
public公开dns本地运行

FTP/SSH Bridge for WordPress

MCP服务器是一个支持FTP、SFTP和SSH连接的工具,允许用户通过Cursor AI直接管理远程服务器上的文件,包括上传、下载、编辑等操作,特别适合WordPress等网站托管服务的管理。

article

README

🚀 用于FTP/SSH的MCP服务器

此MCP服务器可让你直接从Cursor AI连接并管理远程服务器上的文件,极大简化了WordPress托管及其他远程服务器的管理工作。

🚀 快速开始

此MCP服务器能让你轻松连接并管理远程服务器文件,下面为你介绍其使用步骤。

✨ 主要特性

  • 可连接到FTP、SFTP和SSH服务器。
  • 能列出远程文件和目录。
  • 支持上传和下载文件。
  • 可创建、删除和重命名文件及目录。
  • 能读取和写入文件内容。
  • 支持多条同时连接。

📦 安装指南

  1. 确保已安装Node.js(v14+)。
  2. 克隆此仓库或复制MCP文件夹。
  3. 安装依赖项:
cd MCP
npm install

💻 使用示例

基础用法

Cursor的配置

.cursor/mcp.json文件已包含并配置完成,Cursor应自动识别该MCP服务器。

启动服务器

有两种方式可以启动MCP服务器:

  1. stdio模式(推荐用于与Cursor一起使用):
npm start
  1. HTTP模式(适用于开发或其他工具):
npm run start:http

在Cursor中的示例使用

以下是MCP服务器在Cursor中使用的示例:

// 连接到FTP服务器
connect(type="ftp", host="meu-servidor.com", port=21, username="usuario", password="senha")

// 连接到SFTP/SSH服务器
connect(type="sftp", host="meu-servidor.com", port=22, username="usuario", password="senha")

// 列出远程目录中的文件
list_directory(connectionId="conn_id_retornado", path="/caminho/remoto")

// 上传文件到服务器
upload_file(connectionId="conn_id_retornado", localPath="/caminho/local/arquivo.txt", remotePath="/caminho/remoto/arquivo.txt")

// 下载远程文件
download_file(connectionId="conn_id_retornado", remotePath="/caminho/remoto/arquivo.txt", localPath="/caminho/local/arquivo.txt")

// 读取文件内容
read_file(connectionId="conn_id_retornado", path="/caminho/remoto/arquivo.txt")

// 写入文件内容
write_file(connectionId="conn_id_retornado", path="/caminho/remoto/arquivo.txt", content="Novo conteúdo do arquivo")

// 完成后断开连接
disconnect(connectionId="conn_id_retornado")

📚 详细文档

可用工具

| 属性 | 详情 | |------|------| | connect | 连接到FTP、SFTP或SSH服务器 | | list_directory | 列出远程指定路径中的文件和目录 | | download_file | 从远程服务器下载文件 | | upload_file | 将文件上传到远程服务器 | | delete_file | 删除远程服务器上的文件 | | create_directory | 创建远程服务器上的新目录 | | remove_directory | 删除远程服务器上的目录 | | rename | 在远程服务器上重命名文件或目录 | | read_file | 读取远程服务器上文件的内容 | | write_file | 向远程服务器上的文件写入内容 | | disconnect | 关闭与远程服务器的连接 |

安全性

  • 密码和私钥仅用于身份验证,不会被永久存储。
  • 所有连接均在会话期间管理,并在完成后关闭。
  • 建议优先使用私钥进行身份验证而非密码。

故障排除

  • 如果无法连接,请检查网络设置和远程服务器状态。
  • 确保使用的协议(ftp、sftp、ssh)与远程服务器配置一致。
  • 验证提供的凭据是否正确。

📄 许可证

本项目遵循MIT许可证,具体内容如下:

MIT License

版权所有 (c) [年份] [持有者姓名]

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
help

运行方式说明

cloud

托管运行

托管运行通常表示这个 MCP Server 由服务方环境承载,用户一般按页面提供的连接方式或授权流程接入,不需要在本地长期启动一个 MCP 进程

  1. 打开服务方连接页
  2. 完成授权或复制端点
  3. 在 MCP 客户端中连接
terminal

本地运行 / 其它方式

本地运行通常需要用户在自己的电脑或服务器上安装依赖,把 server_config 复制到 MCP 客户端,并按 env_schema 补齐环境变量、密钥或其它配置

  1. 复制 server_config
  2. 安装所需依赖
  3. 补齐环境变量后重启客户端