Skip to main content
Glama

Remote Terminal

AI-Powered Remote Linux Server Management via MCP

Remote Terminal lets Claude (the AI assistant) execute commands on your remote Linux servers through a natural chat interface. Watch full output in your browser in real-time while Claude receives smart-filtered summaries optimized for token efficiency.


šŸŽÆ What Is This?

Imagine telling Claude:

"Install nginx on my server and configure it with SSL" "Run complete system diagnostics and tell me if anything looks wrong" "Find all log errors from the last hour and summarize them" "Save this batch script and run it again next week"

And Claude does it - executing commands, analyzing output, saving useful scripts, and taking action on your behalf.

That's Remote Terminal.


✨ Key Features

Core Capabilities

  • šŸ–„ļø Remote Command Execution - Run any bash command on Linux servers

  • 🌐 Multi-Server Management - Switch between multiple servers easily

  • šŸ“ File Transfer (SFTP) - Upload/download files and directories with compression

  • šŸ“œ Batch Script Execution - Run multi-command scripts 10-50x faster

  • šŸ“š Batch Script Library - Save, browse, and reuse batch scripts (NEW in 3.1)

  • šŸ’¬ Conversation Tracking - Group commands by goal with rollback support

  • šŸŽÆ Recipe System - Save successful workflows for reuse

  • šŸ—„ļø Database Integration - Full audit trail with SQLite

  • šŸŒ Interactive Web Terminal - Full-featured terminal in browser (type, paste, scroll history)

  • šŸ”„ Multi-Terminal Sync - Open multiple terminals, all perfectly synchronized

  • ✨ Bash Syntax Highlighting - VS Code-style colors in standalone UI (NEW in 3.1)

The Interactive Web Terminal

Remote Terminal provides a fully interactive terminal window in your browser at http://localhost:8080 - it looks and feels just like WSL, PuTTY, or any standard terminal:

You can:

  • Type commands directly (just like any terminal)

  • Copy/paste text (Ctrl+C, Ctrl+V)

  • Scroll through command history

  • Use arrow keys for history navigation

  • View real-time command output with colors preserved

Claude can:

  • Execute commands that appear in your terminal

  • See command results instantly

  • Continue working while you watch

The key advantage: You maintain complete visibility and control. Every command Claude runs appears in your terminal window in real-time. You're never in the dark about what's happening on your server - it's like sitting side-by-side with an assistant who types commands for you while you watch the screen.

Multi-Terminal Support: Open multiple browser windows at http://localhost:8080 - they all stay perfectly synchronized via WebSocket broadcast. Type in one terminal, see it in all terminals instantly. Perfect for multi-monitor setups or sharing your view with others.

āš ļø Best Practice: Close unused terminal tabs when done. While the system handles multiple connections efficiently, keeping many old tabs open can consume unnecessary resources and may cause connection issues.

šŸŽ¬ See It In Action

https://github.com/user-attachments/assets/98a6fa41-ec4f-410b-8d4a-a2422d8ac7c9

Watch the interactive web terminal in action - see Claude execute commands while you maintain full visibility and control

The Dual-Stream Architecture

Behind the scenes, Remote Terminal uses a smart two-stream approach:

SSH Output from Remote Server ↓ [Raw Output] ↓ ā”Œā”€ā”€ā”€ā”€ā”“ā”€ā”€ā”€ā”€ā” │ │ ↓ ↓ [FULL] [FILTERED] │ │ ↓ ↓ Web Terminal Claude (You see all) (Smart summary)

Result:

  • You: Full visibility and control in interactive terminal

  • Claude: Efficient work with 95% token savings

  • Both: Shared SSH session, synchronized state

  • Best of both worlds!

šŸš€ Quick Start

Installation

Step 1: Create Installation Directory

# Choose a location for your installation (example: C:\RemoteTerminal) mkdir C:\RemoteTerminal cd C:\RemoteTerminal

Step 2: Install Package

# Create dedicated virtual environment python -m venv remote-terminal-env remote-terminal-env\Scripts\activate pip install remote-terminal-mcp

Step 3: Configure Claude Desktop

Edit %APPDATA%\Claude\claude_desktop_config.json:

{ "mcpServers": { "remote-terminal": { "command": "C:\\RemoteTerminal\\remote-terminal-env\\Scripts\\remote-terminal-mcp.exe", "env": { "REMOTE_TERMINAL_ROOT": "C:\\RemoteTerminal" } } } }

Important: Replace C:\RemoteTerminal with your actual installation path from Step 1.

Step 4: First Run - Auto Setup

Restart Claude Desktop. On first use, configuration files will automatically copy to C:\RemoteTerminal:

  • config.yaml - Default settings (auto-created from package defaults)

  • hosts.yaml - Server list (auto-created from template)

Step 5: Configure Your Servers

You have two options to configure your servers:

Option A: Manual Configuration (Recommended for first server)

Edit C:\RemoteTerminal\hosts.yaml:

servers: - name: My Server host: 192.168.1.100 user: username password: your_password port: 22 description: My development server tags: - development # Optional: Set default server for auto-connect # Use list_servers to see which server is marked as [DEFAULT] default_server: My Server

Option B: AI-Assisted Configuration

Ask Claude to help you add a new server:

Claude, add a new server to my configuration: - Name: Production Server - Host: 192.168.1.100 - User: admin - Password: mypassword - Port: 22

Claude will use the add_server tool to update your hosts.yaml file automatically.

Restart Claude Desktop and test:

List my configured servers

Step 6: (Optional) Run Standalone Web Interface

cd C:\RemoteTerminal remote-terminal-env\Scripts\activate remote-terminal-standalone

Access at:


šŸ“– Documentation

Complete guides for every use case:


šŸ’” Usage Examples

System Administration

"Check disk space and memory usage" "What processes are using the most CPU?" "Is nginx running? If not, start it" "Show me the last 50 lines of the system log"

Software Management

"Install htop and verify it works" "Update all packages" "Check if docker is installed and what version"

Troubleshooting

"Run complete network diagnostics" "Find all errors in the last hour of logs" "Check why nginx won't start" "Analyze disk usage by directory"

File Operations

"Upload my local config.json to /etc/app/" "Download all log files from /var/log/myapp/" "List files in /var/log modified today" "Find all files larger than 100MB"

Automation & Script Management

"Create a recipe from our successful nginx installation" "Execute the network diagnostics recipe" "Start a conversation to configure WiFi" "List my saved batch scripts" "Execute script 5" "Load script 3 for editing"

šŸŽØ Example Session

You:

Install nginx on my production server

Claude:

I'll install nginx. This will create a package installation...

Interactive terminal opens automatically at

Web Terminal shows (real-time):

$ sudo apt install nginx Reading package lists... Done Building dependency tree... Done [... 500+ lines of installation output ...] Setting up nginx (1.18.0-0ubuntu1) ... Created symlink /etc/systemd/system/multi-user.target.wants/nginx.service Processing triggers for systemd (245.4-4ubuntu3.23) ...

Claude receives (filtered summary):

nginx installed successfully in 45s 12 packages installed Service: nginx.service is active

Claude responds:

nginx has been successfully installed and is now running. The service is active. Would you like me to configure it or show you the default page?

Token savings: 96% (15,000 tokens → 600 tokens)


šŸ—ļø Architecture

Project Structure

remote_terminal/ ā”œā”€ā”€ config/ # Default configuration templates │ ā”œā”€ā”€ config.yaml # Default settings (packaged) │ └── hosts.yaml.example # Server template (packaged) ā”œā”€ā”€ data/ # SQLite database (user directory) │ └── remote_terminal.db # Command history, conversations, recipes, scripts ā”œā”€ā”€ docs/ # Documentation │ ā”œā”€ā”€ DATABASE_SCHEMA.md │ ā”œā”€ā”€ FEATURE_REFERENCE.md │ ā”œā”€ā”€ INDEX.md │ ā”œā”€ā”€ INSTALLATION.md │ ā”œā”€ā”€ QUICK_START.md │ ā”œā”€ā”€ RELEASE_NOTES_v3.1.md │ ā”œā”€ā”€ TROUBLESHOOTING.md │ ā”œā”€ā”€ USER_GUIDE.md │ └── WEBSOCKET_BROADCAST.md ā”œā”€ā”€ recipes/ # Example automation recipes ā”œā”€ā”€ src/ # Source code (modular architecture) │ ā”œā”€ā”€ batch/ # Batch execution system │ │ ā”œā”€ā”€ batch_executor.py │ │ ā”œā”€ā”€ batch_helpers.py │ │ └── batch_parser.py │ ā”œā”€ā”€ config/ # Configuration management │ │ ā”œā”€ā”€ config.py │ │ ā”œā”€ā”€ config_dataclasses.py │ │ ā”œā”€ā”€ config_init.py │ │ └── config_loader.py │ ā”œā”€ā”€ database/ # Database operations (SQLite) │ │ ā”œā”€ā”€ database_manager.py # Core database manager │ │ ā”œā”€ā”€ database_batch.py # Batch script storage │ │ ā”œā”€ā”€ database_batch_execution.py │ │ ā”œā”€ā”€ database_batch_queries.py │ │ ā”œā”€ā”€ database_batch_scripts.py │ │ ā”œā”€ā”€ database_commands.py # Command history │ │ ā”œā”€ā”€ database_conversations.py │ │ ā”œā”€ā”€ database_recipes.py # Recipe storage │ │ └── database_servers.py # Machine identity tracking │ ā”œā”€ā”€ output/ # Output filtering & formatting │ │ ā”œā”€ā”€ output_buffer.py │ │ ā”œā”€ā”€ output_buffer_base.py │ │ ā”œā”€ā”€ output_buffer_filtered.py │ │ ā”œā”€ā”€ output_filter.py # Smart filtering (95% token savings) │ │ ā”œā”€ā”€ output_filter_commands.py │ │ ā”œā”€ā”€ output_filter_decision.py │ │ └── output_formatter.py │ ā”œā”€ā”€ prompt/ # Command completion detection │ │ ā”œā”€ā”€ prompt_detector.py │ │ ā”œā”€ā”€ prompt_detector_checks.py │ │ ā”œā”€ā”€ prompt_detector_pager.py │ │ └── prompt_detector_patterns.py │ ā”œā”€ā”€ ssh/ # SSH/SFTP operations │ │ ā”œā”€ā”€ ssh_manager.py # High-level SSH manager │ │ ā”œā”€ā”€ ssh_connection.py # Connection lifecycle │ │ ā”œā”€ā”€ ssh_commands.py # Command execution │ │ └── ssh_io.py # Input/output streaming │ ā”œā”€ā”€ state/ # Shared state management │ │ ā”œā”€ā”€ shared_state_conversation.py │ │ ā”œā”€ā”€ shared_state_monitor.py │ │ └── shared_state_transfer.py │ ā”œā”€ā”€ static/ # Web terminal static assets │ │ ā”œā”€ā”€ fragments/ # HTML fragments │ │ ā”œā”€ā”€ vendor/ # xterm.js library │ │ ā”œā”€ā”€ terminal.css │ │ ā”œā”€ā”€ terminal.js │ │ └── transfer-panel.js │ ā”œā”€ā”€ tools/ # MCP tool modules (modular) │ │ ā”œā”€ā”€ decorators.py # Tool decorators │ │ ā”œā”€ā”€ tools_hosts.py # Server management (main) │ │ ā”œā”€ā”€ tools_hosts_crud.py # Add/remove/update servers │ │ ā”œā”€ā”€ tools_hosts_select.py # Server selection & connection │ │ ā”œā”€ā”€ tools_commands.py # Command execution (main) │ │ ā”œā”€ā”€ tools_commands_database.py │ │ ā”œā”€ā”€ tools_commands_execution.py │ │ ā”œā”€ā”€ tools_commands_status.py │ │ ā”œā”€ā”€ tools_commands_system.py │ │ ā”œā”€ā”€ tools_conversations.py # Conversation tracking (main) │ │ ā”œā”€ā”€ tools_conversations_lifecycle.py │ │ ā”œā”€ā”€ tools_conversations_query.py │ │ ā”œā”€ā”€ tools_batch.py # Batch script execution (main) │ │ ā”œā”€ā”€ tools_batch_execution.py │ │ ā”œā”€ā”€ tools_batch_helpers.py │ │ ā”œā”€ā”€ tools_batch_management.py │ │ ā”œā”€ā”€ tools_recipes.py # Recipe automation (main) │ │ ā”œā”€ā”€ tools_recipes_create.py │ │ ā”œā”€ā”€ tools_recipes_crud.py │ │ ā”œā”€ā”€ tools_recipes_execution.py │ │ ā”œā”€ā”€ tools_recipes_helpers.py │ │ ā”œā”€ā”€ tools_recipes_modify.py │ │ ā”œā”€ā”€ tools_recipes_query.py │ │ ā”œā”€ā”€ tools_sftp.py # File transfer (main) │ │ ā”œā”€ā”€ tools_sftp_single.py # Single file transfer │ │ ā”œā”€ā”€ tools_sftp_directory.py # Directory transfer │ │ ā”œā”€ā”€ tools_sftp_directory_download.py │ │ ā”œā”€ā”€ tools_sftp_directory_upload.py │ │ ā”œā”€ā”€ tools_sftp_exceptions.py │ │ ā”œā”€ā”€ tools_sftp_utils.py │ │ ā”œā”€ā”€ sftp_compression.py # Compression logic │ │ ā”œā”€ā”€ sftp_compression_download.py │ │ ā”œā”€ā”€ sftp_compression_tar.py │ │ ā”œā”€ā”€ sftp_compression_upload.py │ │ ā”œā”€ā”€ sftp_decisions.py # Auto/manual compression decisions │ │ ā”œā”€ā”€ sftp_progress.py # Progress tracking │ │ ā”œā”€ā”€ sftp_transfer_compressed.py │ │ ā”œā”€ā”€ sftp_transfer_download.py │ │ ā”œā”€ā”€ sftp_transfer_scan.py │ │ ā”œā”€ā”€ sftp_transfer_standard.py │ │ ā”œā”€ā”€ sftp_transfer_upload.py │ │ └── tools_info.py # System information │ ā”œā”€ā”€ utils/ # Utility functions │ │ ā”œā”€ā”€ utils.py │ │ ā”œā”€ā”€ utils_format.py │ │ ā”œā”€ā”€ utils_machine_id.py # Hardware/OS fingerprinting │ │ ā”œā”€ā”€ utils_output.py │ │ └── utils_text.py │ ā”œā”€ā”€ web/ # Web terminal (WebSocket-enabled) │ │ ā”œā”€ā”€ web_terminal.py # Main web server │ │ ā”œā”€ā”€ web_terminal_ui.py # UI components │ │ └── web_terminal_websocket.py # Multi-terminal sync │ ā”œā”€ā”€ mcp_server.py # MCP server entry point │ ā”œā”€ā”€ shared_state.py # Global shared state │ ā”œā”€ā”€ command_state.py # Command registry & tracking │ ā”œā”€ā”€ hosts_manager.py # Multi-server configuration │ └── error_check_helper.py # Error detection └── standalone/ # Standalone web UI (no Claude) ā”œā”€ā”€ static/ │ ā”œā”€ā”€ css/ # Standalone UI styles │ │ ā”œā”€ā”€ control-forms.css │ │ ā”œā”€ā”€ control-layout.css │ │ ā”œā”€ā”€ control-response.css │ │ └── control-styles.css # Bash syntax highlighting │ ā”œā”€ā”€ js/ # Standalone UI scripts │ │ ā”œā”€ā”€ control-forms.js │ │ ā”œā”€ā”€ control-forms-fields.js │ │ ā”œā”€ā”€ control-forms-generation.js │ │ ā”œā”€ā”€ control-forms-utils.js │ │ ā”œā”€ā”€ control-main.js │ │ └── control-response.js │ └── tool-schemas/ # MCP tool schemas │ ā”œā”€ā”€ batch.json │ ā”œā”€ā”€ commands.json │ ā”œā”€ā”€ file-transfer.json │ ā”œā”€ā”€ servers.json │ └── workflows.json ā”œā”€ā”€ mcp_control.html # Control panel HTML ā”œā”€ā”€ standalone_mcp.py # Standalone server entry point ā”œā”€ā”€ standalone_mcp_endpoints.py # API endpoints └── standalone_mcp_startup.py # Initialization & connection

Technology Stack

  • Python 3.9+ - Core language

  • MCP Protocol - Claude integration

  • Paramiko - SSH/SFTP library

  • NiceGUI + WebSockets - Web terminal with multi-terminal sync

  • SQLite - Database for history/recipes/scripts

  • FastAPI - Web framework


šŸ”§ Configuration

Configuration Files Location

Configuration files are automatically copied to your working directory on first run:

For PyPI users:

  • Set REMOTE_TERMINAL_ROOT in Claude Desktop config

  • Files auto-copy to that directory on first run

  • Location: %REMOTE_TERMINAL_ROOT%\config.yaml and hosts.yaml

  • User data preserved when reinstalling/upgrading

Default template files packaged with installation:

  • config/config.yaml - Default settings template

  • config/hosts.yaml.example - Server configuration template

hosts.yaml

Define your servers:

servers: - name: production host: 192.168.1.100 user: admin password: secure_pass port: 22 description: Production server tags: production, critical - name: development host: 192.168.1.101 user: dev password: dev_pass tags: development default_server: production

šŸ›”ļø Security Considerations

Current Status

  • Passwords stored in plain text in hosts.yaml

  • Web terminal bound to localhost only (not network-exposed)

  • Full command audit trail in database

  • SSH uses standard security (password authentication)

  • User config files stored outside package (preserved on reinstall)


šŸ“Š Performance

Token Efficiency

Average token savings on verbose commands:

Command Type

Full Output

Filtered

Savings

apt install

~15,000

~600

96%

ls -la /var

~8,000

~400

95%

Log search

~12,000

~500

96%

find /

~30,000

~800

97%

Average: 95-98% token reduction on verbose commands

Speed Improvements

Batch execution vs sequential:

  • 10 commands sequential: 5 minutes (10 round-trips)

  • 10 commands batch: 30 seconds (1 round-trip)

  • Speed improvement: 10x faster!


šŸ” Advanced Features

Batch Script Library

Save batch scripts for reuse:

1. Run diagnostics → Script auto-saved with deduplication 2. Browse library → "List my batch scripts" 3. Execute saved script → "Execute script 5" 4. Edit existing → "Load script 3 for editing" 5. Track usage → times_used, last_used_at

Features:

  • Automatic deduplication via SHA256 hash

  • Usage statistics tracking

  • Edit mode for modifications

  • Search and sort capabilities

  • Two-step deletion with confirmation

Conversation Tracking

Group related commands by goal:

Start conversation: "Configure nginx with SSL" → [Execute multiple commands] → End conversation: success → Create recipe from conversation

Benefits:

  • Organized command history

  • Rollback capability

  • Context for AI

  • Recipe generation

Recipe System

Save successful workflows:

# Recipe: wifi_diagnostics 1. lspci | grep -i network 2. iwconfig 3. ip link show 4. dmesg | grep -i wifi 5. systemctl status NetworkManager

Reuse on any compatible server:

Execute wifi_diagnostics recipe on my new server

Machine Identity

Each server tracked by unique machine_id (hardware + OS fingerprint):

  • Commands tracked per physical machine

  • Recipes execute on compatible systems

  • Audit trail maintains integrity

  • Handles server IP changes


šŸ› Known Issues & Limitations

Current Limitations

  1. Designed for Windows local machine

    • Currently optimized for Windows 10/11

    • Linux/Mac support possible with modifications

  2. SSH Key Support not implemented

    • Password authentication only

    • SSH keys work with manual SSH but not integrated with MCP tools

  3. Works with only one remote server at a time

    • Can configure multiple servers

    • Can only actively work with one server per session

    • Switch between servers as needed


šŸ¤ Contributing

This is Tim's personal project. If you'd like to contribute:

  1. Test thoroughly on your setup

  2. Document any issues found

  3. Suggest improvements

  4. Share recipes and scripts you create


šŸ“œ Version History

Version 1.1.3 (Current - December 20, 2024)

Configuration System Improvements:

  • āœ… Auto-copy config files on first run

  • āœ… User data preserved outside package directory

  • āœ… REMOTE_TERMINAL_ROOT environment variable support

  • āœ… Simplified installation process

  • āœ… Config templates packaged in config/ folder

Version 3.1 (December 16, 2024)

NEW - Batch Script Management:

  • āœ… 5 new MCP tools for batch script library management

  • āœ… Automatic deduplication via SHA256 content hash

  • āœ… Usage statistics tracking (times_used, last_used_at)

  • āœ… Edit mode for modifying saved scripts

  • āœ… Two-step deletion with confirmation

  • āœ… Standalone UI with bash syntax highlighting (VS Code colors)

  • āœ… Script dropdown selectors with auto-population

Tool Renaming (for clarity):

  • āœ… create_diagnostic_script → build_script_from_commands

  • āœ… execute_batch_script → execute_script_content

Version 3.0 (December 2024)

  • āœ… Converted from PostgreSQL to SQLite

  • āœ… Eliminated Docker dependency

  • āœ… Multi-server support with server selection

  • āœ… Machine identity tracking (hardware fingerprints)

  • āœ… Conversation management (pause/resume)

  • āœ… Recipe system for automation

  • āœ… Batch script execution with progress tracking

  • āœ… SFTP directory transfer with compression

  • āœ… Comprehensive database integration

  • āœ… Full audit trail

  • āœ… WebSocket-based multi-terminal synchronization

Version 2.0 (October 2024)

  • āœ… Dual-stream architecture

  • āœ… Smart output filtering

  • āœ… Web terminal auto-open

  • āœ… MCP integration with Claude

Version 1.0 (Initial Release)

  • āœ… Basic SSH command execution

  • āœ… Simple web terminal

  • āœ… PostgreSQL backend


šŸ“ž Support

For issues or questions:

  1. Check Documentation

  2. Review Logs

    • Claude Desktop logs (Help → Show Logs)

  3. Test Components

    • Use standalone mode (start_standalone.ps1)

    • Test SSH manually

    • Verify database (view_db.py)


šŸ“„ License

This project is for personal use by Tim. Not currently open source.


šŸ™ Acknowledgments

  • Anthropic - Claude and MCP protocol

  • Paramiko - SSH library

  • FastAPI - Web framework

  • NiceGUI - UI components with WebSocket support


Ready to let Claude manage your servers? Check out


Version: 1.2.0 (Auto-config, user data preservation)
Last Updated: December 23, 2024
Maintainer: Tim

-
security - not tested
A
license - permissive license
-
quality - not tested

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/TiM00R/remote-terminal'

If you have feedback or need assistance with the MCP directory API, please join our Discord server