Skip to content

Config Reference

mcpr looks for mcpr.toml in the current directory, then parent directories.

FieldTypeDefaultDescription
mcpstringrequiredUpstream MCP server URL
widgetsstringWidget source: URL to proxy, or local path for static serving
portnumber3000Local proxy port
no_tunnelbooleanfalseDisable tunnel, direct HTTP mode
no_tuibooleanfalseDisable TUI dashboard (for Docker/CI)
drain_timeoutnumber30Graceful shutdown timeout in seconds
log_formatstringjsonStderr log format: json or pretty
admin_bindstring127.0.0.1:9901Admin API bind address (set to none to disable)
tunnel_tokenstringauto-generatedTunnel authentication token
relay_urlstringtunnel.mcpr.appCustom relay server URL
cspstring[]Extra CSP domains to include in injected headers
csp_modestringextendCSP mode: extend adds to auto-detected headers, override replaces them
FieldTypeDefaultDescription
tokenstringCloud authentication token from cloud.mcpr.app
serverstringServer slug to identify this proxy in your cloud project
endpointstringhttps://api.mcpr.appCustom ingest endpoint URL
batch_sizenumberEvents per batch before flushing
flush_interval_msnumberFlush interval in milliseconds

On first run, mcpr generates a tunnel_token and appends it to mcpr.toml. This keeps your tunnel URL stable across restarts. You don’t need to set it manually.

mcp = "http://localhost:9000"
mcp = "http://localhost:9000"
widgets = "http://localhost:4444"
mcp = "http://localhost:9000"
no_tunnel = true
port = 8080
mcp = "http://localhost:9000"
widgets = "./widgets/dist"
mcp = "http://localhost:9000"
widgets = "http://localhost:4444"
[cloud]
token = "mcpr_xxxxxxxx"
server = "my-proxy"
mcp = "http://localhost:9000"
widgets = "http://localhost:4444"
port = 3000
# no_tunnel = true # uncomment for production (disables tunnel)
tunnel_token = "tok_abc123..."
csp = ["cdn.example.com", "api.example.com"]
csp_mode = "extend"
[cloud]
token = "mcpr_xxxxxxxx"
server = "my-proxy"
mcp = "http://localhost:9000"
relay_url = "https://relay.yourdomain.com"
mcp = "http://localhost:9000"
no_tunnel = true
port = 3000

See config_examples/ in the repository for ready-to-use templates.

FieldTypeDefaultDescription
filebooleanfalseEnable JSONL file logging
dirstring./logsDirectory for log files
rotationstringdailyRotation strategy: daily or size:50MB
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

Environment variables override mcpr.toml values but are overridden by CLI flags.