MCP server for managing SSH connections and executing remote commands
Project description
🔗 RemoteShell MCP
A Model Context Protocol (MCP) server that enables LLMs to securely manage and execute commands on remote SSH servers.
✨ Features
- 🔐 Secure credential management - Save SSH server profiles once, no need to retype credentials
- 💻 Remote command execution - Execute non-interactive shell commands remotely
- 📁 File operations - Upload/download files via SFTP
- 🤖 LLM-powered - Built with FastMCP and Paramiko
🚀 Installation
For Claude Code users
claude mcp add remoteshell --scope user -- uvx remoteshell-mcp
For other MCP clients
Add this to your MCP client configuration:
{
"mcpServers": {
"remoteshell": {
"command": "uvx",
"args": ["remoteshell-mcp"]
}
}
}
📖 Usage
Getting started is easy! You can either:
- 🤖 Let the LLM configure for you - Simply tell the LLM your host, username, password, etc., and ask it to set up the server configuration
- ⚙️ Manual configuration - Directly edit the configuration file at
~/.config/remoteshell/hosts.json
💾 Configuration & Storage
RemoteShell securely stores your server configurations in:
~/.config/remoteshell/hosts.json
🔧 Configuration Management
- LLM-managed: The LLM automatically manages this file using
save_serverandremove_servertools - Manual editing: You can also directly edit the JSON file for advanced configurations
📋 Example Configuration
{
"version": 1,
"servers": {
"production-server": {
"host": "1.2.3.4",
"user": "root",
"port": 22,
"auth_type": "password",
"password": "your_secure_password",
"last_connected": null
},
"staging-server": {
"host": "staging.example.com",
"user": "ubuntu",
"port": 22,
"auth_type": "private_key",
"private_key": "~/.ssh/id_rsa",
"last_connected": "2025-01-01T00:00:00+00:00"
}
}
}
🔒 Security Note
On POSIX systems, protect your configuration file:
chmod 600 ~/.config/remoteshell/hosts.json
🛠️ Available Tools
RemoteShell provides the following MCP tools for remote server management:
📋 list_servers()
Purpose: Display all saved server profiles with their connection status and last activity.
When to use:
- User asks to "connect to server" or "show machines"
- No specific
connection_idis provided - Need to see available servers
Example: "Show me which servers I have configured" → Returns list of all saved servers with online status
💾 save_server(connection_id, host, user, auth_type, credential, port)
Purpose: Create or update a server profile with authentication credentials.
Parameters:
connection_id: Unique identifier for the server (e.g., "production", "staging")host: Server hostname or IP addressuser: SSH usernameauth_type:"password"or"private_key"credential:- For
password: Plain text password string - For
private_key: File path (e.g.,~/.ssh/id_rsa) or PEM key content
- For
port: SSH port (optional; defaults to 22 and keeps the existing saved port if omitted)
When to use:
- Adding a new server configuration
- Updating credentials after authentication failure
- Changing server connection details
🗑️ remove_server(connection_id)
Purpose: Permanently delete a server profile from storage.
When to use:
- User explicitly requests to remove or forget a server
- Server is no longer accessible or needed
⚠️ Warning: This action cannot be undone
⚡ execute_command(connection_id, command)
Purpose: Execute non-interactive shell commands remotely and return results.
Returns: stdout, stderr, and exit_code
When to use:
- Running system commands, scripts, or utilities
- Checking server status, disk usage, process lists
- File operations, package management, etc.
When NOT to use:
- Interactive programs (vim, htop, top)
- Commands requiring manual input (
[Y/n]prompts) - unless using flags like-y
Example: execute_command(connection_id="production", command="df -h")
📤 upload_file(connection_id, local_path, remote_path)
Purpose: Upload files from your local machine to a remote server via SFTP.
Parameters:
local_path: Path to the file on your local machineremote_path: Destination path on the remote server
Notes:
- If
remote_pathis a directory, the original filename is preserved - If
local_pathis omitted, server selects a default and returns it in response
📥 download_file(connection_id, remote_path, local_path)
Purpose: Download files from a remote server to your local machine via SFTP.
Parameters:
remote_path: Path to the file on the remote serverlocal_path: Destination path on your local machine
Notes:
- If
local_pathis omitted, defaults to:~/.config/remoteshell/downloads/<connection_id>/<basename>
🧪 Development
Local Development Setup
For local development, use this MCP configuration:
{
"mcpServers": {
"remoteshell": {
"command": "uv",
"args": ["--directory", "/absolute/path/to/remoteShell-mcp", "run", "remoteshell-mcp"]
}
}
}
Running Tests
uv run pytest
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file remoteshell_mcp-1.1.1.tar.gz.
File metadata
- Download URL: remoteshell_mcp-1.1.1.tar.gz
- Upload date:
- Size: 91.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1d9909059af8b6146e9e323906cc189d3bd42be4d77f9296180d42800f9db6ab
|
|
| MD5 |
347effec0517274b8b7ef85cb3f12f01
|
|
| BLAKE2b-256 |
939001989f3b097382de24e52c5b5d6583017e0471dd5b001d575ceebf5734e6
|
Provenance
The following attestation bundles were made for remoteshell_mcp-1.1.1.tar.gz:
Publisher:
publish.yml on chouzz/remoteShell-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
remoteshell_mcp-1.1.1.tar.gz -
Subject digest:
1d9909059af8b6146e9e323906cc189d3bd42be4d77f9296180d42800f9db6ab - Sigstore transparency entry: 779536155
- Sigstore integration time:
-
Permalink:
chouzz/remoteShell-mcp@db04ed4414aecee38b56dbb3c73a15eedc02e6e7 -
Branch / Tag:
refs/tags/v1.1.1 - Owner: https://github.com/chouzz
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@db04ed4414aecee38b56dbb3c73a15eedc02e6e7 -
Trigger Event:
release
-
Statement type:
File details
Details for the file remoteshell_mcp-1.1.1-py3-none-any.whl.
File metadata
- Download URL: remoteshell_mcp-1.1.1-py3-none-any.whl
- Upload date:
- Size: 16.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
78123c2212df43b8b3de56ee80cb9abb471c823f680855a6137c2ecd668e7acf
|
|
| MD5 |
130cb750deefc622e9ca08e50f23d6e9
|
|
| BLAKE2b-256 |
e5561800197c40c5ce563bb086b7f42aa0aecb39ec78f4e645ce49db4aec2e3d
|
Provenance
The following attestation bundles were made for remoteshell_mcp-1.1.1-py3-none-any.whl:
Publisher:
publish.yml on chouzz/remoteShell-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
remoteshell_mcp-1.1.1-py3-none-any.whl -
Subject digest:
78123c2212df43b8b3de56ee80cb9abb471c823f680855a6137c2ecd668e7acf - Sigstore transparency entry: 779536156
- Sigstore integration time:
-
Permalink:
chouzz/remoteShell-mcp@db04ed4414aecee38b56dbb3c73a15eedc02e6e7 -
Branch / Tag:
refs/tags/v1.1.1 - Owner: https://github.com/chouzz
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@db04ed4414aecee38b56dbb3c73a15eedc02e6e7 -
Trigger Event:
release
-
Statement type: