Config Reference
mcpr looks for mcpr.toml in the current directory, then parent directories.
All fields
Section titled “All fields”Top-level
Section titled “Top-level”| Field | Type | Default | Description |
|---|---|---|---|
mcp | string | required | Upstream MCP server URL |
widgets | string | — | Widget source: URL to proxy, or local path for static serving |
port | number | 3000 | Local proxy port |
no_tunnel | boolean | false | Disable tunnel, direct HTTP mode |
no_tui | boolean | false | Disable TUI dashboard (for Docker/CI) |
drain_timeout | number | 30 | Graceful shutdown timeout in seconds |
log_format | string | json | Stderr log format: json or pretty |
admin_bind | string | 127.0.0.1:9901 | Admin API bind address (set to none to disable) |
tunnel_token | string | auto-generated | Tunnel authentication token |
relay_url | string | tunnel.mcpr.app | Custom relay server URL |
csp | string[] | — | Extra CSP domains to include in injected headers |
csp_mode | string | extend | CSP mode: extend adds to auto-detected headers, override replaces them |
[cloud] section
Section titled “[cloud] section”| Field | Type | Default | Description |
|---|---|---|---|
token | string | — | Cloud authentication token from cloud.mcpr.app |
server | string | — | Server slug to identify this proxy in your cloud project |
endpoint | string | https://api.mcpr.app | Custom ingest endpoint URL |
batch_size | number | — | Events per batch before flushing |
flush_interval_ms | number | — | Flush interval in milliseconds |
Auto-generated fields
Section titled “Auto-generated fields”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.
Examples
Section titled “Examples”Minimal
Section titled “Minimal”mcp = "http://localhost:9000"Development with widgets
Section titled “Development with widgets”mcp = "http://localhost:9000"widgets = "http://localhost:4444"Production (no tunnel)
Section titled “Production (no tunnel)”mcp = "http://localhost:9000"no_tunnel = trueport = 8080Static widgets from disk
Section titled “Static widgets from disk”mcp = "http://localhost:9000"widgets = "./widgets/dist"With cloud sync
Section titled “With cloud sync”mcp = "http://localhost:9000"widgets = "http://localhost:4444"
[cloud]token = "mcpr_xxxxxxxx"server = "my-proxy"Full-featured
Section titled “Full-featured”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"Custom relay
Section titled “Custom relay”mcp = "http://localhost:9000"relay_url = "https://relay.yourdomain.com"Local development (no tunnel)
Section titled “Local development (no tunnel)”mcp = "http://localhost:9000"no_tunnel = trueport = 3000Config templates
Section titled “Config templates”See config_examples/ in the repository for ready-to-use templates.
[logging] section
Section titled “[logging] section”| Field | Type | Default | Description |
|---|---|---|---|
file | boolean | false | Enable JSONL file logging |
dir | string | ./logs | Directory for log files |
rotation | string | daily | Rotation strategy: daily or size:50MB |
Environment variables
Section titled “Environment variables”| Variable | Description |
|---|---|
MCPR_RELAY_URL | Custom relay server URL |
MCPR_CLOUD_TOKEN | Cloud sync token (from cloud.mcpr.app) |
MCPR_AUTH_PROVIDER | Auth provider URL (relay mode) |
MCPR_AUTH_PROVIDER_SECRET | Auth provider shared secret (relay mode) |
MCPR_NO_TUI | Set to 1 to disable TUI (set by default in Docker image) |
MCPR_TUI | Set to 1 to force TUI on |
Environment variables override mcpr.toml values but are overridden by CLI flags.
