Allows managing Docker containers on remote servers by executing commands such as docker ps and docker ps -a via SSH.
Provides tools for executing shell commands and managing files on remote Linux servers through an SSH connection.
Facilitates remote administration of NGINX web servers, including editing configuration files and managing logs via SSH.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@SSH MCP Serverrun 'docker ps' on the production server"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
SSH MCP Server
基于 Model Context Protocol (MCP) 的 SSH 服务器工具集,支持在远程服务器上执行命令和传输文件。
两种使用方式
本工具支持两种连接 SSH 服务器的方式:
方式一:直接参数(临时连接)
直接在工具调用中指定服务器信息,适合临时操作:
方式二:配置文件(推荐)
预先配置服务器信息,通过名称调用,适合频繁使用的服务器:
创建
ssh-mcp.config.json配置文件使用
server参数指定服务器名称
优势:
无需每次输入密码
支持多服务器配置
通过
ssh_list_servers工具查询可用服务器Agent 可自主发现并使用服务器
安装
MCP 客户端配置
OpenCode
配置文件位置:C:\Users\<用户名>\.config\opencode\opencode.jsonc
Claude Code
配置文件位置:C:\Users\<用户名>\.claude\CLAUDE.json
Claude Desktop
配置文件位置:
Windows:
%APPDATA%/Claude/claude_desktop_config.jsonmacOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonLinux:
~/.config/Claude/claude_desktop_config.json
SSH 配置文件
创建配置文件
配置文件位置(按优先级)
SSH_MCP_CONFIG环境变量指定路径当前项目目录
ssh-mcp.config.json当前项目目录
.ssh-mcp-config.json用户主目录
.ssh-mcp-config.json
配置文件参数说明
参数 | 必填 | 默认值 | 说明 |
| 是 | - | SSH 服务器地址 |
| 否 | 22 | SSH 端口 |
| 是 | - | 用户名 |
| 是 | - | 密码 |
| 否 | 30000 | 超时时间(毫秒) |
使用示例
列出所有已配置的服务器
ssh_execute_command - 执行命令
使用配置文件中的服务器:
直接指定参数:
指定工作目录:
ssh_upload_file - 上传文件
使用配置文件:
直接指定参数:
ssh_download_file - 下载文件
从服务器下载日志文件:
指定输出格式:
ssh_upload_directory - 上传目录
部署应用到服务器:
同步配置目录:
ssh_download_directory - 下载目录
下载服务器日志目录:
备份项目目录:
工具列表
工具 | 说明 |
| 列出所有已配置的服务器 |
| 执行命令 |
| 上传文件 |
| 下载文件 |
| 上传目录 |
| 下载目录 |
ssh_execute_command 参数
参数 | 类型 | 必填 | 说明 |
| string | 否 | 服务器名称(配置文件) |
| string | 否 | SSH 服务器地址 |
| number | 否 | SSH 端口,默认 22 |
| string | 否 | 用户名 |
| string | 否 | 密码 |
| number | 否 | 超时时间(毫秒) |
| string | 是 | 要执行的命令 |
| string | 否 | 工作目录 |
| string | 否 | 输出格式(markdown/json) |
ssh_upload_file 参数
参数 | 类型 | 必填 | 说明 |
| string | 否 | 服务器名称(配置文件) |
| string | 否 | SSH 服务器地址 |
| number | 否 | SSH 端口,默认 22 |
| string | 否 | 用户名 |
| string | 否 | 密码 |
| number | 否 | 超时时间(毫秒) |
| string | 是 | 本地文件路径 |
| string | 是 | 远程目标路径 |
| string | 否 | 输出格式(markdown/json) |
ssh_download_file 参数
参数 | 类型 | 必填 | 说明 |
| string | 否 | 服务器名称(配置文件) |
| string | 否 | SSH 服务器地址 |
| number | 否 | SSH 端口,默认 22 |
| string | 否 | 用户名 |
| string | 否 | 密码 |
| number | 否 | 超时时间(毫秒) |
| string | 是 | 远程文件路径 |
| string | 是 | 本地目标路径 |
| string | 否 | 输出格式(markdown/json) |
ssh_upload_directory 参数
参数 | 类型 | 必填 | 说明 |
| string | 否 | 服务器名称(配置文件) |
| string | 否 | SSH 服务器地址 |
| number | 否 | SSH 端口,默认 22 |
| string | 否 | 用户名 |
| string | 否 | 密码 |
| number | 否 | 超时时间(毫秒) |
| string | 是 | 本地目录路径 |
| string | 是 | 远程目标目录 |
| string | 否 | 输出格式(markdown/json) |
ssh_download_directory 参数
参数 | 类型 | 必填 | 说明 |
| string | 否 | 服务器名称(配置文件) |
| string | 否 | SSH 服务器地址 |
| number | 否 | SSH 端口,默认 22 |
| string | 否 | 用户名 |
| string | 否 | 密码 |
| number | 否 | 超时时间(毫秒) |
| string | 是 | 远程目录路径 |
| string | 是 | 本地目标目录 |
| string | 否 | 输出格式(markdown/json) |