Raspberry Pi Connect (Raspi Connect / RPi Connect) MCP

v0.2.1
io.github.kritzerenkrieg/raspberry-pi-connect-mcp Checked 7 hours ago Published 5 days ago

Raspi Connect MCP: shell access to Raspberry Pi devices via Raspberry Pi Connect web shell

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

list_devices

List devices on the Raspberry Pi Connect account with online status and whether remote shell is allowed.

run_command

Run a shell command on a device through its Connect remote shell and return output + exit code. The shell session persists between calls (cwd, env vars). First call to a device takes ~30s to connect. Commands that wait for input (sudo password, editors, confirmations) will time out; use send_keys/read_screen for those.

ParameterTypeDescription
command *stringShell command line (bash) to run
device *stringDevice name (or unique substring of it) or device UUID, as shown by list_devices
timeout_secintegerMax seconds to wait for completion

send_keys

Send raw keystrokes to a device shell (for interactive programs). Supports escapes: "\n" Enter, "\x03" Ctrl-C, "\x04" Ctrl-D, "\t" Tab, "\x1b" Esc, "\x1b[A" Up. Returns the current screen.

ParameterTypeDescription
device *stringDevice name (or unique substring of it) or device UUID, as shown by list_devices
keys *stringKeys to send; JSON-style escapes are interpreted

read_screen

Read the current terminal screen (plus a little scrollback) of a device shell.

ParameterTypeDescription
device *stringDevice name (or unique substring of it) or device UUID, as shown by list_devices
linesintegerLast N lines (0 = screen + 20 lines)

close_session

Close the remote shell session to a device.

ParameterTypeDescription
device *stringDevice name (or unique substring of it) or device UUID, as shown by list_devices

account

Show which Raspberry Pi Connect account is signed in (email when it can be read), when the session was saved, its device names, and whether a login is in progress.

login

Sign in to Raspberry Pi Connect: opens a Chrome window on this computer where the USER signs in by hand (tell them to do so). Waits up to wait_sec for it; if still in progress, call account later. fresh=true signs out the current account first (switch account). The new session is used right away.

ParameterTypeDescription
freshbooleanSign out first (current session backed up), to switch account
wait_secintegerSeconds to wait for the user to finish

logout

Sign out of Raspberry Pi Connect. The session and Chrome profile are moved to a backup folder (old-account_<time>) so the account can be restored, or deleted with delete=true.

ParameterTypeDescription
deletebooleanDelete the session instead of backing it up