{
  "markdown": "# SSH Real MCP Server\n\nA Model Context Protocol (MCP) server that enables SSH remote command execution by delegating entirely to the **system `ssh` binary**. This means `ssh-agent`, `ProxyCommand`, `~/.ssh/config`, jump hosts, and every other OS-level SSH feature work out of the box — no Node.js crypto, no native addons.\n\n## How it works\n\nInstead of implementing the SSH protocol in Node.js, this server spawns `ssh` as a child process and pipes the output back to the MCP client. Authentication, key discovery, and connection routing are handled by your OS, exactly as if you ran `ssh` yourself in a terminal.\n\n**Requirements:** `ssh` must be installed and available in `PATH` (standard on macOS and Linux).\n\n## Features\n\n- **Zero auth config** — uses your existing `ssh-agent`, `~/.ssh/config`, and key files automatically\n- **ProxyCommand / jump hosts** — works natively, no special parameters needed\n- **Connectivity test** — `ssh_test` tool to verify reachability before running commands\n- **Argument injection protection** — host and username are validated before being passed to `ssh`\n- **Configurable timeout** — commands are killed and an error is returned if they exceed the timeout\n- Detailed results: stdout, stderr, and exit code\n\n## Installation\n\n### From npm\n\n```bash\nnpm install -g @danielecr/realssh-mcp\n```\n\n### From source\n\n```bash\ngit clone https://github.com/danielecr/realssh-mcp.git\ncd realssh-mcp\nnpm install\nnpm run build\n```\n\n## VS Code / Copilot configuration\n\nAfter installing the package globally, add the server to your MCP configuration. In VS Code, open the MCP config file via **Command Palette → MCP: Open User Configuration** and add:\n\n```json\n{\n  \"servers\": {\n    \"realssh\": {\n      \"type\": \"stdio\",\n      \"command\": \"realssh-mcp\"\n    }\n  }\n}\n```\n\nThen run **MCP: List Servers** to verify the server is active.\n\n## Tools\n\n### `ssh_execute`\n\nExecute a command on a remote server via SSH.\n\n**Parameters:**\n- `host` (string, **required**): SSH server hostname or IP address\n- `command` (string, **required**): Command to execute on the remote server\n- `username` (string, optional): SSH username. Defaults to the current OS user\n- `port` (number, optional): SSH server port (default: 22)\n- `timeout` (number, optional): Command timeout in milliseconds (default: 30000)\n- `agentForward` (boolean, optional): Enable SSH agent forwarding `-A` (default: false)\n- `extraArgs` (string[], optional): Extra SSH arguments (e.g., `[\"-o\", \"StrictHostKeyChecking=no\"]`)\n\n**Example:**\n```json\n{\n  \"host\": \"prod-web-01\",\n  \"command\": \"df -h\"\n}\n```\n\n```json\n{\n  \"host\": \"192.168.1.100\",\n  \"username\": \"deploy\",\n  \"command\": \"systemctl status nginx\"\n}\n```\n\n### `ssh_test`\n\nTest SSH connectivity to a remote host (runs `echo ok` and checks the response).\n\n**Parameters:**\n- `host` (string, **required**): SSH server hostname or IP address\n- `username` (string, optional): SSH username\n- `port` (number, optional): SSH server port (default: 22)\n- `extraArgs` (string[], optional): Extra SSH arguments\n\n## Host configuration\n\nHosts, aliases, jump hosts, and identity files are configured in `~/.ssh/config` — not in the MCP server. This is intentional: the OS `ssh` binary reads that file natively.\n\nExample `~/.ssh/config`:\n```sshconfig\nHost prod\n    HostName prod.example.com\n    User deploy\n    ProxyJump bastion\n\nHost bastion\n    HostName bastion.example.com\n    User admin\n    IdentityFile ~/.ssh/bastion_ed25519\n```\n\nWith the above config, `\"host\": \"prod\"` works with no extra parameters.\n\n## Security considerations\n\n- Commands are executed on remote systems with the privileges of the SSH user — ensure proper access controls on the remote side.\n- `BatchMode=yes` is set by default, preventing the `ssh` process from hanging on interactive prompts.\n- Host and username inputs are validated to prevent SSH option injection.\n- Command output may contain sensitive data; treat it accordingly.\n\n## License\n\nMIT\n\n",
  "bytes": 3932,
  "sha": "58c1bb1e4a7bf1fd2730f43f603b502ba96d25e16d2ac22b6c50c2cb9581758b",
  "repo_slug": "danielecr/realssh-mcp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_danielecr_realssh_mcp_b62dd939/readme"
}