ssh-agent-mcp
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
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.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- 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/zhijun/ssh-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server