
Dynamic SSH MCP Server - No pre-config, create multiple dynamic persisting sessions and monitor with dedicated URL using xterm.js
概览
A Model Context Protocol (MCP) server that provides SSH session management for Claude Code with browser-based terminal monitoring. - - Named SSH connections that maintain state across commands - - Full browser-based terminal with keyboard input and command execution - - Manage multiple independent SSH sessions simultaneously - - Live terminal output via WebSocket with single clean display - - Track executed commands with timestamps and exit codes - - Each session maintains separate terminal history and state - - Type commands directly in the browser terminal interface - - Immediate character display with terminal cursor movement - - Full keyboard navigation (arrows, Home, End, backspace) - - Smart locking/unlocking based on command execution status - - Commands from browser users vs Claude Code are properly tracked - - User and Claude Code commands execute through shared SSH session with queuing - - SSH keys (encrypted/unencrypted), username/password, direct key content - - FIFO...
README
以下为原文 README 节选,完整内容请查看原文。
SSH MCP Server
A Model Context Protocol (MCP) server that provides SSH session management for Claude Code with browser-based terminal monitoring.
Features
Core Functionality
- Persistent SSH Sessions - Named SSH connections that maintain state across commands
- Interactive Terminal Interface - Full browser-based terminal with keyboard input and command execution
- Multi-Session Support - Manage multiple independent SSH sessions simultaneously
- Real-time Output Streaming - Live terminal output via WebSocket with single clean display
- Command History - Track executed commands with timestamps and exit codes
- Session Isolation - Each session maintains separate terminal history and state
Interactive Terminal Capabilities
- Direct Command Input - Type commands directly in the browser terminal interface
- Local Echo - Immediate character display with terminal cursor movement
- Command Line Editing - Full keyboard navigation (arrows, Home, End, backspace)
- Terminal State Management - Smart locking/unlocking based on command execution status
- Source Attribution - Commands from browser users vs Claude Code are properly tracked
- Concurrent Execution - User and Claude Code commands execute through shared SSH session with queuing
Advanced Features
- Multiple Authentication Methods - SSH keys (encrypted/unencrypted), username/password, direct key content
- Command Queuing - FIFO execution prevents output interleaving between user and Claude Code commands
- WebSocket Communication - Bidirectional messaging for command execution and output streaming
- Session State Synchronization - Multiple browser clients stay in sync with terminal state
- Clean Terminal Display - Single output with preserved ANSI colors and formatting
Installation & Setup
Prerequisites
- Node.js 16+ and npm
- Claude Code CLI installed and configured
- SSH server access (for remote connections)
- TypeScript (for development)
1. Clone and Build
git clone ls-ssh-mcp
cd ls-ssh-mcp
npm install
npm run build
2. Register with Claude Code
# Use the installation script (recommended)
./install-mcp.sh
# Or manually register
claude mcp add ssh node /absolute/path/to/ls-ssh-mcp/dist/src/mcp-server.js
3. Verify Installation
# Check that the server was registered
claude mcp list
How it works:
- The
install-mcp.shscript registers the server with Claude Code with an auto-discovered port - Claude Code automatically starts the server when you use SSH tools
- No need to manually start/stop - the server runs on-demand
- Web monitoring interface is available at
http://localhost:{port}/session/{session-name}
The installation script handles port discovery, cleanup of existing configurations, and proper registration.
Usage
Basic Workflow
- Connect to SSH server: Use
ssh_connectwith your credentials
安装
This server does not publish a one-line install command.
Open the repository installation guide 新手?先看 mcpskill.org 教程 →