mcp-secure-shell
A Rust MCP (Model Context Protocol) server for SSH/SFTP remote shell execution and file transfer. This allows AI agents to execute commands on remote hosts as easily as executing local shell commands.
Power your agent
Install from the publisher. Not a PlugMCP endpoint.
Host a copy with our keys and logs.
No packaged release in the registry yet. Follow the repository README.
Remote URL or a command on your machine? How the two installs differ
Run on PlugMCP
A new server you create. It is not this listing's official endpoint. Use the publisher install when you want their URL and their credentials.
LaunchFrom the publisher
A Rust MCP (Model Context Protocol) server for SSH/SFTP remote shell execution and file transfer. This allows AI agents to execute commands on remote hosts as easily as executing local shell commands.
Rust MCP Server that provides an SSH/SCP client to connect with other servers as easily as using the local shell.
~/.ssh/config file for host configurations~/.ssh/config (optional but recommended)Subsystem sftp internal-sftp in sshd_config)cargo install --path .
Or build from source:
cargo build --release
The binary will be at target/release/mcp-secure-shell.
Add to your MCP client configuration (e.g., Claude Desktop):
{
"mcpServers": {
"ssh": {
"command": "/path/to/mcp-secure-shell",
"args": []
}
}
}
Execute a shell command on a remote host.
Parameters:
host (required): SSH host alias from ~/.ssh/config or direct hostnamecommand (required): Shell command to executecwd (optional): Working directory to run the command fromExample:
{
"host": "myserver",
"command": "ls -la /var/log",
"cwd": "/home/user"
}
Upload a local file to a remote host.
Parameters:
host (required): SSH host alias or hostnamelocal_path (required): Path to the local fileremote_path (required): Destination path on the remote hostExample:
{
"host": "myserver",
"local_path": "/tmp/myfile.txt",
"remote_path": "/home/user/myfile.txt"
}
Download a file from a remote host.
Parameters:
host (required): SSH host alias or hostnameremote_path (required): Path to the file on the remote hostlocal_path (required): Destination path on the local machineExample:
{
"host": "myserver",
"remote_path": "/var/log/app.log",
"local_path": "/tmp/app.log"
}
List all SSH hosts configured in ~/.ssh/config.
Parameters: None
Get connection details for a specific SSH host.
Parameters:
host (required): SSH host alias to get info for# ~/.ssh/config
Host myserver
HostName 192.168.1.100
User admin
Port 22
IdentityFile ~/.ssh/id_ed25519
Host devbox
HostName dev.example.com
User developer
IdentityFile ~/.ssh/id_rsa
RUST_LOG: Set logging level (e.g., RUST_LOG=mcp_secure_shell=debug)~/.ssh/known_hosts by defaultcargo build
Unit tests:
cargo test
Integration tests (requires Docker):
Start the test SSHD container:
./scripts/test-sshd.sh start
Run integration tests:
cargo test --test integration_test
Stop the container when done:
./scripts/test-sshd.sh stop
The project includes a Docker-based test environment using panubo/sshd, a minimal Alpine Linux image with OpenSSH.
Container management:
./scripts/test-sshd.sh start # Start container
./scripts/test-sshd.sh stop # Stop container
./scripts/test-sshd.sh status # Check status
./scripts/test-sshd.sh test # Test SSH connection
./scripts/test-sshd.sh logs # View logs
./scripts/test-sshd.sh shell # Open shell in container
Environment variables:
SSH_PORT: Port to expose SSHD on (default: 2222)TEST_SSH_HOST: Host for integration tests (default: localhost)TEST_SSH_PORT: Port for integration tests (default: 2222)TEST_SSH_USER: User for integration tests (default: root)Docker Compose alternative:
docker compose -f docker-compose.test.yml up -d
After starting the test container, add this to ~/.ssh/config:
Host test-container
HostName localhost
Port 2222
User root
StrictHostKeyChecking no
UserKnownHostsFile /dev/null
Then test the MCP server with the test-container host.
MIT
Rust MCP Server that provides an SSH/SCP client to connect with other servers as easily as using the local shell.
Tools
No tool list yet. Remote servers get one after the first health check.
FAQ
Copy the stdio config for Cursor, Claude Desktop, Claude Code, or VS Code on this page. It uses the publisher's install, not a PlugMCP proxy.
No required environment variable is listed on this record.
MCP Secure Shell runs locally over stdio.
Last checked 2026-10-28. Rust MCP Server that provides an SSH/SCP client to connect with other servers as easily as using the local shell.