ssh-agent-mcp
Click on "Deploy 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-agent-mcp connect to my production server and run uptime"
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 Agent MCP
Manage SSH and SFTP via MCP tools for AI assistants.
SSH Agent MCP is a Python-based MCP (Model Context Protocol) stdio server that lets AI assistants manage SSH connections, execute commands, and transfer files via SFTP. It supports zero-argument startup, pure CLI configuration, and JSON config files, making it simple to operate multiple remote servers securely.
Requires: Python >= 3.12
Project status: Beta
Why uvx?
No local install: run
uvx ssh-agent-mcp@latestdirectlyAlways up-to-date: pin to
@latestfor consistent versioningIdeal for desktop assistants: simplest setup for Claude Desktop
Related MCP server: mcp-ssh
Why SSH Agent MCP?
Multiple concurrent sessions: manage and track many SSH connections at once
Async long-running tasks: stream outputs and control jobs like
top,tail, logsBuilt-in SFTP: upload/download, list, mkdir, remove, and rename directories/files
Auto keepalive & reconnect: maintain session health and minimize drops
Interactive commands: handle
sudo, shells, editors with input events
Install
Recommended (no local install):
uvx ssh-agent-mcp@latestPip (use PyPI to avoid cached mirrors):
pip install -i https://pypi.org/simple ssh-agent-mcpExternally managed environments: use virtualenv or pipx
python -m venv .venv && source .venv/bin/activatepipx install ssh-agent-mcp
Quick Start
Run via uvx (Claude Desktop)
Minimal config:
{
"mcpServers": {
"ssh-mcp": {
"command": "uvx",
"args": ["ssh-agent-mcp@latest"]
}
}
}The assistant can then connect using ssh_connect or ssh_connect_by_name.
CLI examples
Zero-argument startup:
ssh-agent-mcpDirect params:
ssh-agent-mcp --host example.com --user admin --password secretWith config file:
ssh-agent-mcp --config /path/to/ssh_config.json --connection production
Minimal config file
ssh_config.json:
{
"connections": [
{
"name": "production",
"host": "prod.example.com",
"username": "admin",
"private_key": "/home/user/.ssh/id_rsa"
}
],
"auto_connect": ["production"]
}Tools (MCP)
Connection:
ssh_connect,ssh_connect_by_name,ssh_disconnect,ssh_list_connectionsCommands:
ssh_execute,ssh_execute_interactive,ssh_execute_asyncLifecycle:
ssh_check_status,ssh_terminate,ssh_list_asyncSFTP:
sftp_upload,sftp_download,sftp_list,sftp_mkdir,sftp_remove,sftp_renameFiles:
remote_read_file,remote_write_fileStatus:
ssh_status
Example: Connect and Execute
{
"tool": "ssh_connect",
"params": {
"name": "prod",
"host": "prod.example.com",
"username": "admin",
"private_key": "/home/user/.ssh/id_rsa"
}
}{
"tool": "ssh_execute",
"params": {
"connection": "prod",
"command": "uname -a"
}
}Notes
Prefer
uvx ssh-agent-mcp@latestfor frictionless use.If domestic mirrors cache old versions, specify PyPI index explicitly.
For full CLI options and advanced usage, see the Chinese guide:
README_CN.md.
Badges & Links
Repository: https://github.com/zhijun/ssh-mcp
License
MIT License. See LICENSE.
Available Tools
27 toolsssh_auto_connectA
自动连接配置文件中标记为auto_connect的连接
Inputs: no named parameters.
ssh_cleanup_commandsC
清理已完成的异步命令
Inputs: max_age.
ssh_connectC
建立SSH连接
Inputs: host (required), username (required), port, password, +2 more.
ssh_connect_by_config_hostC
使用SSH config文件中的主机名建立连接
Inputs: config_host (required), username, password, private_key, +1 more.
ssh_connect_by_nameB
使用配置文件中的连接名称建立SSH连接
Inputs: connection_name (required).
ssh_create_remote_directoryB
在远程服务器上创建目录
Inputs: connection_id (required), remote_path (required), mode, parents.
ssh_disconnectC
断开SSH连接
Inputs: connection_id (required).
ssh_disconnect_allB
断开所有SSH连接
Inputs: no named parameters.
ssh_download_fileC
从远程服务器下载文件
Inputs: connection_id (required), remote_path (required), local_path (required).
ssh_executeB
在SSH连接上执行命令
Inputs: connection_id (required), command (required), timeout.
ssh_get_command_statusA
获取异步命令状态和最新输出
Inputs: command_id (required).
ssh_get_interactive_outputB
获取交互式会话的输出
Inputs: session_id (required), max_lines.
ssh_get_remote_file_infoB
获取远程文件或目录信息
Inputs: connection_id (required), remote_path (required).
ssh_list_async_commandsB
列出所有异步命令状态
Inputs: no named parameters.
ssh_list_configB
列出配置文件中的所有SSH连接
Inputs: filter_tag.
ssh_list_connectionsB
列出所有SSH连接
Inputs: no named parameters.
ssh_list_interactive_sessionsA
列出所有活跃的交互式会话
Inputs: no named parameters.
ssh_list_remote_directoryC
列出远程目录内容
Inputs: connection_id (required), remote_path.
ssh_remove_remote_fileB
删除远程文件或目录
Inputs: connection_id (required), remote_path (required).
ssh_rename_remote_pathB
重命名远程文件或目录
Inputs: connection_id (required), old_path (required), new_path (required).
ssh_send_inputA
向交互式会话发送输入(如密码、命令等)
Inputs: session_id (required), input_text (required).
ssh_start_async_commandB
启动长时间运行的异步命令
Inputs: connection_id (required), command (required).
ssh_start_interactiveC
启动交互式SSH会话(支持sudo、vim、mysql等需要交互输入的命令)
Inputs: connection_id (required), command (required), pty_width, pty_height.
ssh_statusB
查询SSH连接状态
Inputs: connection_id.
ssh_terminate_commandB
终止正在运行的异步命令
Inputs: command_id (required).
ssh_terminate_interactiveC
终止交互式会话
Inputs: session_id (required).
ssh_upload_fileB
上传文件到远程服务器
Inputs: connection_id (required), local_path (required), remote_path (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 27 tools
Tools are mostly distinct with clear purposes, but there is some overlap among connect variations (auto_connect, connect_by_config_host, connect_by_name) and execution types (execute, async, interactive). Descriptions help differentiate, but the large number of similar-sounding tools could cause confusion.
All tools follow the consistent pattern 'ssh_verb_noun' in snake_case, making it easy to predict tool names and understand their actions. No mixing of conventions.
27 tools is slightly above the typical well-scoped range, but each tool addresses a specific need (connection, file ops, sync/async/interactive commands). The count is justified for the breadth of SSH management tasks.
The tool surface covers the full lifecycle: connect/disconnect, file transfer, directory operations, synchronous and asynchronous commands, interactive sessions, and status management. No obvious gaps for standard SSH operations.
Related MCP Connectors
- DNS-DATA RemoteDeprecatedcom.dns-data
Connect AI assistants to authorized Windows and macOS devices for files, commands, and management.
Scoped, audited SSH exec, sessions, and SFTP on your saved servers without exposing credentials
Remote MCP access to user-authorized Linux, Windows and Intel Mac devices for AI assistants.
Connect AI assistants to explicitly paired computers, servers, and VMs for permitted remote actions.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables AI assistants to securely connect to and manage remote servers via SSH, supporting command execution, file transfers via SFTP, and multi-server management with both password and SSH key authentication.934 npm2MIT
- AlicenseBqualityDmaintenanceEnables AI models to access and manage SSH connections through a standardized interface, allowing AI assistants to perform SSH operations like connecting to servers, executing commands, and managing files.2381ISC
- AlicenseNot gradedqualityNot gradedmaintenanceEnables AI assistants to execute commands and transfer files on remote servers over SSH connections.1MIT
- AlicenseAqualityDmaintenanceEnables AI assistants to execute SSH commands and perform token-efficient file operations on remote servers via the Model Context Protocol.599 npm13MIT