ssh-alias-mcp
Allows running Docker commands like docker ps to list containers, and managing Docker environments on remote servers via SSH with optional sudo.
Enables AI agents to SSH into Linux servers and execute commands, run scripts, and manage services via a unified connection pool and YAML configuration.
Enables tailing Nginx error logs and managing Nginx service on remote servers through predefined aliases and script execution.
Supports Ubuntu servers with system and package management commands such as systemctl and apt, including sudo execution and health checks.
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-alias-mcpRun healthcheck on prod-web-01"
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-alias-mcp β Let Your AI Agent Manage Linux Servers
GitHub: https://github.com/leehom0123/ssh-alias-mcp
π Full Technical Docs (DOCS.md) β architecture, all config fields, MCP tools reference, script examples
What Is This?
A ~2,000-line Python tool that lets AI agents (Claude Code, Codex CLI, Cursor, Windsurf) SSH into your Linux servers, run commands, deploy code, tail logs, restart services. It also doubles as a nice CLI for day-to-day manual use.
One set of YAML config, one connection pool, works for both AI and humans.
Related MCP server: SSH MCP Server
Why I Built This
I run a handful of VPS instances for different projects. Daily ops are predictable: check if logs have errors, deploy new code, restart a container, see if disk is full again.
Every time: open terminal β SSH in β type commands β exit. Not painful, but definitely not fun.
When Claude Code added MCP (Model Context Protocol) support, letting AI call external tools, I thought: what if I just define my routine server tasks as skills and let AI handle them?
So I spent a day building this with paramiko. It worked way better than expected. Now I tell my AI agent "restart all three web servers," and it just does it.
Open-sourcing in case anyone else managing a few servers finds it useful.
Get Started
π₯ Installation: read AI_INSTALL.md β set up MCP and add SKILL.md as described.
Tool | Description |
| List all configured servers |
| Execute a command on a remote server |
| Execute as root (requires |
| Upload a script, optionally run immediately |
| Run an uploaded script |
| Run an alias-defined command |
| One-click alias, one MCP tool per alias |
β οΈ Don't inline
sudo -Sβ usessh_run_sudo. For docker permission issues, setsudo: truein the alias.
β¨οΈ CLI Mode
python cli.py list-servers # See all servers
python cli.py my-server run "uptime" # Run a command
python cli.py my-server sudo "apt update" # Run as root
python cli.py my-server alias healthcheck # Run an alias
python cli.py my-server upload script.sh -r # Upload & run immediatelyπ― Key Highlights
1. YAML Config Reuse + extends Inheritance
One server = one YAML file. Structure it like this:
servers/
βββ _shared/common.yml # Shared aliases, inherited by all servers
βββ prod-web-01.yml # Production server
βββ prod-web-02.yml # Another production server
βββ staging.yml # StagingDefine common checks and commands once in _shared/common.yml β every server extends it:
# _shared/common.yml
aliases:
- name: healthcheck
inline: "df -h / && free -h && uptime"
desc: "One-click health check"
- name: docker-ps
inline: "docker ps --format 'table {{.Names}}\t{{.Status}}'"
desc: "Running containers"
- name: logs-nginx
inline: "tail -50 /var/log/nginx/error.log"
desc: "Nginx error logs"# prod-web-01.yml
extends:
- _shared/common.yml # Inherit shared aliases
server:
host: "198.51.100.10"
user: "deploy"
password: "xxx"
sudo_password: "xxx"
system: "Ubuntu 22.04 LTS"
aliases:
- name: deploy
script: deploy.sh
desc: "Deploy main site"
timeout: 600
sudo: true
- name: restart
inline: "systemctl restart my-app && echo 'restarted'"
desc: "Restart app"
sudo: true5, 10, or 20 servers β same effortless maintenance. Same aliases work for AI and CLI. You never write anything twice.
2. Aliases Become MCP Tools Automatically
Define deploy in YAML, and your AI agent gets ssh_alias:prod-web-01:deploy. One line of YAML = one AI skill. To the agent, server operations feel like local function calls.
3. One Connection Pool, Shared by AI & Humans
AI Agent βββ MCP Protocol βββ ssh_client.py βββ Remote Server
Terminal βββ CLI βββββββββββββββ ssh_client.py βββ Remote ServerSame SSH connection, same connection pool, same config. AI deploys something, then you verify with python cli.py β same logic underneath. No duplicate tools, no duplicate config.
4. Connection Pool + Proxy + Sudo
Connection pool: SSH connections auto-reused with 60s keepalive β no repeated handshakes
SOCKS5 proxy: Global or per-server, auto falls back to direct connect if proxy is down
Sudo: configure
sudo_passwordonce, run root commands without interactive prompts
Who Is This For?
π§βπ» You manage multiple VPS instances and don't want to SSH into each one manually
π₯ Small teams with no dedicated DevOps β let AI help with daily checks
π€ You want your AI agent to actually do things, not just chat
Tech Stack
Pure Python. Dependencies: paramiko + pyyaml + pysocks. Under 2,000 lines. Easy to read and hack.
pip install -r requirements.txtLicense & Feedback
MIT licensed. Use it however you want. A β means a lot to me.
Issues and PRs welcome β Chinese or English, both fine.
GitHub: https://github.com/leehom0123/ssh-alias-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.
Latest Blog Posts
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/leehom0123/ssh-alias-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server