remote-debug-mcp

v0.2.1
remote-debug-mcp Checked 7 hours ago Published 5 months ago

MCP server for remote debugging via SSH and Telnet with persistent background connections

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

ssh_connect

SSH connect using a named configuration from config.yaml. Auto-detects remote OS (Linux/Windows). Supports auto-reconnect on connection loss. Use list_connections to see available config entries.

ParameterTypeDescription
config_name *stringName of the connection in config.yaml (e.g. 'windows-pc')
session_id *stringUnique session ID (reusing overwrites old)
max_retriesintegerMax auto-reconnect attempts (default 3)

ssh_execute

Execute command on a connected SSH session. Automatically adapts to Linux (bash) or Windows (PowerShell) remote shell. Triggers auto-reconnect if connection dropped.

ParameterTypeDescription
command *stringCommand to execute
session_id *stringSession ID from ssh_connect
timeoutintegerTimeout seconds (default 30)

ssh_disconnect

Close and remove an SSH session.

ParameterTypeDescription
session_id *stringSession ID

ssh_upload

Upload file via SCP or SFTP. Automatically adapts path format for Linux/Windows targets.

ParameterTypeDescription
local_path *stringLocal file path
remote_path *stringRemote destination
session_id *stringSession ID

ssh_download

Download file via SCP or SFTP. Automatically adapts path format for Linux/Windows targets.

ParameterTypeDescription
local_path *stringLocal destination
remote_path *stringRemote file path
session_id *stringSession ID

ssh_list

List all active SSH sessions with platform and status.

telnet_connect

Connect to remote host via Telnet, persistent background session. All connection parameters come from the com2tcp config in config.yaml. Look up com2tcp config by name, resolve host from linked SSH config, and use configured telnet_port, timeout, buffer settings, and auto-reconnect policy. Use list_connections to see available configs. Use save_config to create/update com2tcp entries.

ParameterTypeDescription
config_name *stringName of the com2tcp config in config.yaml (e.g. 'com2tcp_COM4_5200'). All connection params are read from this config.
session_id *stringUnique session ID (reusing overwrites old)

telnet_send

Send data to a Telnet session. timeout=0: send and return immediately (no wait). timeout>0: send then wait for response. Supports auto-reconnect. Special values: __CTRL_C__, __CTRL_D__, __CTRL_Z__.

ParameterTypeDescription
data *stringData/command to send
session_id *stringSession ID
timeoutintegerWait timeout seconds. 0 = no wait (default), >0 = wait for response

telnet_listen

Listen on a Telnet session for a specified duration, returning all newly received data (consumer pattern: data is consumed after read). Supports multiple encodings for binary data.

ParameterTypeDescription
session_id *stringSession ID
durationintegerListen duration seconds (default 10)
encodingstringOutput encoding: utf-8 (text), base64 (binary safe), hex (binary safe)

telnet_disconnect

Close and remove a Telnet session.

ParameterTypeDescription
session_id *stringSession ID

telnet_list

List all active Telnet sessions with status and buffer sizes.

setup_com2tcp

Complete com2telnet deployment workflow: 1. SSH upload com2telnet.py + pyproject.toml to D:\remote-debug\com2telnet\ on Windows PC 2. Install com2telnet + dependencies (pyserial) via pip 3. Kill any previous com2telnet instance on the same port 4. Start com2telnet in background (PowerShell Start-Process -WindowStyle Hidden) 5. Verify process is running After setup, use telnet_connect to host:telnet_port to access serial data from the COM port. Example: setup_com2tcp with com_port='COM4', telnet_port=5200 runs: com2telnet --serial COM4:5200:115200

ParameterTypeDescription
com_port *stringCOM port name (e.g. COM4)
ssh_session_id *stringSSH session ID (must already be connected to the Windows PC with the COM port)
telnet_port *integerTelnet port to expose (e.g. 5200)
baudintegerBaud rate (default 115200)

list_connections

List all configured connections from config.yaml. Shows SSH and com2tcp entries.

save_config

Save configuration to config.yaml. This is the unified entry for creating/updating connection configs. When no config.yaml exists: ask user for connection details (host, port, username, password for SSH; ssh_config_name, com_port, telnet_port for com2tcp), then call this tool with 'connections' parameter. When setup_com2tcp completes, call this tool with the com2tcp connection details to persist them. When called without arguments, saves current in-memory config.

ParameterTypeDescription
connectionsarrayConnections to save/merge. type=ssh: {name, host, port, username, password, key_file?}. type=com2tcp: {name, ssh, com_port, telnet_port, baud, connect_timeout?, buffer_max_size?, max_retries?, usernam…

telnet_start_monitor

Start background monitoring on a Telnet session. Data is continuously read into a circular buffer (max 900000 lines, oldest evicted when full). Optionally append to a file continuously.

ParameterTypeDescription
session_id *stringTelnet session ID
output_filestringOptional local file path to continuously append received data

telnet_stop_monitor

Stop background monitoring on a Telnet session. Returns the total line count captured.

ParameterTypeDescription
session_id *stringTelnet session ID

list_sessions

List all active SSH and Telnet sessions.