🏎️ 🏠 🍎 🪟 🐧 - SSH control for Linux and Windows servers, with long-running commands and execution on multiple…
SSH MCP
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
SSH MCP is an MCP server that runs locally on your host that provides the ability to manage and interact with remote SSH hosts. It supports organizing hosts into groups and executing commands across multiple hosts simultaneously.
Tools
Host Management
- **add_host** - Adds a new Linux or Windows host to the SSH configuration with automatic OS detection. Username and password are optional in the connection string - if not provided, the current user and SSH agent will be used for authentication.
- **remove_host** - Removes a host from the SSH configuration by group and name.
- **get_groups** - Retrieves the list of all groups from the SSH configuration.
- **get_hosts** - Retrieves the list of hosts from the SSH configuration. Can optionally filter by group.
- **get_os_info** - Retrieves the cached operating system information for Linux and Windows hosts. You can specify individual hosts or an entire group.
- **update_os_info** - Updates the cached operating system information for Linux and Windows hosts. You can specify individual hosts or an entire group.
Command Execution
- **perform_command** - SSH into a remote machine and executes a command. You can specify individual hosts or an entire group. Commands that take longer than 30 seconds are automatically moved to background execution. Use background=true to run immediately in background.
Command Management
- **get_command_status** - Retrieves the status and results of a background command by its command ID. If no ID is provided, returns the most recent command.
- **list_commands** - Lists all background commands with their current status. Useful for tracking long-running commands.
- **cancel_command** - Cancels a running background command by its command ID.
Features
- **Cross-platform support** - Works with both Linux and Windows remote hosts with automatic OS detection
- **Group-based organization** - Organize hosts into groups for easier management
- **Multiple authentication methods** - Supports password, SSH agent, and SSH key files (~/.ssh/id_rsa, id_ed25519, etc.)
- **Secure host verification** - Uses ~/.ssh/known_hosts for host key verification with automatic host addition
- **Concurrent execution** - Execute commands across multiple hosts simultaneously
- **Automatic background execution** - Commands that take longer than 30 seconds are automatically moved to background, with command IDs returned for status tracking
- **Persistent storage** - Uses BadgerDB for efficient local storage
Limitations
- SSH agent support is Unix-only (SSH_AUTH_SOCK) - password and key file authentication work on all platforms
- Remote hosts can be Linux or Windows (automatic OS detection)