rk server
Summary
Start RSG SDK HTTP server for API access.
Description
The server provides REST API endpoints for device management and integrates with VSCode extensions and AI assistants via MCP protocol. When no subcommand is given, or the first argument starts with --, rk server starts the server exactly as rk server start does.
Usage
rk server [subcommand] [options]Examples
rk server
rk server start
rk server stop
rk server statusEnvironment variables
| Environment variable | Description |
|---|---|
RK_DISABLE_RATE_LIMIT | Set to 1 or true to disable the rk server request rate limiter; rk server start --no-rate-limit sets it to 1. It is read once at startup, so a server that is already running has to be restarted for it to matter. |
RK_RATE_LIMIT_MAX | Overrides the rk server maximum requests per rate-limit window; rk server start --rate-limit-max sets it. An invalid value warns and falls back to the default. |
RK_RATE_LIMIT_WINDOW_MS | Overrides the rk server rate-limit window length in milliseconds; rk server start --rate-limit-window sets it. An invalid value warns and falls back to the default. |
All documented variables are listed on rk environment variables.
start
Summary
Start the rk server.
Description
Starts the rk server if not already running. The server binds to localhost on a port derived from the workspace root path, writes server info to .roku/rk-server.json for client discovery, and automatically exits after a period of inactivity. If a server is already running, this command does nothing.
Usage
rk server start [--port <port>] [--timeout <min>] [--lifecycle <mode>] [--daemon] [--no-rate-limit] [--rate-limit-max <n>] [--rate-limit-window <ms>]Options
| Flag | Value/type | Allowed values | Default | Required |
|---|---|---|---|---|
--port | port (number) | — | derived from rk root | no |
--timeout | min (number) | — | 240 | no |
--lifecycle | mode (string) | unmanaged, managed | unmanaged | no |
--daemon | boolean | — | — | no |
--no-rate-limit | boolean | — | — | no |
--rate-limit-max | n (number) | — | — | no |
--rate-limit-window | ms (number) | — | — | no |
--port
Port to bind the server. Blocked ports are rejected.
--timeout
Inactivity timeout in minutes. The server automatically shuts down after this period of inactivity. Set to 0 to disable automatic shutdown entirely.
--lifecycle
Server lifecycle mode.
--daemon
Start the server as a detached background process and exit.
--no-rate-limit
Disable the request rate limiter (sets RK_DISABLE_RATE_LIMIT=1). If you hit the default cap, pass this (or raise it with --rate-limit-max) rather than working around it.
--rate-limit-max
Override max requests per window (sets RK_RATE_LIMIT_MAX).
--rate-limit-window
Override rate-limit window length in ms (sets RK_RATE_LIMIT_WINDOW_MS).
Examples
rk server start
rk server start --daemon
rk server start --port 8080
rk server start --timeout 1
rk server start --lifecycle managed
rk server start --no-rate-limit --daemon
rk server start --rate-limit-max 2000 --rate-limit-window 60000stop
Summary
Stop the running rk server.
Description
Finds the server the same way rk server status does, through the .roku/rk-server.json file under the rk root, and falls back to the port derived from the rk root when there is no usable port file. It asks that server to exit gracefully, then polls health until it stops answering or the shutdown wait expires. If the wait expires, it reports that the server is still shutting down and exits successfully. If no server is running, it reports that and exits successfully.
Usage
rk server stop [--port <port>]Options
| Flag | Value/type | Default | Required |
|---|---|---|---|
--port | port (number) | the port in .roku/rk-server.json, else derived from rk root | no |
--port
Port of the running server to stop.
Examples
rk server stop
rk server stop --port 8080status
Summary
Show rk server status.
Description
Reports whether the current workspace's rk server is reachable, using the .roku/rk-server.json file under the rk root. If the server is not running or unreachable, rk server status still exits successfully and reports that state.
Usage
rk server status [--json]Options
| Flag | Value/type | Required |
|---|---|---|
--json | boolean | no |
--json
Print machine-readable status output.
Examples
rk server status
rk server status --jsonUpdated about 4 hours ago