ssh-ops
中文
SSH operations through a CLI or MCP server, using YAML server configurations and reusable command aliases.
What it provides
- Commands, scripts, SFTP transfers, and remote text editing through the same Python core.
- A CLI for terminal use and agents; an MCP server with stdio and HTTP transports.
- YAML aliases exposed as callable MCP tools.
- Remote background jobs for long operations, and byte-paged reads for logs.
- Host-key checks, command filters, path allow-lists, and sudo support with explicit limitations documented in the reference.
The shell setting selects helper-command templates for bash, cmd, or powershell. It does not translate arbitrary commands between shells. Connections are reused within a process, not shared between separate CLI and MCP processes.
Quick start
git clone https://github.com/leehom0123/ssh-ops.git
cd ssh-ops
python -m pip install -r requirements.txt
python cli.py list-servers
Add a server using the configuration reference, then run:
python cli.py my-server run "uptime"
For an agent, follow the installation guide to load the CLI skill or register MCP. No server is contacted by list-servers.
Typical uses
- Investigate an incident: list servers and aliases, collect service logs and system metrics, then inspect the evidence. The tool runs commands; it does not diagnose a cause automatically.
- Update a configuration: read the current text, write the reviewed change, and run the application's own validation command before restarting it.
- Run a long build or migration: start a background job and poll its status instead of holding one MCP request open.
- Deploy a release: use the scripted deployment workflow, with a project-specific restart command and health check.
Documentation
| Document | Purpose |
|---|---|
| CLI skill | Agent workflow and command quick reference |
| SKILL.mcp.md | MCP registration, 22 static tools, and dynamic alias tools |
| CLI reference | Exact CLI syntax, options, defaults, and output |
| Runtime reference | YAML fields, security, transfer/job semantics, and HTTP protocol |
| Installation | Agent installation and verification |
| Deployment | Workflow, template contract, mirrors, and troubleshooting |
Implementation: CLI, MCP server, and the domain modules under ssh_client/. Python imports retain the historical ssh_client name.