Remote Terminal MCP

v1.3.3
io.github.TiM00R/remote-terminal Checked 1 day ago Published 6 months ago

Complete SSH terminal for Linux with AI/user control and dual-stream visibility

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

open_terminal

Open the web terminal in a browser tab. If a terminal tab is already open, closes it and opens a fresh one. If the web server is not running, starts it first. Use this when the terminal tab has been lost or closed.

list_servers

List all configured servers with their details. Shows server status markers: - [CURRENT]: Currently connected server - [DEFAULT]: Default server (auto-connects when no server specified) Returns: Server names, hosts, ports, users, descriptions, tags, and status markers.

select_server

Select and connect to a server by name, IP, or tag. ⚠️ CRITICAL CLAUDE WORKFLOW: When this tool returns 'open_conversations' in the response, Claude MUST: 1. STOP and present the information to the user 2. ASK the user to choose ONE of these options: - Resume specific conversation: "resume conversation [ID]" - Start new conversation: "start new conversation for [goal]" - Run without conversation: "run commands without conversation" 3. Wait for user's explicit choice 4. Execute the choice (start_conversation, resume_conversation, or set no-conversation mode) 5. After user choice,…

ParameterTypeDescription
identifier *stringServer name, host IP, or tag
force_identity_checkbooleanForce re-read machine_id even if cached (default: False)

get_current_server

Get the currently connected server information

set_default_server

Set default server (shown in list_servers with [DEFAULT] marker). The default server is the preferred server for operations that don't specify a server. When you execute commands without an active connection, Claude will automatically connect to the default server. Note: Use list_servers to see which server is currently marked as default.

ParameterTypeDescription
identifier *stringServer name or host to set as default

execute_command

Execute command on remote Linux machine with smart completion detection. BEHAVIOR: - Waits for command completion (detects prompt return) OR timeout - Returns smart-formatted output based on output_mode - Full output stored in buffer - Optionally tracks in conversation for rollback support TIMEOUT: - Default: 10 seconds (sufficient for most commands) - Override for long operations: timeout=300 (5 min), timeout=1800 (30 min) - Maximum: 3600 seconds (1 hour) OUTPUT_MODE OPTIONS: - "auto" (default): Smart output based on command type and size * < 100 lines: returns full output * >= 100 lin…

ParameterTypeDescription
command *stringThe command to execute
conversation_idintegerOptional: Associate command with conversation for tracking and rollback
output_modestringOutput format: auto, full, preview, summary, minimal, raw
timeoutnumberMaximum seconds to wait (default: 10, max: 3600)

check_command_status

Check status of a long-running command. OUTPUT_MODE: Same options as execute_command - "auto": Smart decision based on output size - "full": Get complete output (for completed commands) - "preview": Peek at first/last lines - "summary": Just metadata (polling frequently) - "minimal": Status only - "raw": Complete unfiltered output (no truncation, no filtering) Use "summary" or "minimal" when polling frequently to save tokens. Use "full" when command completes and you need results.…

ParameterTypeDescription
command_id *stringCommand ID returned by execute_command
output_modestringOutput format: auto, full, preview, summary, minimal, raw

get_command_output

Get full unfiltered output of a command. WARNING: Uses more tokens than filtered output.

ParameterTypeDescription
command_id *stringCommand ID
rawbooleanIf true, returns completely unfiltered output

cancel_command

Send Ctrl+C to a running command. Use when user wants to stop a long-running command.

ParameterTypeDescription
command_id *stringCommand ID to cancel

list_session_commands

List tracked commands from current session with status. Shows commands in CommandRegistry (in-memory, max 50). Useful for checking what's currently running or was recently executed in this session. For historical commands from database, use list_command_history instead.

ParameterTypeDescription
status_filterstringOptional: 'running', 'completed', or 'killed'

list_command_history

List command execution history from database with flexible filters. Query persistent command history across all servers and sessions. Useful for: - Reviewing what commands were executed on a server - Finding commands from specific dates or time periods - Debugging by examining command history - Auditing command execution - Analyzing errors across multiple sessions Returns database records with integer IDs, command text, execution status, timestamps, error information, and conversation context when available. By default, shows commands from the currently connected server.

ParameterTypeDescription
after_datestringOnly commands after this date (ISO format: YYYY-MM-DD)
before_datestringOnly commands before this date (ISO format: YYYY-MM-DD, exclusive)
conversation_idintegerFilter by conversation ID
has_errorsbooleanOnly show commands with errors (true) or without errors (false)
limitintegerNumber of commands to return (default: 50, max: 500)
machine_idstringFilter by server machine ID (uses current server if omitted)
offsetintegerSkip this many commands (for pagination, default: 0)
orderstringSort order (default: newest_first)
statusstringFilter by execution status

get_terminal_status

Check the connection status of the remote terminal

upload_file

Upload a file from local machine to remote server via SFTP

ParameterTypeDescription
local_path *stringAbsolute path to local file (e.g., 'C:/Users/Tim/config.json')
remote_path *stringAbsolute path on remote server (e.g., '/home/tstat/config.json')
chmodintegerOptional octal permissions in decimal (e.g., 493 for 0o755)
overwritebooleanIf false, error if remote file exists (default: true)
preserve_timestampbooleanCopy local modification time to remote file (default: true)

download_file

Download a file from remote server to local machine via SFTP

ParameterTypeDescription
local_path *stringAbsolute path for local destination (e.g., 'C:/Downloads/app.log')
remote_path *stringAbsolute path on remote server (e.g., '/home/tstat/app.log')
overwritebooleanIf false, error if local file exists (default: true)
preserve_timestampbooleanCopy remote modification time to local file (default: true)

list_remote_directory

List contents of a remote directory

ParameterTypeDescription
remote_path *stringRemote directory path (e.g., '/home/tstat')
recursivebooleanTraverse subdirectories (default: false)
show_hiddenbooleanInclude files starting with '.' (default: false)

get_remote_file_info

Get detailed information about a remote file or directory

ParameterTypeDescription
remote_path *stringRemote file or directory path (e.g., '/home/tstat/config.json')

upload_directory

Smart directory upload with automatic compression and progress tracking. Automatically decides whether to use compression and background mode based on transfer characteristics.

ParameterTypeDescription
local_path *stringAbsolute path to local directory (e.g., 'C:/Projects/myapp')
remote_path *stringAbsolute path on remote server (e.g., '/home/tstat/myapp')
backgroundbooleanBackground mode: null = auto-decide, true = force, false = block
chmod_dirsintegerDirectory permissions in decimal (e.g., 493 for 0o755)
chmod_filesintegerFile permissions in decimal (e.g., 420 for 0o644)
compressionstringCompression mode: 'auto' (default), 'always', 'never'
exclude_patternsarrayGlob patterns to exclude (None = use defaults: .git, __pycache__, node_modules, etc.)
if_existsstringConflict resolution: 'merge' (default), 'overwrite', 'skip', 'error'
preserve_timestampsbooleanCopy local modification times (default: true)
recursivebooleanInclude subdirectories (default: true)

download_directory

Smart directory download with automatic compression and progress tracking. Automatically decides whether to use compression and background mode based on transfer characteristics.

ParameterTypeDescription
local_path *stringAbsolute path for local destination (e.g., 'C:/Projects/myapp')
remote_path *stringAbsolute path on remote server (e.g., '/home/tstat/myapp')
backgroundbooleanBackground mode: null = auto-decide, true = force, false = block
compressionstringCompression mode: 'auto' (default), 'always', 'never'
exclude_patternsarrayGlob patterns to exclude (None = use defaults)
if_existsstringConflict resolution: 'merge' (default), 'overwrite', 'skip', 'error'
preserve_timestampsbooleanCopy remote modification times (default: true)
recursivebooleanInclude subdirectories (default: true)

execute_script_content

Execute multi-command batch script on remote Linux server. OUTPUT_MODE_GUIDANCE: Use output_mode='full' for diagnostic commands with expected concise output. Full output returns directly in the response for immediate analysis. LOG_FILE_LOCATION: Script output is automatically saved to the local user's home directory: - %USERPROFILE%\mcp_batch_logs\batch_output_[timestamp].log Use Aspen tools (apsen-tool_v2:read_file) with project root ~\mcp_batch_logs to access saved log files for post-execution analysis—for example, extracting specific error context, parsing structured data, debugging by…

ParameterTypeDescription
description *stringWhat this script does (for logging/tracking)
script_content *stringComplete bash script content with step markers
conversation_idintegerOptional: Link batch to conversation for tracking
output_modestringOutput format: summary (efficient, default) or full (includes complete output)
timeoutintegerMax execution time in seconds (default: 300 = 5 min)

build_script_from_commands

Helper tool to create a batch (shell) script from command list. Useful for AI to quickly build properly formatted scripts. Example: commands = [ {"description": "Network interfaces", "command": "ip link show"}, {"description": "Routing table", "command": "ip route show"}, {"description": "DNS config", "command": "cat /etc/resolv.conf"} ]

ParameterTypeDescription
commands *arrayList of command objects with 'description' and 'command' fields
descriptionstringOverall script description