SSH MCP Server
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.
agent-ssh
SSH 远程管理 CLI 工具,支持在远程服务器上执行命令和传输文件。可独立作为 CLI 使用,也可作为 MCP Server 运行。
安装
全局安装
npm install -g agent-ssh
agent-ssh --help本地安装
npm install
npm run build
node dist/cli.js --help本地 link(发布前)
npm link
agent-ssh --helpRelated MCP server: SSH MCP Server
CLI 命令
命令 | 功能 |
| 远程执行命令 |
| 上传文件 |
| 下载文件 |
| 上传目录 |
| 下载目录 |
| 列出已配置的服务器 |
| 以 MCP Server 模式运行 |
使用示例
# 使用配置文件中的服务器
agent-ssh exec "df -h" -s production
agent-ssh upload ./file.txt /root/file.txt -s development
agent-ssh download /var/log/app.log ./logs/ -s production
agent-ssh list-servers
# 直接指定连接参数
agent-ssh exec "ls -la" -H 192.168.1.100 -u root -p password
agent-ssh upload ./deploy.sh /opt/deploy.sh -H 192.168.1.100 -u root --private-key ~/.ssh/id_rsa
# JSON 格式输出
agent-ssh exec "uname -a" -s production --json配置文件
创建 .agent-ssh/config.json 在命令执行的目录下:
{
"servers": {
"production": {
"host": "192.168.1.100",
"port": 22,
"username": "root",
"password": "your_password",
"timeout": 60000
},
"development": {
"host": "192.168.1.50",
"port": 2222,
"username": "admin",
"privateKey": "/path/to/id_rsa",
"timeout": 30000
}
},
"defaultServer": "development"
}配置文件搜索顺序
AGENTS_SSH_CLI_CONFIG环境变量指定路径当前目录下的
.agent-ssh/config.json项目目录下的
ssh-cli.config.json当前目录下的
ssh-cli.config.json用户主目录下的
.ssh-cli-config.json
配置参数说明
参数 | 必填 | 默认值 | 说明 |
| 是 | - | SSH 服务器地址 |
| 否 | 22 | SSH 端口 |
| 是 | - | 用户名 |
| 否 | - | 密码(与 privateKey 二选一) |
| 否 | - | 私钥路径或内容(与 password 二选一) |
| 否 | 30000 | 超时时间(毫秒) |
认证方式
支持两种认证方式,password 和 privateKey 二选一即可:
密码认证:
agent-ssh exec "ls" -H 192.168.1.100 -u root -p mypassword私钥认证:
agent-ssh exec "ls" -H 192.168.1.100 -u root -k ~/.ssh/id_rsaMCP Server 模式
保留完整的 MCP 协议兼容性,可作为 Agent 的 MCP Server 使用。
agent-ssh --mcp可用 MCP 工具
工具 | 说明 |
| 列出所有已配置的服务器 |
| 执行命令 |
| 上传文件 |
| 下载文件 |
| 上传目录 |
| 下载目录 |
MCP 客户端配置
{
"mcpServers": {
"agent-ssh": {
"command": "agent-ssh",
"args": ["--mcp"]
}
}
}This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Appeared in Searches
Latest Blog Posts
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/lazyst/agent-ssh'
If you have feedback or need assistance with the MCP directory API, please join our Discord server