Skip to main content

MCP server for managing SSH connections and executing remote commands

Project description

RemoteShell MCP

RemoteShell is a Model Context Protocol (MCP) server that lets an LLM:

  • Save SSH server profiles once (so the user doesn’t retype credentials)
  • Execute non-interactive shell commands remotely
  • Upload/download files via SFTP

This server is built with FastMCP and Paramiko.

Installation / Client setup (recommended)

Add this to your MCP client config:

{
  "mcpServers": {
    "remoteshell": {
      "command": "uvx",
      "args": ["remoteshell-mcp"]
    }
  }
}

Persistent storage

RemoteShell persists servers to:

  • ~/.config/remoteshell/hosts.json

The LLM is expected to manage this file by calling save_server / remove_server. You can also edit it manually.

Example hosts.json:

{
  "version": 1,
  "servers": {
    "srv1": {
      "host": "1.2.3.4",
      "user": "root",
      "port": 22,
      "auth_type": "password",
      "password": "your_password_here",
      "last_connected": null
    },
    "srv2": {
      "host": "example.com",
      "user": "ubuntu",
      "port": 22,
      "auth_type": "private_key",
      "private_key": "~/.ssh/id_rsa",
      "last_connected": "2025-01-01T00:00:00+00:00"
    }
  }
}

On POSIX systems you should protect the file:

chmod 600 ~/.config/remoteshell/hosts.json

Tools

RemoteShell exposes exactly these tools:

list_servers()

  • Purpose: List saved servers, including cached online status and last_connected.
  • When to use: When the user says “connect server”, “show machines”, or did not specify a connection_id.
  • Example: “Show me which servers I have.”

save_server(connection_id, host, user, auth_type, credential)

  • Purpose: Create/update a saved server profile.
  • auth_type: password or private_key
  • credential:
    • For password: the password string
    • For private_key: either a private key path (e.g. ~/.ssh/id_rsa) or PEM key text
  • When to use: New server info, or after auth_failed to update credentials.

remove_server(connection_id)

  • Purpose: Permanently delete a saved server profile.
  • When to use: Only when the user explicitly asks to remove/forget a server.

execute_command(connection_id, command)

  • Purpose: Execute a non-interactive command remotely and return stdout, stderr, exit_code.
  • When NOT to use: Interactive programs (vim/htop/top) or commands requiring manual [Y/n] prompts (unless you add flags like -y).
  • Example: execute_command(connection_id="srv1", command="df -h")

upload_file(connection_id, local_path, remote_path)

  • Purpose: Upload a local file (local to the machine running this MCP server) to the remote.
  • Note: If remote_path is a directory, the local filename is preserved.
  • Auto local_path: If local_path is omitted, the server picks a default path and returns it in the response/error.

download_file(connection_id, remote_path, local_path)

  • Purpose: Download a remote file to a local path (local to the machine running this MCP server).
  • Auto local_path: If local_path is omitted, the server defaults to ~/.config/remoteshell/downloads/<connection_id>/<basename>.

Claude Code shortcut (local dev)

If you want to run the server from a local checkout:

{
  "mcpServers": {
    "remoteshell": {
      "command": "uv",
      "args": ["--directory", "/absolute/path/to/remoteShell-mcp", "run", "remoteshell-mcp"]
    }
  }
}

Development

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

remoteshell_mcp-1.0.0.tar.gz (92.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

remoteshell_mcp-1.0.0-py3-none-any.whl (15.5 kB view details)

Uploaded Python 3

File details

Details for the file remoteshell_mcp-1.0.0.tar.gz.

File metadata

  • Download URL: remoteshell_mcp-1.0.0.tar.gz
  • Upload date:
  • Size: 92.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for remoteshell_mcp-1.0.0.tar.gz
Algorithm Hash digest
SHA256 b72e19c0e1ad2852cb7b423d384f4d16a94b9d306a61d8d8d29040ff65b3d09e
MD5 cfa46ad9d0020815fb19fa752a953f8d
BLAKE2b-256 2c064f9cc80203d452b91a2dadadd5f47063ca18dd0dbbffc9106f81527b89e6

See more details on using hashes here.

Provenance

The following attestation bundles were made for remoteshell_mcp-1.0.0.tar.gz:

Publisher: publish.yml on chouzz/remoteShell-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file remoteshell_mcp-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for remoteshell_mcp-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 632434749a521320a78555b985819f5489122f3f673056716c1778e38f9aafee
MD5 a8f2893c5dfa8c724129bdada0d5f057
BLAKE2b-256 0fc745036605db9a009363f4ac780a3716ddb787b3050565d628ce4029d37ef0

See more details on using hashes here.

Provenance

The following attestation bundles were made for remoteshell_mcp-1.0.0-py3-none-any.whl:

Publisher: publish.yml on chouzz/remoteShell-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page