Skip to content

CLI Reference

Terminal window
mcpr [COMMAND] [OPTIONS]
CommandDescription
runStart proxy in foreground (default if omitted)
validateValidate config file and exit
versionPrint version info as JSON

Backward compat: mcpr --mcp http://... (no subcommand) still works and defaults to run.

Config priority: CLI args > environment variables > mcpr.toml > defaults

Start the proxy in the foreground. This is the default when no subcommand is given.

FlagDescriptionDefault
--mcp <URL>Upstream MCP server URLrequired
--widgets <URL|PATH>Widget source — URL to proxy, or local path for static serving
--port <PORT>Local proxy port3000
--no-tunnelDirect HTTP mode, no tunnelfalse
--eventsEmit structured JSON events to stdoutfalse
--csp <DOMAIN>Extra CSP domains (repeatable)
--csp-mode <MODE>CSP mode: extend (default) or overrideextend
--cloud-token <TOKEN>Cloud sync token (from cloud.mcpr.app)
--cloud-server <SLUG>Server slug for cloud routing
--relay-url <URL>Custom relay server URLtunnel.mcpr.app
FlagDescriptionDefault
--tuiForce TUI dashboard onauto-detect
--no-tuiForce TUI dashboard off (for Docker/CI)false
--drain-timeout <SECS>Graceful shutdown timeout30
--log-format <FMT>Stderr log format: json or prettyjson
--admin-bind <ADDR>Admin API bind address (set to none to disable)127.0.0.1:9901

Run mcpr as a relay server instead of a proxy:

FlagDescription
--relayRun in relay server mode
--relay-domain <DOMAIN>Relay base domain (required in relay mode)
--auth-provider <URL>External auth provider URL
--auth-provider-secret <SECRET>Auth provider shared secret

Validate a config file and exit with code 0 (valid) or 1 (errors).

FlagDescriptionDefault
-c, --config <PATH>Config file to validate./mcpr.toml
--dumpDump resolved config after validationfalse
Terminal window
mcpr validate
mcpr validate -c /etc/mcpr/mcpr.toml

Print version and build info as JSON.

Terminal window
mcpr version
# {"version":"0.3.0","target":"aarch64-apple-darwin"}
VariableDescription
MCPR_RELAY_URLCustom relay server URL
MCPR_CLOUD_TOKENCloud sync token (from cloud.mcpr.app)
MCPR_AUTH_PROVIDERAuth provider URL (relay mode)
MCPR_AUTH_PROVIDER_SECRETAuth provider shared secret (relay mode)
MCPR_NO_TUISet to 1 to disable TUI (set by default in Docker image)
MCPR_TUISet to 1 to force TUI on

The admin API runs on a separate port (default 127.0.0.1:9901), designed for health probes and operational tooling.

MethodPathDescription
GET/healthzLiveness — 200 unless shutting down
GET/readyReadiness — 503 while draining or MCP upstream disconnected
GET/versionVersion info as JSON

Disable with --admin-bind none.

SignalAction
SIGTERMGraceful drain then shutdown (K8s sends this)
SIGINTSame as SIGTERM

On receiving a shutdown signal, mcpr:

  1. Marks /ready as 503
  2. Stops accepting new connections
  3. Waits for in-flight requests (up to --drain-timeout)
  4. Flushes logs
  5. Exits
Terminal window
# Minimal — MCP server with tunnel
mcpr run --mcp http://localhost:9000
# MCP + widgets with tunnel
mcpr run --mcp http://localhost:9000 --widgets http://localhost:4444
# Local only, no tunnel
mcpr run --mcp http://localhost:9000 --no-tunnel --port 3000
# Production — headless with JSON logs
mcpr run --mcp http://localhost:9000 --no-tunnel --port 8080 --no-tui
# Human-readable logs for debugging
mcpr run --mcp http://localhost:9000 --no-tui --log-format pretty
# Custom admin port
mcpr run --mcp http://localhost:9000 --admin-bind 0.0.0.0:9901
# Validate config
mcpr validate -c ./mcpr.toml
# Run as relay server
mcpr run --relay --relay-domain tunnel.yourdomain.com --port 443

mcpr also reads from mcpr.toml. See Configuration and Config Reference.