Remote Session MCP Server
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Remote Session MCP Server
A Model Context Protocol (MCP) server that enables AI assistants to manage persistent SSH sessions and execute commands on remote servers.
Key Advantages
Persistent Sessions with State
Unlike SSH tools that execute single commands in isolation, this server uses invoke_shell() to maintain interactive shell sessions where state persists across multiple commands:
Capability | Persistent Sessions | Single-Command |
Working directory ( | Persists | Lost after each command |
Environment variables ( | Persists | Lost after each command |
Multi-step workflows | Natural flow | Requires manual context passing |
AI context awareness | Tracks | No state tracking |
Typical workflow:
create → execute("cd /app") → execute("export ENV=prod") → execute("./deploy.sh") → closeThis is ideal for AI-driven deployment, debugging, and server management tasks where commands build on each other.
Automatic SSH Config Integration
Parses
~/.ssh/configautomatically for connection parametersSupports key-based authentication, custom ports, jump hosts, and all standard SSH options
No need to hardcode credentials or connection details
Related MCP server: MCP SSH Server
Installation
# Using uv (recommended)
uv pip install -e .
# Or using pip
pip install -e .Usage
1. Configure SSH
Ensure your servers are configured in ~/.ssh/config:
Host production
HostName 192.168.1.100
User deploy
IdentityFile ~/.ssh/id_rsa2. Run the MCP Server
remote-session-mcp
# Or: python -m remote_session_mcp3. Claude Code Integration
Create .claude/settings.json or mcp.json in your project:
{
"mcpServers": {
"remote-session": {
"command": "uv",
"args": ["run", "remote-session-mcp"],
"cwd": "/path/to/sshmcp"
}
}
}4. Available Tools
Tool | Description |
| List all hosts from |
| Create a persistent SSH session |
| Execute a command (state persists) |
| Close a session |
| List active sessions |
| Upload a file to remote server |
| Download a file from remote server |
Example: Deploy an Application
// 1. Create session
{"tool": "create", "arguments": {"host": "production"}}
// 2. Navigate and deploy (state persists)
{"tool": "execute", "arguments": {"session_id": "session_abc", "command": "cd /var/www/myapp"}}
{"tool": "execute", "arguments": {"session_id": "session_abc", "command": "git pull"}}
{"tool": "execute", "arguments": {"session_id": "session_abc", "command": "npm install"}}
{"tool": "execute", "arguments": {"session_id": "session_abc", "command": "sudo systemctl restart myapp"}}
// 3. Close session
{"tool": "close", "arguments": {"session_id": "session_abc"}}Configuration (Optional)
Create ~/.remote-session/config.json for custom settings:
{
"enable_raw_output": false,
"ssh_config_path": "~/.ssh/config"
}Option | Default | Description |
| false | Return raw output with only ANSI codes removed |
| ~/.ssh/config | Custom path to SSH config file |
Limitations
Linux/POSIX Only - Assumes POSIX-compatible shells and commands (
pwd,echo $?)Interactive Shell Required - Remote server must support interactive shell sessions
Session Timeout - Sessions auto-close after 1 hour of inactivity (configurable)
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
- DNS-DATA RemoteDeprecatedcom.dns-data
Connect AI assistants to authorized Windows and macOS devices for files, commands, and management.
Use your own Windows, Mac or Linux computer from ChatGPT, Claude, Cursor or Gemini CLI: run commands, read, write and search files, run long processes. Your computer only makes an outgoing connection (no open ports or VPN). Read-only mode, allowed folders, blocked commands and an action log keep you in control. Free plan available.
Use your Mac, Windows or Linux computer from ChatGPT, Claude or Codex: files, commands, documents.
Operate Linux, macOS and Windows from your LLM. Every action runs through an auditable allowlist.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to maintain persistent SSH terminal sessions and transfer files to/from remote servers. Allows stateful command execution, natural language server management, and seamless file operations through SSH connections.7 npm35MIT
- AlicenseNot gradedqualityNot gradedmaintenanceEnables AI assistants to execute commands and transfer files on remote servers over SSH connections.1MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to securely execute commands, transfer files, and manage port forwarding on remote servers via SSH.114 npm38Apache 2.0
- AlicenseAqualityCmaintenanceEnables AI agents to establish and manage persistent SSH sessions, supporting smart command execution, async tasks, multi-host, sudo, and file operations through SFTP.15MIT